/* =========================================================
   SVG 图像工坊 复刻版 · 样式
   ========================================================= */
:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --border: #e4e7ee;
  --text: #1f2430;
  --text-2: #5b6474;
  --text-3: #9aa3b2;
  --primary: #4293e5;
  --primary-dark: #2e7cc9;
  --primary-soft: #e9f2fd;
  --success: #2bb673;
  --success-soft: #e7f8f0;
  --warning: #f0a13a;
  --danger: #e2544f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(31,36,48,.05), 0 8px 24px rgba(31,36,48,.06);
  --shadow-lg: 0 10px 40px rgba(31,36,48,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { height: 100%; }

body {
  /* 品牌硬约束：全站禁用微软雅黑，按 思源黑体 → 苹方 → 等线 → 文泉驿 顺序回退 */
  font-family: "Noto Sans SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Hiragino Sans GB", "DengXian",
    "WenQuanYi Micro Hei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* 页脚始终贴底：整页纵向 flex，内容区自动撑满剩余高度 */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部导航 ---------- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 80px; height: 80px;
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(66,147,229,.3);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-title-img { height: 60px; width: auto; display: block; }
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .3px; }
.brand-sub { display: block; font-size: 11px; color: var(--text-3); letter-spacing: 1px; }

.tabs { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 12px; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; background: transparent; cursor: pointer;
  padding: 8px 16px; border-radius: 9px;
  font-size: 14px; font-weight: 600; color: var(--text-2);
  transition: all .18s ease;
}
.tab-btn svg { width: 16px; height: 16px; }
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* ---------- 主容器 ---------- */
.container { max-width: 1200px; margin: 0 auto; padding: 28px 24px 64px; }
.panel { display: none; }
.panel.active { display: block; animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.panel-head { margin-bottom: 20px; }
.panel-title h2 { font-size: 24px; font-weight: 700; }
.panel-title p { color: var(--text-2); margin-top: 4px; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  border: none; cursor: pointer;
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: inherit;
  transition: all .16s ease; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(66,147,229,.32); }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; box-shadow: 0 4px 14px rgba(43,182,115,.3); }
.btn-success:hover:not(:disabled) { filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); color: var(--text-2); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- 上传区 ---------- */
.dropzone {
  background: var(--surface); border: 2px dashed var(--border);
  border-radius: var(--radius); padding: 46px 20px; text-align: center;
  cursor: pointer; transition: all .2s ease; margin-bottom: 16px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--primary); background: var(--primary-soft); }
.dropzone-inner { pointer-events: none; }
.dropzone-icon { width: 52px; height: 52px; color: var(--text-3); margin-bottom: 12px; }
.dropzone-title { font-size: 16px; font-weight: 600; color: var(--text); }
.dropzone-title .link { color: var(--primary); }
.dropzone-sub { font-size: 13px; color: var(--text-3); margin-top: 6px; }

/* ---------- 参数面板 ---------- */
.params-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.param-row { display: flex; flex-wrap: wrap; gap: 20px; }
.param-row + .param-row { margin-top: 16px; }
.param-group { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.param-label { font-size: 13px; color: var(--text-2); white-space: nowrap; min-width: 52px; }
.param-value { font-size: 13px; color: var(--primary); font-weight: 700; min-width: 32px; text-align: right; }
input[type="range"] { flex: 1; min-width: 90px; accent-color: var(--primary); }
.checkbox-group { cursor: pointer; }
.checkbox { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--text-2); cursor: pointer; user-select: none; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.select {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface);
  cursor: pointer; outline: none;
}
.select:focus { border-color: var(--primary); }
input[type="number"] {
  width: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px;
  font-size: 13px; font-family: inherit; color: var(--text); background: var(--surface);
  outline: none;
}
input[type="number"]:focus { border-color: var(--primary); }
input[type="number"]::-webkit-inner-spin-button { opacity: .4; }
.param-hint {
  width: 100%; margin-top: 10px; padding: 9px 12px;
  font-size: 12.5px; line-height: 1.6; color: var(--text-2);
  background: var(--surface-2); border-radius: 8px; border-left: 3px solid var(--primary);
}
.param-hint b { color: var(--text); }

/* ---------- 操作条 ---------- */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 0; margin-bottom: 16px; flex-wrap: wrap;
}
.progress-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 200px; }
.progress-bar { flex: 1; height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--primary-dark)); border-radius: 99px; transition: width .2s ease; }
.progress-text { font-size: 12.5px; color: var(--text-2); min-width: 44px; text-align: right; }

/* ---------- 缩略图网格 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-preview { position: relative; aspect-ratio: 4/3; background: repeating-conic-gradient(#ececf1 0% 25%, #f7f7f9 0% 50%) 50% / 20px 20px; overflow: hidden; }
.card-preview img { width: 100%; height: 100%; object-fit: contain; display: block; }
.svg-holder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.svg-holder svg { width: 100%; height: 100%; }
.card-preview.dark { background: repeating-conic-gradient(#2a2f3a 0% 25%, #333945 0% 50%) 50% / 20px 20px; }
.card-status {
  position: absolute; top: 8px; left: 8px;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px;
  color: #fff; background: rgba(31,36,48,.65); backdrop-filter: blur(3px);
}
.card-status.ok { background: rgba(43,182,115,.9); }
.card-status.err { background: rgba(226,84,79,.9); }
.card-status.busy { background: rgba(240,161,58,.92); }
.card-body { padding: 11px 12px; display: flex; flex-direction: column; gap: 8px; }
.card-name { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: 11px; color: var(--text-3); }
.card-actions { display: flex; gap: 6px; margin-top: 2px; }
.card-actions .btn { flex: 1; justify-content: center; padding: 7px 8px; font-size: 12.5px; }
.card-actions .btn svg { width: 13px; height: 13px; }

/* 处理中遮罩 */
.card-loading {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: rgba(255,255,255,.82); color: var(--text-2); font-size: 13px;
}
.spinner { width: 30px; height: 30px; border: 3px solid var(--surface-2); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 空状态 ---------- */
.empty-state {
  text-align: center; color: var(--text-3); padding: 60px 0;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty-state svg { width: 48px; height: 48px; }
.empty-state.hidden { display: none; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: 18px; right: 18px; z-index: 999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast { pointer-events: none; }
.toast {
  background: var(--surface); color: var(--text); padding: 12px 16px;
  border-radius: 10px; box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  font-size: 13.5px; display: flex; align-items: center; gap: 9px;
  animation: slideIn .25s ease; max-width: 340px;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--primary); }
@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
.toast.out { opacity: 0; transform: translateX(20px); transition: all .3s ease; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .topbar-inner { padding: 10px 16px; }
  .tabs { width: 100%; }
  .tab-btn { flex: 1; justify-content: center; }
  .container { padding: 18px 14px 48px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .progress-wrap { min-width: 100%; margin-left: 0; }
}

/* =========================================================
   字帖切字模块
   ========================================================= */
.seg-canvas-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px; margin-bottom: 16px; box-shadow: var(--shadow);
  max-height: 68vh; overflow: auto; text-align: center;
}
.seg-canvas-wrap canvas { max-width: 100%; height: auto; border-radius: 6px; cursor: crosshair; }
.seg-canvas-wrap canvas.mode-move { cursor: default; }

.seg-naming { flex: 1; min-width: 220px; }
.seg-naming input {
  width: 100%; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: var(--surface); outline: none;
}
.seg-naming input:focus { border-color: var(--primary); }
.seg-count { font-size: 13px; color: var(--text-2); white-space: nowrap; }

.seg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px;
}
.seg-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease;
}
.seg-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.seg-card.sel { outline: 2px solid var(--primary); }
.seg-card-preview {
  position: relative; aspect-ratio: 1/1; background: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.seg-card-preview canvas { max-width: 100%; max-height: 100%; }
.seg-card-body { padding: 7px 8px 9px; display: flex; flex-direction: column; gap: 6px; }
.seg-card-row { display: flex; align-items: center; gap: 6px; }
.seg-card-row input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; flex: none; }
.seg-text-input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 6px; padding: 4px 7px;
  font-size: 12.5px; font-family: inherit; color: var(--text); background: var(--surface); outline: none;
}
.seg-text-input:focus { border-color: var(--primary); }
.seg-card-tune {
  border: none; background: var(--surface-2); color: var(--text-2); border-radius: 6px;
  padding: 4px 0; font-size: 12px; cursor: pointer; font-family: inherit; width: 100%;
}
.seg-card-tune:hover { background: var(--primary-soft); color: var(--primary); }

/* 单字微调模态框 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,24,34,.45); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  width: 640px; max-width: 100%; max-height: 92vh; overflow: auto;
  animation: fadeIn .2s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; }
.modal-close {
  border: none; background: var(--surface-2); color: var(--text-2); width: 30px; height: 30px;
  border-radius: 8px; cursor: pointer; font-size: 14px;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 20px; display: flex; gap: 22px; flex-wrap: wrap; }
.seg-modal-preview {
  flex: none; width: 272px; height: 272px; border: 1px solid var(--border); border-radius: 10px;
  background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.seg-modal-preview canvas { max-width: 100%; max-height: 100%; }
.seg-modal-controls { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; }
.seg-modal-controls .param-group { min-width: 0; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ==================== OCR 自动命名板块 ==================== */
.ocrnav-svc { font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 4px 12px; border-radius: 99px; white-space: nowrap; align-self: center; }
.ocrnav-svc.on { color: var(--success); }
.ocrnav-svc.off { color: var(--danger); }
.ocrnav-offline { color: var(--danger); border-left-color: var(--danger); margin-bottom: 14px; }
.ocrnav-grid { grid-template-columns: 1fr; gap: 12px; }
.ocrnav-card { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; align-items: flex-start; }
.ocrnav-thumb { width: 84px; height: 84px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); background: #fff; flex: none; }
.ocrnav-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.ocrnav-lines { display: flex; flex-wrap: wrap; gap: 5px; }
.ocrnav-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 3px 9px; font-size: 12px; cursor: pointer; }
.ocrnav-chip .sc { color: var(--text-2); font-size: 11px; }
.ocrnav-chip.high { outline: 1.5px solid var(--primary); }
.ocrnav-chip.low { background: #fdf3e4; color: #c77c11; }
.ocrnav-none { color: var(--text-2); font-size: 12px; }
.ocrnav-name { display: flex; align-items: center; gap: 6px; }
.ocrnav-name input { flex: 1; max-width: 340px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 7px; font-size: 13px; }
.ocrnav-name input:focus { border-color: var(--primary); outline: none; }
.ocrnav-ext { font-size: 12px; color: var(--text-2); background: var(--surface-2); padding: 3px 8px; border-radius: 5px; }
.ocrnav-status { font-size: 12px; }
.ocrnav-status.ok { color: var(--success); }
.ocrnav-status.warn { color: #c77c11; }
.ocrnav-status.err { color: var(--danger); }
.ocrnav-status.run { color: var(--primary); }
.ocrnav-ops { display: flex; flex-direction: column; gap: 6px; flex: none; }
@media (max-width: 640px) {
  .ocrnav-card { flex-direction: column; }
  .ocrnav-ops { flex-direction: row; }
}

/* ==================== 品牌标语 & 页脚 ==================== */
.topbar .brand { min-width: 0; flex: 1 1 0; }
.topbar .brand-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .brand-text { flex: none; white-space: nowrap; }
.topbar .tabs { flex: none; }
.brand-slogan {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-3);
  letter-spacing: .3px;
  padding-left: 20px;
  margin-left: 3px;
  border-left: 1px solid var(--border);
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  margin-top: 8px;
}
.footer-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 26px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
}
.footer-copy {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .4px;
  margin: 0;
}
.footer-credit {
  font-size: 14.5px;
  color: var(--text-3);
  margin: 0;
}
@media (max-width: 640px) {
  .brand-slogan { display: none; }
  .footer-inner { padding: 18px 14px; }
}

/* ==================== 首页轮播图（宽度对齐内容区，高 150px） ==================== */
.hero-carousel { width: min(1200px, 100%); margin: 16px auto 0; padding: 0 24px; }
.carousel-viewport {
  position: relative;
  height: 150px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface-2);
}
.carousel-track { position: absolute; inset: 0; }
.carousel-slide {
  position: absolute; inset: 0;
  opacity: 0; visibility: hidden;
  transition: opacity .45s ease, visibility .45s;
  display: flex; align-items: center; gap: 16px;
  padding: 0 58px;
  cursor: pointer;
  color: #fff;
}
.carousel-slide.active { opacity: 1; visibility: visible; }
.carousel-slide-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.carousel-slide .slide-icon {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  background: rgba(255,255,255,.18);
  display: flex; align-items: center; justify-content: center;
}
.carousel-slide .slide-icon svg { width: 26px; height: 26px; }
.carousel-slide .slide-text { min-width: 0; }
.carousel-slide .slide-text h3 { font-size: 19px; margin: 0 0 4px; letter-spacing: .5px; }
.carousel-slide .slide-text p { font-size: 13px; margin: 0; opacity: .88; }
.carousel-slide .slide-go {
  margin-left: auto; flex: none;
  font-size: 12px;
  background: rgba(255,255,255,.18);
  padding: 6px 14px; border-radius: 99px;
  white-space: nowrap;
}
.carousel-slide.s1 { background: linear-gradient(90deg, #4293e5, #2e7cc9); }
.carousel-slide.s2 { background: linear-gradient(90deg, #0ea5a4, #22c55e); }
.carousel-slide.s3 { background: linear-gradient(90deg, #f59e0b, #f43f5e); }
.carousel-slide.s4 { background: linear-gradient(90deg, #6366f1, #0ea5e9); }
.carousel-slide.s5 { background: linear-gradient(90deg, #8b5cf6, #ec4899); }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer;
  background: rgba(255,255,255,.32); color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s;
}
.carousel-arrow:hover { background: rgba(255,255,255,.55); }
.carousel-arrow.prev { left: 12px; }
.carousel-arrow.next { right: 12px; }
.carousel-arrow svg { width: 16px; height: 16px; }
.carousel-dots {
  position: absolute; bottom: 7px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
}
.carousel-dots button {
  width: 7px; height: 7px; border-radius: 99px;
  border: none; padding: 0; cursor: pointer;
  background: rgba(255,255,255,.45);
  transition: all .2s ease;
}
.carousel-dots button.active { width: 18px; background: #fff; }

/* ---------- 工具栏（轮播图下方） ---------- */
.tabs-wrap { display: flex; justify-content: center; padding: 14px 24px 0; }
@media (max-width: 640px) {
  .carousel-viewport { height: 110px; }
  .carousel-slide { padding: 0 40px; gap: 10px; }
  .carousel-slide .slide-text h3 { font-size: 13.5px; margin-bottom: 2px; }
  .carousel-slide .slide-text p, .carousel-slide .slide-go { display: none; }
  .carousel-slide .slide-icon { width: 30px; height: 30px; border-radius: 8px; }
  .carousel-slide .slide-icon svg { width: 18px; height: 18px; }
}

/* ---------- 字帖切字：保存格式选择 ---------- */
.seg-format, .seg-quality { display: flex; align-items: center; gap: 6px; }
.seg-format-label { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.seg-format .select { padding: 7px 10px; min-width: 80px; }
.seg-quality input[type="range"] { width: 110px; }
@media (max-width: 640px) {
  .seg-format .select { min-width: 68px; }
  .seg-quality input[type="range"] { width: 78px; }
}

/* ==================== 通用隐藏 ==================== */
.hidden { display: none !important; }

/* ==================== 批量转SVG：统一画布尺寸 ==================== */
.vec-size-inputs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.vec-size-inputs input[type="number"] { width: 76px; padding: 6px 8px; text-align: center; }

/* ==================== 单字 SVG：放大镜预览 ==================== */
.card-preview.editable { cursor: zoom-in; }
.card-edit-badge {
  position: absolute; right: 8px; top: 8px; z-index: 3;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: rgba(66,147,229,.92); padding: 3px 9px; border-radius: 99px;
  opacity: 0; transition: opacity .16s ease; pointer-events: none;
  box-shadow: 0 2px 8px rgba(66,147,229,.4);
}
.card-edit-badge svg { width: 12px; height: 12px; }
.card-preview.editable:hover .card-edit-badge { opacity: 1; }
.card-loupe {
  position: absolute; width: 116px; height: 116px; border-radius: 50%;
  transform: translate(-50%, -50%);
  border: 2px solid #fff; box-shadow: 0 8px 22px rgba(20,24,34,.35);
  background-color: #fff; background-repeat: no-repeat;
  pointer-events: none; z-index: 4; display: none;
}
.card-loupe::after {
  content: '×3'; position: absolute; right: 10px; bottom: 6px;
  font-size: 9px; font-weight: 700; color: rgba(31,36,48,.42);
}

/* ==================== 单字 SVG 编辑弹窗 ==================== */
.vec-edit-modal {
  width: 880px;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.vec-edit-modal .modal-head { flex: none; }
.vec-edit-modal .modal-foot { flex: none; }
.vec-edit-body { display: flex; align-items: stretch; min-height: 0; overflow: auto; }
.vec-edit-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.vec-edit-ico {
  width: 34px; height: 34px; flex: none; border-radius: 9px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.vec-edit-ico svg { width: 18px; height: 18px; }
.vec-edit-name { font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 560px; }
.vec-edit-title-sub { font-size: 12px; color: var(--text-3); }
.vec-edit-stage-wrap {
  position: relative;
  flex: 1; min-width: 0; min-height: 460px; padding: 18px; display: flex; align-items: center; justify-content: center;
  background: repeating-conic-gradient(#ececf1 0% 25%, #f7f7f9 0% 50%) 50% / 20px 20px;
}
.vec-edit-angle {
  position: absolute; right: 12px; top: 12px; z-index: 3;
  font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: .2px;
  color: var(--text-3); background: rgba(255,255,255,.92);
  border: 1px solid var(--border); border-radius: 99px;
  padding: 3px 10px; pointer-events: none; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.vec-edit-angle.active { color: #fff; background: var(--primary); border-color: transparent; }
.vec-edit-stage {
  position: relative; width: 100%; max-width: 460px; aspect-ratio: 1 / 1;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; cursor: grab; touch-action: none; user-select: none;
}
.vec-edit-stage.dragging { cursor: grabbing; }
.vec-edit-stage.rotating { cursor: grabbing; }
.vec-edit-stage svg { width: 100%; height: 100%; display: block; }
.vec-edit-stage-hint {
  position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
  font-size: 11px; color: var(--text-3); background: rgba(255,255,255,.88);
  padding: 3px 10px; border-radius: 99px; pointer-events: none; white-space: nowrap;
}
.vec-edit-side { width: 300px; flex: none; border-left: 1px solid var(--border); padding: 18px; }
.vec-edit-side .side-group { margin-bottom: 18px; }
.vec-edit-side .side-group:last-child { margin-bottom: 0; }
.vec-edit-side .side-group h4 { font-size: 13px; color: var(--text-2); margin-bottom: 9px; letter-spacing: .3px; }
.vec-edit-side .side-field { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.vec-edit-side .side-field label { font-size: 12px; color: var(--text-2); }
.vec-edit-side .side-field input[type="number"] { width: 92px; padding: 6px 8px; }
.vec-edit-side .side-field select { width: 92px; padding: 6px 4px; }
.vec-edit-side .side-field select:disabled,
.vec-edit-side .side-field input:disabled { opacity: .5; }
#vecEditOpticalInfo:not(:empty) { color: var(--primary); }
.card-optical { color: var(--primary); }
.vec-edit-side .side-hint { font-size: 12px; line-height: 1.6; color: var(--text-3); }
.vec-edit-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.vec-edit-modal .modal-foot { align-items: center; }
.vec-edit-modal .modal-foot .editor-status { margin-right: auto; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 820px) {
  .vec-edit-modal { width: 100%; }
  .vec-edit-body { flex-direction: column; }
  .vec-edit-side { width: 100%; border-left: none; border-top: 1px solid var(--border); }
  .vec-edit-stage { max-width: 320px; }
  .vec-edit-name { max-width: 200px; }
}

/* ===== 单字编辑：擦除工具（橡皮擦 / 套索） ===== */
.vec-edit-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.vec-edit-tools .btn.active { background: var(--primary); color: #fff; border-color: transparent; }
.vec-edit-stage.tool-eraser, .vec-edit-stage.tool-lasso { cursor: crosshair; }
.vec-edit-stage.tool-eraser.dragging, .vec-edit-stage.tool-lasso.dragging { cursor: crosshair; }
.vec-edit-overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 6; }
.vec-edit-overlay .brush-dot { fill: rgba(229, 72, 77, .18); stroke: #e5484d; stroke-width: 1.5; }
.vec-edit-overlay .lasso-poly { fill: rgba(229, 72, 77, .12); stroke: #e5484d; stroke-width: 1.5; stroke-dasharray: 5 3; }

/* ===== 字体封装合成器 ===== */
.fl-spacing { display: flex; align-items: center; gap: 6px; }
.fl-spacing .param-label { margin: 0; white-space: nowrap; }
.fl-spacing input[type="number"] { width: 76px; padding: 6px 8px; text-align: center; }
.fl-rename-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin-top: 14px;
  background: var(--primary-soft); border: 1px solid var(--border); border-radius: 10px;
}
.fl-rename-label { font-weight: 600; font-size: 14px; white-space: nowrap; }
.fl-rename-bar input[type="text"] {
  width: 200px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
}
.fl-rename-sel { font-size: 13px; color: var(--text-2, #667); }
.fl-card { cursor: pointer; }
.fl-card.selected { outline: 2px solid var(--primary); outline-offset: 2px; }
.fl-card .card-preview { position: relative; }
.fl-char-badge {
  position: absolute; right: 8px; bottom: 8px;
  min-width: 34px; padding: 2px 8px; border-radius: 8px;
  background: var(--primary); color: #fff; font-size: 18px; line-height: 26px;
  text-align: center; box-shadow: 0 2px 8px rgba(0,0,0,.18); pointer-events: none;
}
.fl-char-badge.unnamed { background: #98a1b3; font-size: 11px; line-height: 26px; }
.fl-meta-modal { width: min(720px, 94vw); max-height: 88vh; display: flex; flex-direction: column; }
.fl-meta-modal .modal-head, .fl-meta-modal .modal-foot { flex: none; }
.fl-meta-body { display: block; overflow: auto; min-height: 0; }
.fl-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.fl-meta-field label { display: block; font-size: 12.5px; color: var(--text-2, #667); margin-bottom: 4px; }
.fl-meta-field input, .fl-meta-field select {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  background: var(--card, #fff); color: var(--text-1, #223); font-family: inherit;
}
.fl-meta-wide { grid-column: 1 / -1; }
.fl-meta-hint { margin-top: 14px; font-size: 12.5px; color: var(--text-2, #667); }
@media (max-width: 640px) {
  .fl-meta-grid { grid-template-columns: 1fr; }
}

/* ==================== 字体封装合成器：字形网格 ==================== */
.fl-glyph-bar{
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; margin: 14px 0;
}
.fl-glyph-bar .search-input{ flex: 1 1 220px; min-width: 180px; }
.fl-glyph-bar .pager{ margin-left: auto; display: flex; gap: 6px; align-items: center; }
.fl-glyph-bar .pager button{
  border: 1px solid var(--border); background: var(--surface); border-radius: 8px;
  min-width: 28px; height: 28px; cursor: pointer; color: var(--text-2); font-size: 13px;
}
.fl-glyph-bar .pager button:hover:not(:disabled){ border-color: var(--primary); color: var(--primary); }
.fl-glyph-bar .pager button:disabled{ opacity: .4; cursor: default; }
.fl-glyph-bar .page-ind{ font-size: 12px; color: var(--text-2); padding: 0 4px; }

.fl-glyph-grid{
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 10px;
}
.fl-glyph-cell{
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  aspect-ratio: 1; cursor: pointer; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.fl-glyph-cell:hover{ transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.fl-glyph-cell img{ width: 82%; height: 82%; object-fit: contain; }
.fl-glyph-cell .fl-tag{ position: absolute; bottom: 3px; right: 5px; font-size: 10px; color: var(--text-3); }
.fl-glyph-cell .fl-file{
  position: absolute; top: 4px; left: 6px; font-size: 9px; color: var(--text-3);
  max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fl-glyph-cell.unnamed{ border-style: dashed; opacity: .8; }
.fl-glyph-cell .fl-ops{ position: absolute; top: 3px; right: 3px; display: none; gap: 4px; }
.fl-glyph-cell:hover .fl-ops{ display: flex; }
.fl-glyph-cell .fl-ops button{
  border: none; background: rgba(15, 23, 42, .72); color: #fff; font-size: 10px;
  line-height: 1; padding: 3px 6px; border-radius: 6px; cursor: pointer;
}
.fl-glyph-cell .fl-ops button:hover{ background: var(--primary); }
.fl-glyph-empty{ grid-column: 1 / -1; text-align: center; color: var(--text-3); padding: 30px 0; font-size: 13px; }

/* ---- 中文名显示策略（元数据弹窗） ---- */
.fl-cn-strategy{
  margin-top: 14px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius-sm, 9px); background: var(--primary-soft, #e9f2fd);
}
.fl-switch{ display: flex; align-items: flex-start; gap: 10px; cursor: pointer; user-select: none; }
.fl-switch input{ position: absolute; opacity: 0; width: 0; height: 0; }
.fl-switch-track{
  flex: none; width: 40px; height: 22px; border-radius: 99px; margin-top: 1px;
  background: #c6cdd9; transition: background .18s ease; position: relative;
}
.fl-switch-dot{
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .18s ease;
}
.fl-switch input:checked + .fl-switch-track{ background: var(--primary); }
.fl-switch input:checked + .fl-switch-track .fl-switch-dot{ transform: translateX(18px); }
.fl-switch-label{ font-size: 13.5px; color: var(--text); font-weight: 600; line-height: 1.35; }
.fl-switch-label small{ display: block; font-weight: 400; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.fl-cn-guide{ margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.fl-cn-guide summary{ cursor: pointer; color: var(--primary); font-weight: 600; }
.fl-cn-guide ul{ margin: 8px 0 0; padding-left: 18px; line-height: 1.75; }
.fl-cn-guide code{
  background: var(--surface); border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 5px; font-size: 12px; color: var(--text);
}

/* ---- 导出后：装机显示名预览 ---- */
.name-preview{
  margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow); overflow: hidden;
}
.np-head{
  padding: 12px 16px; font-size: 13.5px; font-weight: 700; color: var(--primary);
  background: var(--primary-soft, #e9f2fd); border-bottom: 1px solid var(--border);
}
.np-table{ width: 100%; border-collapse: collapse; font-size: 13px; }
.np-table th, .np-table td{ padding: 9px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.np-table thead th{ font-size: 12px; color: var(--text-2); background: var(--surface-2); font-weight: 600; }
.np-table tr:last-child td{ border-bottom: none; }
.np-table .np-name{ font-weight: 700; color: var(--text); white-space: nowrap; }
.np-table .np-note{ color: var(--text-2); font-size: 12.5px; }
.np-tip{ margin: 0; padding: 11px 16px; font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-top: 1px solid var(--border); }
@media (max-width: 640px){
  .np-table .np-name{ white-space: normal; }
}

/* ===== 字体信息弹窗 · 命名规范 v2 ===== */
.fl-meta-intro{ margin:0 0 14px; font-size:13.5px; color:var(--text-2); line-height:1.6; }
.fl-meta-field small.fl-meta-tip{ display:block; margin-top:5px; font-size:12px; color:var(--text-3); line-height:1.55; }
.fl-name-live{ margin:14px 0 6px; }
.fl-cn-advanced{ margin:10px 0 0; border:1px solid var(--border); border-radius:10px; padding:10px 14px; background:var(--surface-2); }
.fl-cn-advanced summary{ cursor:pointer; font-size:13px; color:var(--primary); font-weight:600; }
.fl-cn-advanced .fl-meta-grid{ margin-top:12px; }


/* ==================== 技能模块 ①：单字裁切 ==================== */
.cc-skill-tag {
  display: inline-block; vertical-align: middle; margin-left: 8px;
  font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--primary-soft); border-radius: 99px; padding: 3px 10px;
}
.cc-results { display: flex; flex-direction: column; gap: 16px; margin-top: 4px; }
.cc-group { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.cc-group-head { display: flex; align-items: center; gap: 12px; }
.cc-group-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); flex: none; }
.cc-group-info { flex: 1; min-width: 0; }
.cc-group-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-group-status { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.cc-group-status.ok { color: var(--success); }
.cc-group-status.err { color: var(--danger); }
.cc-group-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.cc-group-ops { display: flex; gap: 6px; flex: none; }
.cc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.cc-char { position: relative; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); padding: 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cc-char img { width: 100%; height: 88px; object-fit: contain; background: #fff; border-radius: 6px; }
.cc-char-idx { position: absolute; top: 8px; left: 10px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(31,36,48,.62); border-radius: 5px; padding: 0 5px; }
.cc-char-size { font-size: 10.5px; color: var(--text-3); }
.cc-char-name { font-size: 10.5px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-char-dl { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: none; border-radius: 6px; background: rgba(66,147,229,.92); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s; }
.cc-char-dl svg { width: 13px; height: 13px; }
.cc-char:hover .cc-char-dl { opacity: 1; }
.cc-char-dl:hover { background: var(--primary-dark); }
.cc-none { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
@media (max-width: 640px) {
  .cc-group-head { flex-wrap: wrap; }
  .cc-grid { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); }
}


/* ==================== 单字裁切：字框编辑器 + 结果移除 ==================== */
.cc-editor {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(15,18,28,.88); backdrop-filter: blur(3px);
  display: flex; flex-direction: column;
}
.cc-editor-head {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cc-editor-title { font-size: 14px; font-weight: 700; color: var(--text); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-editor-modes { display: flex; align-items: center; gap: 8px; flex: 1; }
.cc-editor-modes .param-label { margin: 0; }
.cc-editor-ops { display: flex; gap: 8px; }
.cc-editor-body {
  flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center;
  padding: 12px;
}
.cc-editor-body canvas {
  background: #fff; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,.45);
  max-width: 100%; cursor: default;
}
.cc-editor-foot {
  padding: 8px 16px; font-size: 12.5px; color: #dfe6f2;
  background: rgba(22,26,38,.92); border-top: 1px solid var(--border);
  min-height: 34px; display: flex; align-items: center;
}
.cc-char-rm {
  position: absolute; top: 6px; right: 34px; width: 24px; height: 24px;
  border: none; border-radius: 6px; background: rgba(229,72,77,.92); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .15s;
}
.cc-char:hover .cc-char-rm { opacity: 1; }
.cc-char-rm:hover { background: #c33; }
.cc-char-sel {
  position: absolute; bottom: 6px; right: 8px; display: flex; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--text-2); cursor: pointer; user-select: none;
}
.cc-char-sel input { accent-color: var(--primary); cursor: pointer; }

.btn-warn { background: #e8842c; color: #fff; box-shadow: 0 4px 14px rgba(232,132,44,.3); }
.btn-warn:hover:not(:disabled) { filter: brightness(1.08); }

.cc-char-rot {
  position: absolute; bottom: 6px; left: 6px; display: flex; gap: 3px; opacity: 0; transition: opacity .15s;
}
.cc-char:hover .cc-char-rot { opacity: 1; }
.cc-char-rot button {
  width: 22px; height: 22px; border: none; border-radius: 6px; padding: 0;
  background: rgba(0,0,0,.55); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.cc-char-rot button:hover { background: rgba(0,0,0,.78); }

/* ---- 已入库字符名称汇总弹窗 ---- */
.fl-chars-modal { width: 560px; }
.fl-chars-body { display: flex; flex-direction: column; gap: 10px; }
.fl-chars-intro { font-size: 12.5px; color: var(--text-2); }
.fl-chars-text { width: 100%; min-height: 220px; max-height: 50vh; resize: vertical; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; font-size: 24px; line-height: 1.7; background: #fff; color: var(--text); word-break: break-all; }

/* ---- 顶部导航（与品牌信息栏合并为一栏） ---- */
.topbar .sitenav { display: flex; align-items: center; gap: 10px; padding: 0; margin: 0 0 0 16px; flex: none; max-width: none; }
.sitenav-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border: none; border-radius: 12px; background: transparent; color: var(--text-2); font-size: 18px; font-weight: 600; cursor: pointer; transition: color .18s, background .18s; }
.sitenav-btn:hover { color: var(--primary); background: rgba(66,147,229,.08); }
.sitenav-btn.active { color: var(--primary); }
.sitenav-btn.active::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 3px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, #4293e5, #22b3e6); }
.sitenav-btn .nav-ico { width: 36px; height: 36px; flex: none; margin: 0; }
.sitenav-btn.buy-btn { margin-left: 8px; padding: 12px 18px; border-radius: 12px; color: var(--text-2); background: transparent; box-shadow: none; letter-spacing: .5px; }
.sitenav-btn.buy-btn:hover { color: var(--primary); background: rgba(66,147,229,.08); box-shadow: none; filter: none; transform: none; }
.sitenav-btn.buy-btn:active { transform: none; }
.sitenav-btn.buy-btn.active::after { left: 16px; right: 16px; }
.topbar .brand-slogan { flex: none; min-width: 0; overflow: hidden; white-space: normal; font-size: 16px; line-height: 1.45; padding-left: 14px; margin-left: 4px; border-left: 1px solid var(--border); letter-spacing: .3px; color: var(--text-3); }
.view-panel { animation: fadeIn .25s ease; }
.buy-placeholder { display: flex; justify-content: center; padding: 90px 16px; }
.buy-card { text-align: center; padding: 56px 72px; background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 10px 40px rgba(0,0,0,.06); }
.buy-card .buy-ico { font-size: 46px; margin-bottom: 14px; }
.buy-card h2 { font-size: 26px; margin: 0 0 10px; color: var(--text); }
.buy-card p { color: var(--text-2); margin: 6px 0; }
.buy-card .buy-contact { font-size: 13px; color: var(--text-3); margin-top: 14px; }
.zitie-frame { display: block; width: 100%; height: calc(100vh - 150px); min-height: 640px; border: 0; background: #fff; }
@media (max-width: 720px) { .zitie-frame { height: calc(100vh - 120px); } .topbar .sitenav { gap: 0; } .sitenav-btn { padding: 8px 10px; font-size: 13px; } .topbar .brand-slogan { display: none; } }

/* ---- 导航文字放大（18px）+ 中窄屏降级（与在线版 v29 同步） ---- */
@media (max-width: 1160px) {
  .sitenav-btn { font-size: 15px; padding: 10px 10px; }
  .sitenav-btn.buy-btn { padding: 9px 14px; }
}

/* ---- 购买字体去底色（与在线版 v30 同步） ---- */
@media (max-width: 1160px) { .sitenav-btn.buy-btn { padding: 10px 10px; } }

/* ---- 导航 flex 对齐 + 悬停突出（与在线版 v31 同步） ---- */
.sitenav-btn.active { background: rgba(66,147,229,.08); }
.sitenav-btn { min-height: 60px; justify-content: center; }


/* ==================== 页脚始终贴底（v33） ==================== */
/* body 为纵向 flex（min-height:100vh），当前可见的视图区自动撑满剩余高度，
   使页脚在任何页面、任何内容长度下都贴住视口底部 */
#viewHome, #viewBuy, #viewZitie { flex: 1 0 auto; }

/* ==================== 分割线自动切字（iframe 整体嵌入） ==================== */
.dline-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 240px);
  min-height: 620px;
  border: 1px solid var(--line, #d9dee5);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow, 0 2px 8px rgba(31, 39, 51, .06));
}

/* ===== 单字 SVG 编辑：垂直 / 水平居中虚线参考线（垫在字符下层，仅作标尺，不影响任何交互） ===== */
/* 注意 :not(.vec-edit-overlay)：覆盖层也是 stage 里的 svg，若不加排除会被本条改成
   relative/z1，橡皮擦光标圈与套索多边形脱离舞台定位（范围显示消失） */
.vec-edit-stage > svg:not(.vec-edit-overlay) { position: relative; z-index: 1; }
.vec-edit-stage::before {
  content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 0;
  border-left: 1.5px dashed rgba(229, 72, 77, .5);
  pointer-events: none; z-index: 0;
}
.vec-edit-stage::after {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 0;
  border-top: 1.5px dashed rgba(229, 72, 77, .5);
  pointer-events: none; z-index: 0;
}

/* ===== 字体封装合成器：批量多选 / 批量缩放（与单字修改滚轮缩放同一套逻辑） ===== */
.fl-scale-group {
  padding: 3px 8px 3px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--primary-soft, #eef4ff);
}
.fl-scale-group input[type="number"] { width: 66px; }
.fl-scale-unit { font-size: 12px; color: var(--text-2); margin-left: -2px; }
.fl-scale-btn {
  width: 26px; height: 26px; padding: 0; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  color: var(--text-2); font-size: 15px; line-height: 1; cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.fl-scale-btn:hover { border-color: var(--primary); color: var(--primary); }
.fl-scale-btn:active { transform: translateY(1px); }
.fl-scale-group.no-sel #flScaleInput { opacity: .55; }
.fl-sel-count { font-size: 12.5px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.fl-sel-hint { font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

.fl-glyph-cell.sel {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary) inset, var(--shadow);
  background: var(--primary-soft, #eef4ff);
}
.fl-glyph-cell.sel::before {
  content: '✓'; position: absolute; z-index: 3; left: 4px; bottom: 3px;
  width: 15px; height: 15px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 10px; line-height: 15px; text-align: center; box-shadow: 0 1px 3px rgba(15, 23, 42, .22);
}

/* ===== 字库选择提示：字号放大 + 加粗 + 品牌蓝强调 ===== */
.fl-sel-hint.fl-sel-hint-hl {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .2px;
  padding: 3px 9px;
  border-radius: 8px;
  background: var(--primary-soft, #eef4ff);
  border: 1px solid rgba(66, 147, 229, .22);
}


/* ===== 字体封装合成器：导出格式切换（OTF / TTF） ===== */
.fl-fmt-seg { display: inline-flex; gap: 4px; padding: 3px; background: var(--surface-2, #f4f6f9); border: 1px solid var(--border); border-radius: 10px; flex: none; }
.fl-fmt-btn { padding: 5px 13px; border: none; border-radius: 7px; background: transparent; cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 700; letter-spacing: .4px; line-height: 1.2; transition: background .15s, color .15s, box-shadow .15s; }
.fl-fmt-btn:hover { background: rgba(66, 147, 229, .10); color: var(--text); }
.fl-fmt-btn.active { background: var(--surface, #fff); color: var(--primary); box-shadow: 0 1px 3px rgba(16, 32, 56, .12); }

/* ===== 字体封装合成器：字符网格滚动容器（v44） =====
   网格独立滚动，上方工具条 / 设置栏 / 翻页栏常驻可见 */
.fl-grid-scroll{
  max-height: calc(100vh - 320px);
  min-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface-2, #f7f9fc);
  scrollbar-width: thin;
  scrollbar-color: rgba(66, 147, 229, .45) transparent;
}
.fl-grid-scroll::-webkit-scrollbar{ width: 9px; }
.fl-grid-scroll::-webkit-scrollbar-track{ background: transparent; }
.fl-grid-scroll::-webkit-scrollbar-thumb{
  background: rgba(66, 147, 229, .4); border-radius: 99px;
  border: 2px solid transparent; background-clip: content-box;
}
.fl-grid-scroll::-webkit-scrollbar-thumb:hover{ background: rgba(66, 147, 229, .65); background-clip: content-box; }
.fl-grid-scroll .empty-state{ padding: 40px 16px; }

/* ===== 字体封装合成器：手动指定字符 + 清空字符库合并为一行（v45） ===== */
.fl-rename-bar .btn#flClearBtn{
  margin-left: auto;
  flex-shrink: 0;
}
.fl-rename-bar .fl-rename-sel{
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 字体封装合成器：工具栏全局视觉补偿（v46） ===== */
.fl-optical-group{ flex-wrap: nowrap; }
.fl-optical-group .checkbox{ display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 13px; cursor: pointer; }
.fl-optical-group .checkbox input{ margin: 0; cursor: pointer; }
.fl-optical-group .checkbox span:hover{ text-decoration: underline; }
.fl-optical-group .fl-optical-style{ width: 86px; padding: 6px 8px; }
.fl-optical-group input[type="number"]{ width: 62px; padding: 6px 6px; text-align: center; }
.fl-optical-group .param-label{ margin: 0; white-space: nowrap; }

/* ===== 字体封装合成器：调整工具整体功能区（v47） =====
   工具条 + 手动指定字符合并为一张控制台卡片，按行分组、紧凑排布 */
.fl-console{
  display: flex;
  flex-direction: column;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(16, 32, 56, .05);
}
#fontLibToolbar{
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  margin: 0;
}
#fontLibToolbar .fl-row{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  padding: 7px 2px;
}
#fontLibToolbar .fl-row + .fl-row{
  border-top: 1px dashed var(--border);
}
.fl-console .fl-rename-bar{
  margin-top: 0;
  padding: 7px 12px;
  gap: 8px;
}
.fl-console .fl-rename-bar input[type="text"]{ width: 168px; padding: 6px 10px; font-size: 14px; }
.fl-console .fl-spacing input[type="number"]{ width: 64px; padding: 5px 6px; }
.fl-console .fl-spacing .select{ padding: 5px 8px; font-size: 13px; }
.fl-console .fl-optical-group input[type="number"]{ width: 58px; }
.fl-console .btn{ padding: 6px 12px; font-size: 13px; }
.fl-console .btn.btn-sm{ padding: 4px 10px; font-size: 12.5px; }
.fl-console .seg-count{ font-size: 12.5px; }
.fl-console .fl-sel-hint{ font-size: 12px; }
.fl-console .fl-fmt-btn{ padding: 4px 11px; }

/* ===== 控制台第三行：手动指定字符（蓝带）+ 导出组右侧（v48，照参考图布局） ===== */
.fl-console .fl-row-export{
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 7px 2px;
  border-top: 1px dashed var(--border);
}
.fl-row-export .fl-rename-bar{ flex: 0 1 auto; max-width: 100%; }
.fl-row-export .fl-rename-bar .fl-rename-sel{ flex: 0 1 auto; }
.fl-export-group{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
}
/* 批量缩放胶囊组（参考图第二行） */
.fl-console #flScaleGroup{
  background: var(--surface-2, #f4f6f9);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px 10px;
}

/* ===== 控制台卡片精致化（v49）：整体更矮、更紧凑、更精致 ===== */
.fl-console{
  gap: 4px;
  padding: 5px 12px;
  margin-bottom: 12px;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(16, 32, 56, .04);
}
#fontLibToolbar .fl-row{ gap: 5px 10px; padding: 5px 2px; }
.fl-console .fl-row-export{ gap: 5px 10px; padding: 5px 2px; }
.fl-console .fl-rename-bar{ padding: 3px 10px; gap: 6px; }
.fl-console .fl-rename-bar input[type="text"]{ width: 148px; padding: 4px 9px; font-size: 13px; }
.fl-console .fl-rename-bar .fl-rename-label{ font-size: 12.5px; }
.fl-console .fl-rename-bar .fl-rename-sel{ font-size: 11.5px; }
.fl-console .fl-spacing input[type="number"]{ width: 56px; padding: 3px 5px; font-size: 12.5px; }
.fl-console .fl-spacing .select{ padding: 3px 7px; font-size: 12.5px; }
.fl-console .fl-optical-group .fl-optical-style{ width: 72px; padding: 3px 6px; font-size: 12.5px; }
.fl-console .fl-optical-group input[type="number"]{ width: 54px; padding: 3px 4px; font-size: 12.5px; }
.fl-console .fl-optical-group .checkbox span{ font-size: 12.5px; }
.fl-console .param-label{ font-size: 12.5px; }
.fl-console .btn{ padding: 4px 10px; font-size: 12.5px; }
.fl-console .btn.btn-sm{ padding: 3px 8px; font-size: 12px; }
.fl-console .seg-count{ font-size: 12px; }
.fl-console .fl-sel-hint{ font-size: 11px; }
.fl-console .fl-sel-count{ font-size: 11.5px; }
.fl-console #flScaleGroup{ padding: 2px 8px; border-radius: 8px; }
.fl-console #flScaleInput{ width: 52px; padding: 3px 4px; font-size: 12.5px; }
.fl-console .fl-scale-btn{ padding: 3px 8px; font-size: 13px; line-height: 1; }
.fl-console #flMetaBtn{ padding: 4px 10px; font-size: 12.5px; }
.fl-console .fl-fmt-btn{ padding: 3px 9px; font-size: 12px; }
.fl-console .fl-export-group{ gap: 8px; }
.fl-console #flExportBtn{ padding: 4px 13px; font-size: 12.5px; }
.fl-console #flExportStatus{ font-size: 11.5px; }

/* ===== 字符画布尺寸控件（v50）===== */
.fl-canvas-set{
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid var(--line, #dfe5ee);
  border-radius: 8px;
  background: #f7f9fc;
}
.fl-canvas-set .param-label{ font-size: 12.5px; color: #5a6a80; }
.fl-canvas-set input[type="number"]{
  width: 56px;
  padding: 3px 4px;
  font-size: 12.5px;
  border: 1px solid var(--line, #dfe5ee);
  border-radius: 6px;
  text-align: right;
}

/* ===== 合成器独立追踪参数组（v51）===== */
.fl-trace-group{
  flex-wrap: nowrap;
  padding: 2px 8px;
  border: 1px solid var(--line, #dfe5ee);
  border-radius: 8px;
  background: #f7f9fc;
}
.fl-trace-group .fl-trace-title{ font-size: 12.5px; color: #5a6a80; font-weight: 600; }
.fl-trace-group .param-label{ margin: 0; white-space: nowrap; font-size: 12.5px; color: #5a6a80; }
.fl-trace-group input[type="number"]{
  width: 56px;
  padding: 3px 4px;
  font-size: 12.5px;
  border: 1px solid var(--line, #dfe5ee);
  border-radius: 6px;
  text-align: right;
}
.fl-trace-group .checkbox{ display: flex; align-items: center; gap: 5px; white-space: nowrap; font-size: 12.5px; cursor: pointer; }
.fl-trace-group .checkbox input{ margin: 0; cursor: pointer; }

/* ===== OCR 自动命名：结果卡片改窄卡多列（v53，功能不变） ===== */
.ocrnav-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, 300px);
  justify-content: start;
  gap: 10px;
  align-items: start;
}
.ocrnav-card{
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  grid-template-areas:
    "thumb mid"
    "ops   ops";
  gap: 8px 10px;
  padding: 10px;
  border-radius: 10px;
  align-items: start;
}
.ocrnav-card > .ocrnav-thumb{ grid-area: thumb; width: 60px; height: 60px; border-radius: 7px; }
.ocrnav-card > .ocrnav-mid{ grid-area: mid; gap: 6px; }
.ocrnav-card > .ocrnav-ops{ grid-area: ops; flex-direction: row; gap: 6px; }
.ocrnav-card .ocrnav-mid .ocrnav-chip{ font-size: 11.5px; padding: 2px 7px; max-width: 100%; }
.ocrnav-card .ocrnav-mid .ocrnav-chip > span:first-child{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocrnav-card .ocrnav-mid .ocrnav-none{ font-size: 11.5px; }
.ocrnav-card .ocrnav-name{ gap: 5px; }
.ocrnav-card .ocrnav-name input{ flex: 1 1 auto; min-width: 0; max-width: none; padding: 5px 8px; font-size: 12.5px; }
.ocrnav-card .ocrnav-ext{ flex: none; padding: 2px 6px; font-size: 11.5px; }
.ocrnav-card .ocrnav-status{ font-size: 11.5px; }
.ocrnav-card > .ocrnav-ops .btn{ flex: 1 1 0; min-width: 0; padding: 4px 0; font-size: 12px; white-space: nowrap; }
@media (max-width: 340px){
  .ocrnav-grid{ grid-template-columns: minmax(0, 1fr); }
}

/* ===== OCR 自动命名卡片：四列 + 左侧大缩略图（v54） ===== */
.ocrnav-grid{
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}
.ocrnav-card{
  grid-template-columns: 84px minmax(0, 1fr);
}
.ocrnav-card > .ocrnav-thumb{ width: 84px; height: 84px; }
.ocrnav-card > .ocrnav-mid{ min-height: 84px; }

/* ===== v55/v49 · 首页轮播图去描边（用户要求：不要描边） ===== */
.carousel-viewport { border: none; }

/* ---------- 工具导航触碰说明引导（data-tip 气泡） ---------- */
.tab-btn { position: relative; }
.tab-btn::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 16px);
  transform: translateX(-50%) translateY(4px);
  width: max-content; min-width: 240px; max-width: 340px;
  padding: 10px 14px; border-radius: 10px;
  background: #1f2937; color: #ffffff;
  font-size: 12.5px; font-weight: 500; line-height: 1.7; text-align: left; letter-spacing: 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
  z-index: 90;
}
.tab-btn::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #1f2937;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .18s ease, visibility .18s;
  z-index: 90;
}
.tab-btn:hover::after, .tab-btn:focus-visible::after,
.tab-btn:hover::before, .tab-btn:focus-visible::before {
  opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
@media (max-width: 860px) {
  .tab-btn::after { min-width: 200px; max-width: 260px; font-size: 12px; }
}

/* ==================== 总导航品牌蓝 #0271F7（R14a） ==================== */
.topbar { --primary: #0271F7; }
.sitenav-btn:hover, .sitenav-btn.buy-btn:hover { background: rgba(2,113,247,.08); }
.sitenav-btn.active { background: rgba(2,113,247,.08); }
.sitenav-btn.active::after { background: linear-gradient(90deg, #0271F7, #3f95ff); }
.brand-logo { box-shadow: 0 4px 12px rgba(2,113,247,.3); }

/* ==================== 字体封装合成器：大批次导入 / 清空确认（R14e） ==================== */
.fl-clear-modal { width: 430px; }
.fl-clear-modal .modal-body { padding: 16px 18px; }
#flClearText { font-size: 14px; line-height: 1.7; }
.fl-clear-note { margin-top: 8px; font-size: 12.5px; color: var(--text-2, #667); line-height: 1.7; }
.dropzone.is-importing { opacity: .55; pointer-events: none; }
#flImportCancel { margin-left: 6px; border-color: #e0564d; color: #e0564d; }
