:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1c2333;
  --ink-2: #5b6478;
  --line: #e3e7f0;
  --brand: #3b6cf6;
  --brand-2: #7c4df3;
  --ok: #16a34a;
  --warn: #d97706;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(28, 35, 51, .06);
  --shadow-lg: 0 10px 30px rgba(28, 35, 51, .12);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--brand); text-decoration: none; }
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 24px 20px 60px; }

/* ---------- header ---------- */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); }
.brand-name { font-weight: 700; font-size: 17px; }
.brand-domain { font-size: 12px; color: var(--ink-2); background: var(--bg); padding: 2px 8px; border-radius: 20px; }
.site-nav a { font-size: 14px; color: var(--ink-2); }
.site-nav a:hover { color: var(--brand); }

/* ---------- home ---------- */
.hero { text-align: center; padding: 34px 10px 10px; }
.hero h1 {
  font-size: 34px; font-weight: 800;
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-sub { margin-top: 8px; color: var(--ink-2); font-size: 15px; letter-spacing: 1px; }
.hero-note { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.hero-note b { color: var(--ok); }
.home-search {
  margin-top: 20px; width: min(460px, 92%);
  padding: 12px 18px; font-size: 15px;
  border: 1px solid var(--line); border-radius: 30px; outline: none;
  background: var(--card); box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .15s;
}
.home-search:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 108, 246, .15); }
.cat { margin-top: 34px; }
.cat-title { font-size: 15px; color: var(--ink-2); font-weight: 600; padding-left: 10px; border-left: 3px solid var(--brand); margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.card-body h3 { font-size: 16px; margin-bottom: 6px; }
.card-body p { font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.card-icon { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(120deg, rgba(59,108,246,.12), rgba(124,77,243,.12)); }
.card-icon::before { content: ""; display: block; width: 100%; height: 100%; background: var(--icon) center/22px no-repeat; }
.icon-wand { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b6cf6" stroke-width="2" stroke-linecap="round"><path d="M15 4V2M15 16v-2M8 9h2M20 9h2M17.8 11.8l1.4 1.5M17.8 6.2l1.4-1.5M12.2 6.2l-1.4-1.5M3 21l9-9"/></svg>'); }
.icon-img { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b6cf6" stroke-width="2" stroke-linecap="round"><rect x="3" y="3" width="18" height="18" rx="2"/><circle cx="8.5" cy="8.5" r="1.5"/><path d="m21 15-5-5L5 21"/></svg>'); }
.icon-film { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b6cf6" stroke-width="2" stroke-linecap="round"><rect x="2" y="3" width="20" height="18" rx="2"/><path d="M7 3v18M17 3v18M2 8h5M2 16h5M17 8h5M17 16h5"/></svg>'); }
.icon-sliders { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b6cf6" stroke-width="2" stroke-linecap="round"><path d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6"/></svg>'); }
.icon-pdf { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b6cf6" stroke-width="2" stroke-linecap="round"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><path d="M14 2v6h6M9 15h1.5a1.5 1.5 0 0 0 0-3H9v6"/></svg>'); }
.icon-code { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b6cf6" stroke-width="2" stroke-linecap="round"><path d="m16 18 6-6-6-6M8 6l-6 6 6 6"/></svg>'); }
.badge { position: absolute; top: 14px; right: 14px; font-size: 11px; padding: 2px 8px; border-radius: 20px; }
.badge-local { color: var(--ok); background: rgba(22, 163, 74, .1); }
.badge-server { color: var(--warn); background: rgba(217, 119, 6, .1); }

/* ---------- tool views ---------- */
.view { display: none; }
.view.active { display: block; animation: fadein .18s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tool-head { margin-bottom: 18px; }
.tool-head h1 { font-size: 24px; }
.tool-head p { margin-top: 8px; font-size: 14px; color: var(--ink-2); line-height: 1.7; }
.local-tag { color: var(--ok); }
.server-tag { color: var(--warn); }

.dropzone {
  border: 2px dashed #c5cede; border-radius: var(--radius);
  padding: 44px 20px; text-align: center; cursor: pointer;
  background: var(--card); color: var(--ink-2); font-size: 15px;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: rgba(59, 108, 246, .04); }
.dropzone b { color: var(--brand); }
.dz-hint { font-size: 12px; margin-top: 6px; color: #9aa3b5; }
.hidden { display: none !important; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 16px; margin: 14px 0; box-shadow: var(--shadow);
}
.ctrl { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.ctrl input[type=range] { accent-color: var(--brand); }
.mode-group { display: flex; flex-wrap: wrap; gap: 8px; }
.mode-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink-2);
  padding: 7px 14px; border-radius: 9px; font-size: 13px; cursor: pointer;
  transition: all .12s;
}
.mode-btn:hover { border-color: var(--brand); color: var(--brand); }
.mode-btn.active { background: linear-gradient(100deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }

.wm-stage, .vw-stage {
  position: relative; background: #20242e; border-radius: var(--radius);
  display: flex; justify-content: center; overflow: hidden; box-shadow: var(--shadow);
}
.wm-stage canvas, .vw-stage canvas { max-width: 100%; touch-action: none; cursor: crosshair; }
#wm-mask { position: absolute; left: 0; top: 0; touch-action: none; cursor: crosshair; pointer-events: none; }
.vw-note { position: absolute; bottom: 8px; left: 12px; font-size: 12px; color: rgba(255,255,255,.65); pointer-events: none; }
.stage-hint { text-align: center; font-size: 12px; color: var(--ink-2); margin-top: 8px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.spacer { flex: 1; }
.btn {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 9px 18px; border-radius: 10px; font-size: 14px; cursor: pointer;
  transition: all .12s; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(100deg, var(--brand), var(--brand-2)); border-color: transparent; color: #fff; }
.btn-primary:hover { color: #fff; filter: brightness(1.08); }
.btn-ok { background: var(--ok); border-color: transparent; color: #fff; }
.btn-ok:hover { color: #fff; filter: brightness(1.08); }
.sel, .num, input[type=color] {
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: var(--card); color: var(--ink);
}
.num { width: 84px; }
input[type=color] { padding: 2px; height: 32px; width: 44px; cursor: pointer; }

.file-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.file-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 13px;
}
.file-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: #eee; }
.file-row .fname { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fmeta { color: var(--ink-2); white-space: nowrap; }
.file-row .arrow { color: var(--brand); }
.file-meta { font-size: 13px; color: var(--ink-2); }

.job-status { font-size: 13px; color: var(--ink-2); }
.job-status.err { color: #dc2626; }
.progress { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin-top: 12px; }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .4s; }

.mode-desc { font-size: 13px; color: var(--ink-2); margin: 4px 0 10px; min-height: 18px; }
.pdf-modes { margin-bottom: 4px; }
#pdf-opts:empty { display: none; }

.tx-area {
  width: 100%; padding: 14px; font-size: 14px; line-height: 1.6;
  font-family: "Cascadia Code", Consolas, monospace;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card); color: var(--ink); outline: none; resize: vertical;
  margin-top: 6px;
}
.tx-area:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59, 108, 246, .12); }

.price-num { font-size: 26px; font-weight: 800; color: var(--brand); margin: 6px 0; }
.price-card.hot { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(59,108,246,.15), var(--shadow); }
.hot-tag { font-size: 11px; color: #fff; background: linear-gradient(100deg, var(--brand), var(--brand-2)); padding: 2px 8px; border-radius: 20px; vertical-align: middle; }
.modal-quota { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #1c2333; color: #fff; font-size: 14px;
  padding: 10px 22px; border-radius: 30px; box-shadow: var(--shadow-lg);
  opacity: 0; transition: all .25s; z-index: 100; pointer-events: none; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%); }
.toast.err { background: #b91c1c; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: var(--card);
  text-align: center; padding: 22px 16px; font-size: 13px; color: var(--ink-2);
}
.foot-sub { font-size: 12px; color: #9aa3b5; margin-top: 6px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 26px; }
  .brand-domain { display: none; }
  .toolbar { gap: 10px; }
  .actions { gap: 8px; }
}

/* ---------- modal / 支付 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(15,20,35,.5); display: flex; align-items: center; justify-content: center; z-index: 200; animation: fadein .15s ease; }
.modal { background: var(--card); border-radius: 16px; padding: 22px 24px; width: min(420px, 92vw); box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 17px; margin-bottom: 12px; }
.modal .row { display: flex; gap: 8px; margin: 10px 0; align-items: center; }
.modal input[type=email], .modal input[type=text] { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; outline: none; }
.modal input:focus { border-color: var(--brand); }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.plans { display: grid; gap: 10px; }
.plan { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 11px; padding: 11px 14px; cursor: pointer; transition: all .12s; }
.plan:hover { border-color: var(--brand); }
.plan.sel { border-color: var(--brand); background: rgba(59,108,246,.06); box-shadow: 0 0 0 2px rgba(59,108,246,.12); }
.plan b { color: var(--brand); font-size: 16px; white-space: nowrap; }

/* ---------- 证件照 ---------- */
.ip-layout { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.ip-frame { position: relative; overflow: hidden; background: #dfe4ee; border-radius: 10px; box-shadow: var(--shadow); width: 260px; height: 364px; flex-shrink: 0; }
.ip-frame canvas { position: absolute; left: 0; top: 0; cursor: move; touch-action: none; }
.ip-side { flex: 1; min-width: 220px; }
.icon-id { --icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%233b6cf6" stroke-width="2" stroke-linecap="round"><rect x="3" y="4" width="18" height="16" rx="2"/><circle cx="9.5" cy="10.5" r="2.5"/><path d="M5.5 17c1-2.6 6-2.6 8 0M15.5 9h3M15.5 12.5h3"/></svg>'); }

/* ---------- 尺子 / markdown ---------- */
.ruler { position: relative; height: 90px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; box-shadow: var(--shadow); }
.tick { position: absolute; top: 0; width: 1px; background: #666; height: 12px; }
.tick.mid { height: 20px; }
.tick.big { height: 34px; width: 2px; background: #222; }
.tick.big::after { content: attr(data-num) "cm"; position: absolute; left: 4px; top: 8px; font-size: 11px; color: #222; }
.md-out { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; min-height: 200px; font-size: 14px; line-height: 1.8; }
.md-out pre { background: #20242e; color: #dfe6f3; padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md-out code { background: rgba(59,108,246,.08); padding: 1px 5px; border-radius: 4px; }
.md-out pre code { background: none; padding: 0; }
.md-out blockquote { border-left: 3px solid var(--brand); padding-left: 12px; color: var(--ink-2); }

.tk-spin { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: tkspin 0.9s linear infinite; vertical-align: -2px; }
@keyframes tkspin { to { transform: rotate(360deg); } }

/* ---------- 提词器 ---------- */
.tele-view { position: relative; height: 55vh; overflow: hidden; background: #14181f; border-radius: 14px; margin-top: 12px; }
.tele-scroll { color: #f4f6fb; text-align: center; line-height: 1.7; padding: 20px 30px; white-space: pre-wrap; will-change: transform; }
.tele-view::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--brand); opacity: .5; box-shadow: 0 0 12px var(--brand); }
