/* =============================================================================
 * 图水印 · 在线图片工具站  样式表（蓝灰科技风，PC 优先，基础响应式）
 * 结构：变量与基础 → 布局(顶栏/主体/网格) → 组件(卡片/表单/上传/预览) →
 *       弹窗(扫码/积分不足/加载/Toast) → 交互动画 → 响应式
 * @author web
 *==========================================================================*/

/* ---------- 1. 变量与基础 ---------- */
* { box-sizing: border-box; }
:root {
  --brand: #2f6bff;         /* 主蓝 */
  --brand-d: #2554d6;       /* 主蓝-深 */
  --brand-2: #38bdf8;       /* 辅助青 */
  --brand-soft: #eaf1ff;    /* 主蓝-浅底 */
  --bg: #f4f7fb;            /* 页面底色 */
  --bg-2: #eef2f8;          /* 次级底色 */
  --card: #ffffff;
  --text: #1f2a44;          /* 主文本 */
  --muted: #6b7a90;         /* 次文本 */
  --line: #e5eaf1;          /* 描边 */
  --ok: #16a34a;
  --warn: #e08a00;
  --danger: #ef4444;
  --cost: #e07b1a;          /* 积分消耗橙 */
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 10px rgba(31, 42, 68, .06);
  --shadow-md: 0 10px 30px rgba(31, 42, 68, .10);
  --shadow-lg: 0 20px 50px rgba(31, 42, 68, .18);
  --ease: cubic-bezier(.22, .61, .36, 1);
}
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 400px at 80% -10%, #e7efff 0%, rgba(231, 239, 255, 0) 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: inherit; }

/* ---------- 2. 顶栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand .logo-mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 6px 16px rgba(47, 107, 255, .35); color: #fff;
}
.brand .logo-mark svg { width: 22px; height: 22px; }
.brand .logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand .logo-text b { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.brand .logo-text span { font-size: 12px; color: var(--muted); }
.account { display: flex; align-items: center; gap: 12px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 7px 14px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-d); border: 1px solid #d5e2ff;
}
.chip b { font-weight: 700; }
.chip-user { background: var(--bg-2); color: var(--text); border-color: var(--line); }

/* ---------- 3. 按钮 ---------- */
.btn {
  border: none; border-radius: 10px; padding: 10px 20px; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: transform .12s var(--ease), box-shadow .18s, background .18s, opacity .18s;
  line-height: 1; white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-d)); color: #fff; box-shadow: 0 6px 16px rgba(47, 107, 255, .28); }
.btn-primary:hover { box-shadow: 0 10px 22px rgba(47, 107, 255, .38); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; box-shadow: none; }
.btn-ghost { background: var(--bg-2); color: var(--muted); }
.btn-ghost:hover { background: #e3e9f2; color: var(--text); }
.btn-dl {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand-soft); color: var(--brand-d); border: 1px solid #d5e2ff;
  text-decoration: none; border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 600;
}
.btn-dl:hover { background: #dceaff; }
.btn-block { width: 100%; justify-content: center; display: inline-flex; }

/* ---------- 4. 公告 / 维护条 ---------- */
.notice { padding: 11px 28px; background: var(--brand-soft); color: var(--brand-d); font-size: 13px; border-bottom: 1px solid #dbe6ff; }
.notice-warn { background: #fff5e6; color: #a4650a; border-bottom-color: #ffe3bf; }

/* ---------- 5. 主体 ---------- */
.container { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 32px 28px 48px; }
.hero { text-align: center; margin: 8px 0 36px; animation: fadeUp .5s var(--ease) both; }
.hero h1 { font-size: 32px; margin: 0 0 10px; font-weight: 800; letter-spacing: .5px; }
.hero h1 .grad { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 15px; margin: 0; }

/* 分组标题 */
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 14px; font-size: 15px; font-weight: 700; color: var(--text); }
.section-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.section-title .dot-pro { background: var(--cost); box-shadow: 0 0 0 4px #fdeede; }

/* ---------- 6. 工具网格卡片 ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tool-grid .loading { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px; }
.tool-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; cursor: pointer; position: relative; overflow: hidden;
  transition: transform .18s var(--ease), box-shadow .22s, border-color .22s;
  animation: fadeUp .4s var(--ease) both;
}
.tool-card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(47, 107, 255, .06), transparent 60%);
  opacity: 0; transition: opacity .22s;
}
.tool-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #c9d9ff; }
.tool-card:hover::after { opacity: 1; }
.tool-soon { cursor: default; opacity: .62; }
.tool-soon:hover { transform: none; box-shadow: none; border-color: var(--line); }
.tc-icon {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 14px;
  background: var(--brand-soft); color: var(--brand); transition: transform .2s var(--ease);
}
.tool-card:hover .tc-icon { transform: scale(1.06); }
.tc-icon svg { width: 28px; height: 28px; }
.tc-name { font-size: 16px; font-weight: 700; margin-bottom: 5px; }
.tc-desc { font-size: 13px; color: var(--muted); line-height: 1.5; min-height: 38px; margin-bottom: 12px; }
.tc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; padding: 4px 9px; border-radius: 7px; font-weight: 600; }
.tag-free { background: var(--brand-soft); color: var(--brand-d); }
.tag-cost { background: #fdeede; color: var(--cost); }
.tag-hot { background: #ffe9ec; color: var(--danger); }
.tag-local { background: #e7f7ee; color: var(--ok); }

/* ---------- 7. 弹窗通用 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-mask { position: absolute; inset: 0; background: rgba(24, 33, 54, .5); backdrop-filter: blur(3px); animation: fadeIn .2s ease both; }
.modal-card {
  position: relative; background: #fff; border-radius: 20px; width: 560px; max-width: 94vw;
  max-height: 90vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--shadow-lg); animation: popIn .28s var(--ease) both;
}
.modal-card.sm { width: 380px; }
.modal-card.lg { width: 900px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-x { border: none; background: var(--bg-2); width: 30px; height: 30px; border-radius: 8px; font-size: 18px; line-height: 1; cursor: pointer; color: var(--muted); transition: .15s; }
.modal-x:hover { background: #e3e9f2; color: var(--text); }
.modal-body { flex: 1 1 auto; min-height: 0; padding: 24px; overflow: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* ---------- 8. 表单 ---------- */
.tool-form .field { margin-bottom: 18px; }
.field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.field-label .req { color: var(--danger); margin-left: 2px; }
.field input[type=text], .field input[type=number], .field select, .field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; color: var(--text); background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft);
}
.field textarea { resize: vertical; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row > .field { flex: 1; min-width: 140px; }
.field input[type=color] { width: 54px; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.field input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--brand); }
.check-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 6px; cursor: pointer; }
.cost-hint { font-size: 12px; color: var(--muted); }

/* ---------- 9. 上传拖放区 ---------- */
.dropzone {
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg);
  padding: 16px; text-align: center; cursor: pointer; transition: .18s var(--ease); position: relative;
}
.dropzone:hover { border-color: #b9cdff; background: #f7faff; }
.dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); }
.dz-icon { color: var(--brand); margin-bottom: 6px; }
.dz-icon svg { width: 30px; height: 30px; }
.dz-title { font-size: 13px; font-weight: 600; }
.dz-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.dz-preview { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.dz-thumb { max-width: 100%; max-height: 96px; border-radius: var(--radius-sm); border: 1px solid var(--line); object-fit: contain; }
.dz-file { display: inline-flex; align-items: center; height: 40px; padding: 0 14px; max-width: 220px; font-size: 13px; color: var(--muted); background: var(--bg); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.dz-remove { margin-top: 0; }
.dropzone input[type=file] { display: none; }
/* 已选图：隐藏大号上传引导并压缩内边距，避免上传区过高 */
.dropzone:has(.dz-preview:not(.hidden)) { padding: 12px; }
.dropzone:has(.dz-preview:not(.hidden)) .dz-icon,
.dropzone:has(.dz-preview:not(.hidden)) .dz-title,
.dropzone:has(.dz-preview:not(.hidden)) .dz-hint { display: none; }

/* ---------- 10. 预览分栏 ---------- */
.tool-result { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 20px; animation: fadeUp .3s var(--ease) both; }
@keyframes resultFlash { 0% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0); } 18% { box-shadow: 0 0 0 4px rgba(var(--brand-rgb), .38); } 100% { box-shadow: 0 0 0 0 rgba(var(--brand-rgb), 0); } }
.result-flash { border-radius: var(--radius); animation: resultFlash 1.5s var(--ease) 1; }
.preview-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pv-col { display: flex; flex-direction: column; }
.pv-label { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .5px; }
.pv-img-wrap {
  background: repeating-conic-gradient(#f3f5f9 0% 25%, #fff 0% 50%) 50% / 18px 18px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 160px;
  display: grid; place-items: center; padding: 10px; overflow: hidden;
}
.pv-img-wrap img { max-width: 100%; max-height: 320px; border-radius: 8px; display: block; cursor: zoom-in; }
.pv-empty { color: var(--muted); font-size: 13px; }
.pv-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.res-meta { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.res-tip { font-size: 12px; color: var(--warn); margin-top: 10px; background: #fff8ec; border: 1px solid #ffe6bf; border-radius: 10px; padding: 8px 12px; }
.res-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.res-grid .cell { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.res-grid .cell img { width: 100%; display: block; cursor: zoom-in; }
.pv-single .pv-img-wrap { grid-column: 1 / -1; }

/* ---------- 11. 交互式编辑画布（裁剪 / 涂抹消除） ---------- */
.editor-stage { position: relative; user-select: none; touch-action: none; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); background: #0f172a08; line-height: 0; }
.editor-stage canvas { width: 100%; height: auto; display: block; }
.editor-tools { display: flex; align-items: center; gap: 14px; margin: 14px 0; flex-wrap: wrap; }
.editor-tools .mini-label { font-size: 13px; color: var(--muted); }
/* 裁剪选框 */
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45); cursor: move; }
.crop-handle { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; }
.crop-handle.nw { left: -7px; top: -7px; cursor: nw-resize; }
.crop-handle.ne { right: -7px; top: -7px; cursor: ne-resize; }
.crop-handle.sw { left: -7px; bottom: -7px; cursor: sw-resize; }
.crop-handle.se { right: -7px; bottom: -7px; cursor: se-resize; }
.brush-clear { color: var(--danger); background: none; border: none; cursor: pointer; font-size: 13px; text-decoration: underline; }
/* 裁剪台/涂抹台：图片按显示上限缩放居中，避免大图撑高页面 */
.crop-stage { display: flex; justify-content: center; align-items: flex-start; padding: 10px; background: #0f172a08; }
.crop-frame { position: relative; line-height: 0; max-width: 100%; }
.crop-frame img { display: block; max-width: 100%; max-height: 56vh; width: auto; height: auto; border-radius: 6px; }
.crop-hint { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }
.crop-ratio-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.crop-ratio-bar .mini-label { font-size: 13px; color: var(--muted); margin-right: 2px; }
.crop-chip { border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; padding: 6px 13px; border-radius: 16px; cursor: pointer; transition: .15s; }
.crop-chip:hover { border-color: var(--brand); color: var(--brand); }
.crop-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 12. 扫码登录 ---------- */
.qr-body { text-align: center; }
.qr-wrap { position: relative; display: inline-block; padding: 10px; border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.qr-img { width: 220px; height: 220px; object-fit: contain; display: block; border-radius: 12px; }
.qr-overlay { position: absolute; inset: 10px; background: rgba(255, 255, 255, .94); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border-radius: 12px; color: var(--muted); font-size: 14px; }
.qr-status { font-size: 15px; font-weight: 600; margin: 18px 0 4px; }
.qr-tip { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.qr-mini-note { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 12px; color: var(--muted); margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }

/* ---------- 13. 积分不足弹窗 ---------- */
.points-body { text-align: center; }
.points-icon { width: 68px; height: 68px; border-radius: 50%; background: #fdeede; color: var(--cost); display: grid; place-items: center; margin: 4px auto 16px; }
.points-icon svg { width: 34px; height: 34px; }
.points-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.points-text { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.points-body .btn-primary { width: 100%; justify-content: center; display: inline-flex; }

/* ---------- 14. 加载弹窗 ---------- */
.modal.loading-modal .modal-card { width: auto; padding: 28px 34px; box-shadow: var(--shadow-md); }
.loading-body { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .8s linear infinite; }
.loading-text { font-size: 14px; color: var(--muted); }

/* ---------- 15. Toast（顶部居中胶囊） ---------- */
.toast {
  position: fixed; top: 24px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: rgba(31, 42, 68, .92); color: #fff; padding: 12px 24px; border-radius: 999px;
  font-size: 14px; z-index: 100; max-width: 80vw; box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .22s, transform .22s var(--ease);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-ok { background: var(--ok); }
.toast-error { background: var(--danger); }

/* ---------- 16. 页脚 ---------- */
.footer { text-align: center; padding: 24px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--line); background: rgba(255, 255, 255, .6); }

/* ---------- 17. 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
.modal.closing .modal-card { animation: popOut .18s ease both; }
.modal.closing .modal-mask { animation: fadeOut .18s ease both; }
@keyframes popOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes fadeOut { to { opacity: 0; } }

/* ---------- 18. 响应式 ---------- */
@media (max-width: 960px) {
  .preview-split { grid-template-columns: 1fr; }
  .container { padding: 24px 18px 40px; }
  .topbar { padding: 12px 18px; }
}
@media (max-width: 560px) {
  .hero h1 { font-size: 26px; }
  .tool-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .brand .logo-text span { display: none; }
  .res-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 19. 九宫格朋友圈实时预览（对齐小程序 grid 模板效果）---------- */
.grid-preview-wrap { margin: 6px 0 14px; }
.gp-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.gp-title { font-size: 14px; font-weight: 700; color: var(--ink, #1e293b); }
.gp-sub { font-size: 12px; color: var(--muted, #94a3b8); }
.gp-moments { max-width: 360px; margin: 0 auto; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px; box-shadow: 0 6px 18px rgba(15, 23, 42, .06); }
.gp-user { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gp-avatar { width: 36px; height: 36px; border-radius: 6px; background: linear-gradient(135deg, #4dabf7, #845ef7); flex-shrink: 0; }
.gp-name { font-size: 13px; color: #2563eb; font-weight: 600; }
.gp-text { font-size: 12px; color: #334155; margin-top: 3px; line-height: 1.5; }
.gp-foot { display: flex; justify-content: flex-end; gap: 16px; background: #eef2f7; border-radius: 8px; padding: 7px 12px; font-size: 12px; color: #2563eb; margin-top: 2px; }
.gp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; position: relative; margin: 2px 0 10px; }
.gp-cell { position: relative; overflow: hidden; width: 100%; padding-top: 100%; background: #e9eef5; }
.gp-inner { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; }
.gp-img { position: absolute; }
.gp-fest { position: absolute; left: 0; right: 0; top: 0; bottom: 0; z-index: 5; pointer-events: none; }
.gp-fest img { width: 100%; height: 100%; object-fit: fill; }
.gp-grid.tpl-rounded { gap: 7px; }
.gp-grid.tpl-rounded .gp-cell { background: #fff; }
.gp-grid.tpl-rounded .gp-inner { left: var(--pi, 5%); top: var(--pi, 5%); width: var(--iw, 90%); height: var(--iw, 90%); border-radius: 10px; }
.gp-grid.tpl-circle { gap: 7px; }
.gp-grid.tpl-circle .gp-cell { background: #fff; }
.gp-grid.tpl-circle .gp-inner { left: var(--pi, 5%); top: var(--pi, 5%); width: var(--iw, 90%); height: var(--iw, 90%); border-radius: 50%; }
.gp-grid.tpl-heart { gap: 5px; }
.gp-grid.tpl-heart .gp-cell { background: #fff; }
.gp-grid.tpl-offset { gap: 8px; }
.gp-grid.tpl-offset .gp-cell { background: #fff; border-radius: 8px; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.gp-grid.tpl-offset .gp-inner { left: var(--pi, 10%); top: var(--pi, 10%); width: var(--iw, 80%); height: var(--iw, 80%); border-radius: 6px; }
.gp-grid.tpl-offset .gp-cell:nth-child(odd) .gp-inner { transform: translateY(calc(-1 * var(--ty, 6%))) rotate(calc(-1 * var(--rot, 3deg))); }
.gp-grid.tpl-offset .gp-cell:nth-child(even) .gp-inner { transform: translateY(var(--ty, 6%)) rotate(var(--rot, 3deg)); }
.gp-grid.tpl-offset .gp-cell:nth-child(5) .gp-inner { transform: scale(var(--csc, 1.12)) rotate(var(--crot, 4deg)); }
.gp-grid.tpl-diagonal { gap: 6px; }
.gp-grid.tpl-diagonal .gp-cell { background: #fff; border-radius: 8px; box-shadow: 0 2px 5px rgba(0, 0, 0, .1); }
.gp-grid.tpl-diagonal .gp-inner { left: var(--pi, 9%); top: var(--pi, 9%); width: var(--iw, 82%); height: var(--iw, 82%); border-radius: 6px; }
.gp-grid.tpl-diagonal .gp-cell:nth-child(1) .gp-inner { transform: rotate(var(--rot1, -5deg)); }
.gp-grid.tpl-diagonal .gp-cell:nth-child(3) .gp-inner { transform: rotate(var(--rot3, 5deg)); }
.gp-grid.tpl-diagonal .gp-cell:nth-child(5) .gp-inner { transform: rotate(calc(-1 * var(--crot, 4deg))) scale(var(--csc, 1.08)); }
.gp-grid.tpl-diagonal .gp-cell:nth-child(7) .gp-inner { transform: rotate(var(--rot7, 5deg)); }
.gp-grid.tpl-diagonal .gp-cell:nth-child(9) .gp-inner { transform: rotate(var(--rot9, -5deg)); }
.gp-grid.tpl-frame { gap: var(--gap, 9px); background: #fff; padding: 6px; }
.gp-grid.tpl-frame .gp-cell { border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.gp-grid.tpl-frame .gp-fest { left: 6px; right: 6px; top: 6px; bottom: 6px; }

/* 九宫格两栏工作台：左参数、右预览（桌面端吸顶，手机单栏） */
.tool-cols { display: grid; grid-template-columns: 1fr; gap: 22px; }
.tool-col-left { min-width: 0; }
.tool-col-right { min-width: 0; }
@media (min-width: 820px) {
  .tool-cols { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .tool-col-right { position: sticky; top: 0; }
  .gp-moments { margin: 0; }
}

/* 通用实时预览右栏（左参数、右吸顶；本地效果所见即所得） */
.pl-card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.pl-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.pl-title { font-size: 14px; font-weight: 700; color: var(--text); }
.pl-sub { font-size: 12px; color: var(--brand); font-weight: 600; }
.pl-body { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; min-height: 180px; background: repeating-conic-gradient(#f3f5f9 0% 25%, #fff 0% 50%) 50% / 18px 18px; }
.pl-body canvas, .pl-body img { max-width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 2px 10px rgba(15, 23, 42, .10); }
.pl-empty { color: var(--muted); font-size: 13px; text-align: center; }
.pl-note { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }

/* 节日样式缩略图选择器（复刻小程序两级：节日 chip + 样式缩略图，缩略图即叠加图） */
.fest-bar { display: flex; flex-direction: column; gap: 12px; }
.fest-festival-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fest-chip { border: 1px solid var(--line); background: #fff; color: var(--text); font-size: 13px; padding: 7px 14px; border-radius: 18px; cursor: pointer; transition: .15s; }
.fest-chip:hover { border-color: var(--brand); color: var(--brand); }
.fest-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.fest-sublabel { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.fest-scroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; }
.fest-item { flex: 0 0 auto; width: 76px; text-align: center; cursor: pointer; }
.fest-cover { width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: #3a3a3a; border: 2px solid transparent; box-sizing: border-box; }
.fest-img { width: 100%; height: 100%; object-fit: contain; }
.fest-name { margin-top: 6px; font-size: 12px; color: #555; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fest-item.on .fest-cover { border-color: var(--brand); }
.fest-item.on .fest-name { color: var(--brand); font-weight: 600; }

/* ---------- 18. 落地首页（参考 phototool.cn 营销式首页） ---------- */
html { scroll-behavior: smooth; }
#tools, #features, #faqs { scroll-margin-top: 78px; }
.landing { max-width: 1120px; }
a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.btn-lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }

/* Hero */
.lp-hero { text-align: center; padding: 34px 0 20px; animation: fadeUp .5s var(--ease) both; }
.lp-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  color: var(--brand-d); background: var(--brand-soft); border: 1px solid #d5e2ff;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.lp-eyebrow .lp-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px #cfe0ff; }
.lp-title { font-size: 44px; line-height: 1.18; margin: 0 0 16px; font-weight: 800; letter-spacing: .5px; }
.lp-title .grad { background: linear-gradient(120deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lp-sub { color: var(--muted); font-size: 16px; line-height: 1.7; margin: 0 auto 24px; max-width: 640px; }
.lp-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-bottom: 26px; }
.lp-trust { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.lp-trust .trust {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 18px; min-width: 190px; box-shadow: var(--shadow-sm); font-size: 12px; color: var(--muted);
}
.lp-trust .trust b { font-size: 15px; color: var(--text); font-weight: 700; }

/* 分区 */
.lp-block { margin: 56px 0; }
.lp-block-head { text-align: center; margin-bottom: 26px; }
.lp-block-head h2 { font-size: 26px; margin: 0 0 8px; font-weight: 800; }
.lp-block-head p { color: var(--muted); font-size: 15px; margin: 0; }

/* 一站式能力 */
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.feat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; transition: transform .18s var(--ease), box-shadow .22s, border-color .22s; }
.feat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: #cfe0ff; }
.feat-ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); box-shadow: 0 6px 16px rgba(47, 107, 255, .28); margin-bottom: 14px; }
.feat-ic svg { width: 24px; height: 24px; }
.feat-card h3 { font-size: 17px; margin: 0 0 8px; font-weight: 700; }
.feat-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* 简单三步 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.step { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 22px; text-align: center; position: relative; }
.step-n { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-d); font-size: 18px; font-weight: 800; margin-bottom: 12px; }
.step h3 { font-size: 16px; margin: 0 0 8px; font-weight: 700; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* 使用场景 */
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.case-card { background: linear-gradient(180deg, #fff, #f7faff); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.case-card h3 { font-size: 16px; margin: 0 0 8px; font-weight: 700; color: var(--brand-d); }
.case-card p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0; }

/* FAQ */
.lp-faq { max-width: 780px; margin-left: auto; margin-right: auto; }
.lp-faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 18px; margin-bottom: 12px; transition: border-color .2s; }
.lp-faq details[open] { border-color: #cfe0ff; }
.lp-faq summary { cursor: pointer; font-weight: 600; font-size: 15px; list-style: none; padding: 12px 0; position: relative; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: '+'; position: absolute; right: 2px; top: 10px; font-size: 20px; color: var(--muted); transition: transform .2s; }
.lp-faq details[open] summary::after { transform: rotate(45deg); color: var(--brand); }
.faq-a { color: var(--muted); font-size: 14px; line-height: 1.7; padding: 0 0 14px; }

/* 底部 CTA */
.lp-final { text-align: center; background: linear-gradient(135deg, var(--brand) 0%, var(--brand-d) 60%, #1e40af 100%); color: #fff; border-radius: 22px; padding: 44px 24px; box-shadow: var(--shadow-lg); }
.lp-final h2 { font-size: 26px; margin: 0 0 10px; font-weight: 800; }
.lp-final p { opacity: .9; font-size: 15px; margin: 0 0 22px; }
.lp-final .btn-primary { background: #fff; color: var(--brand-d); box-shadow: 0 8px 22px rgba(0, 0, 0, .18); }
.lp-final .btn-primary:hover { box-shadow: 0 12px 28px rgba(0, 0, 0, .24); }

@media (max-width: 640px) {
  .lp-title { font-size: 30px; }
  .lp-sub { font-size: 14px; }
  .lp-br { display: none; }
  .lp-trust { flex-direction: column; align-items: stretch; }
  .lp-trust .trust { min-width: 0; }
  .lp-block { margin: 40px 0; }
}

/* ---------- 19. 子页面路由（工具页/全部工具页，参考 phototool 整页体验） ---------- */
.lp-viewall { text-align: center; margin-top: 26px; }
.page-bar { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.page-bar h2 { margin: 0; font-size: 22px; font-weight: 800; }
.page-back {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  color: var(--brand-d); font-weight: 600; font-size: 14px; text-decoration: none;
  padding: 7px 12px; border-radius: 9px; background: var(--brand-soft); transition: .15s;
}
.page-back:hover { background: #dceaff; }
.tool-page { animation: fadeIn .22s var(--ease) both; }

/* 全部工具页：分类 Tab 导航（吸附在顶栏下方） */
.cat-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  position: sticky; top: 66px; z-index: 20;
  margin: 0 0 18px; padding: 10px 0; background: var(--bg);
}
.cat-tab {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; transition: all .18s var(--ease);
}
.cat-tab:hover { color: var(--brand); border-color: var(--brand); }
.cat-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 12px rgba(47, 107, 255, .25); }
.cat-tab-pro { color: var(--cost); border-color: #f3d9bd; }
.cat-tab-pro:hover { color: var(--cost); border-color: var(--cost); }
.cat-tab-pro.active { background: var(--cost); border-color: var(--cost); color: #fff; box-shadow: 0 4px 12px rgba(224, 123, 26, .28); }
@media (max-width: 640px) {
  .cat-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; -webkit-overflow-scrolling: touch; }
  .cat-tabs::-webkit-scrollbar { display: none; }
}

/* 工具整页：位于顶栏下方，保留顶部 topbar 常驻 */
.tool-modal { padding: 0; align-items: stretch; justify-content: stretch; background: var(--bg); inset: 66px 0 0 0; }
.tool-modal .modal-mask { display: none; }
.tool-modal .modal-card.lg {
  width: 100%; max-width: 100%; height: 100%; max-height: none;
  border-radius: 0; box-shadow: none; animation: fadeIn .22s var(--ease) both;
}
.tool-modal .modal-head { position: sticky; top: 0; z-index: 2; background: #fff; justify-content: flex-start; gap: 16px; }
.tool-modal .modal-head h3 { flex: 1; text-align: center; }
.tool-modal .head-spacer { width: 84px; flex-shrink: 0; }
.tool-modal .modal-body { padding: 0; }
.tool-modal .tool-form { max-width: 1000px; margin: 0 auto; padding: 26px 24px 8px; }
.tool-modal .modal-foot { position: sticky; bottom: 0; background: #fff; }

/* 详情页下方内容区 */
.tool-detail { max-width: 1000px; margin: 18px auto 48px; padding: 8px 24px 0; border-top: 1px solid var(--line); }
.td-block { margin: 24px 0; }
.td-block h4 { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; margin: 0 0 12px; color: var(--text); }
.td-block h4::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(var(--brand), var(--brand-2)); }
.td-intro { padding-top: 6px; }
.td-intro p { color: var(--muted); font-size: 14.5px; line-height: 1.75; margin: 0; }
.td-steps { margin: 0; padding: 0; list-style: none; counter-reset: tdstep; display: flex; flex-direction: column; gap: 11px; }
.td-steps li { position: relative; padding-left: 36px; color: var(--text); font-size: 14px; line-height: 1.6; counter-increment: tdstep; }
.td-steps li::before { content: counter(tdstep); position: absolute; left: 0; top: 0; width: 25px; height: 25px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-d); font-weight: 700; font-size: 13px; display: grid; place-items: center; }
.td-tips { margin: 0; padding-left: 20px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.td-tips li::marker { color: var(--brand); }
.td-faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 2px 16px; margin-bottom: 10px; transition: border-color .2s; }
.td-faq details[open] { border-color: #cfe0ff; }
.td-faq summary { cursor: pointer; font-weight: 600; font-size: 14px; list-style: none; padding: 11px 0; position: relative; }
.td-faq summary::-webkit-details-marker { display: none; }
.td-faq summary::after { content: '+'; position: absolute; right: 2px; top: 9px; font-size: 18px; color: var(--muted); transition: transform .2s; }
.td-faq details[open] summary::after { transform: rotate(45deg); color: var(--brand); }
.td-faq .faq-a { color: var(--muted); font-size: 13.5px; line-height: 1.7; padding: 0 0 12px; }
.td-related { display: flex; flex-wrap: wrap; gap: 10px; }
.td-rel-chip { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-d); font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid #d5e2ff; transition: .15s; }
.td-rel-chip:hover { background: #dceaff; transform: translateY(-1px); }
