/* =========================================================
   图片在线去背景 - 样式表
   模块顺序：变量 / 基础 / 通用组件 / 头部 / 首屏 / 编辑器 /
             内容区块 / 页脚 / 提示层 / 响应式
   ========================================================= */

/* ---------------- 1. 变量 ---------------- */
:root {
  --brand: #2b6cff;
  --brand-dark: #1c50d6;
  --brand-soft: #eaf1ff;
  --accent: #7c5cff;
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #7b8698;
  --line: #e4e9f2;
  --bg: #f5f8fd;
  --bg-alt: #eef3fb;
  --card: #ffffff;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
  --shadow: 0 12px 32px rgba(15, 23, 42, .09);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
  --container: 1200px;
  --header-h: 64px;
}

/* ---------------- 2. 基础 ---------------- */
* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 .6em; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 3.4vw, 40px); }
h2 { font-size: clamp(21px, 2.4vw, 30px); }
h3 { font-size: 17px; }
p { margin: 0 0 1em; color: var(--ink-2); }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; color: var(--ink-2); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; }
canvas { max-width: 100%; display: block; }
kbd {
  display: inline-block; padding: 1px 6px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
}
em { font-style: normal; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.hidden { display: none !important; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 99; padding: 10px 16px;
  background: var(--brand); color: #fff; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; }

/* ---------------- 3. 通用组件 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border: 1px solid transparent; border-radius: 999px;
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--accent)); color: #fff; box-shadow: 0 8px 20px rgba(43, 108, 255, .28); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(43, 108, 255, .36); }
.btn-soft { background: var(--brand-soft); color: var(--brand-dark); border-color: #d6e3ff; }
.btn-soft:hover { background: #dfe9ff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: #c8d3e6; box-shadow: var(--shadow-sm); }
.btn-block { width: 100%; }
.btn-lg { padding: 14px 30px; font-size: 16px; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm);
}

.pill {
  display: inline-block; margin-bottom: 14px; padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--brand-dark); background: var(--brand-soft); border: 1px solid #d8e5ff;
}

.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 760px; margin: 0 auto 36px; text-align: center; }
.section-head p { margin: 0; font-size: 16px; }

.card-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }

/* 棋盘格：展示透明背景 */
.checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e9eef7 25%, transparent 25%),
    linear-gradient(-45deg, #e9eef7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e9eef7 75%),
    linear-gradient(-45deg, transparent 75%, #e9eef7 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

/* ---------------- 4. 头部 ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 100%; gap: 16px; }
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  font-size: 13px; font-weight: 700; color: #fff; letter-spacing: .5px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
}
.logo-text { font-size: 17px; font-weight: 700; color: var(--ink); }

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 500;
  color: var(--ink-2); text-decoration: none; transition: background .2s ease, color .2s ease;
}
.site-nav a:hover { background: var(--brand-soft); color: var(--brand-dark); text-decoration: none; }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 38px; padding: 0 10px; background: #fff;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
}
.nav-toggle span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }

/* ---------------- 5. 首屏 ---------------- */
.hero { padding: 52px 0 56px; background: linear-gradient(180deg, #eef4ff 0%, var(--bg) 100%); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; }
.hero-copy h1 { margin-bottom: 16px; }
.hero-sub { font-size: 16px; max-width: 620px; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hero-points li { position: relative; padding-left: 26px; font-size: 15px; color: var(--ink-2); }
.hero-points li::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 16px; height: 9px;
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg); border-radius: 1px;
}

/* 上传区 */
.uploader {
  background: #fff; border: 2px dashed #c8d8f5; border-radius: var(--radius-lg);
  padding: 30px 24px; text-align: center; box-shadow: var(--shadow); cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}
.uploader:hover, .uploader:focus-visible { border-color: var(--brand); background: #fbfdff; outline: none; }
.uploader.is-drag { border-color: var(--brand); background: var(--brand-soft); transform: scale(1.01); }
.uploader-icon {
  width: 62px; height: 62px; margin: 0 auto 14px; display: grid; place-items: center;
  border-radius: 50%; color: var(--brand); background: var(--brand-soft);
}
.uploader-icon svg { width: 30px; height: 30px; }
.uploader-title { font-size: 19px; margin-bottom: 8px; }
.uploader-tip { font-size: 14px; margin-bottom: 18px; color: var(--ink-2); }
.uploader-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 14px; }
.uploader-note { font-size: 12.5px; color: var(--ink-3); margin: 0; }

/* ---------------- 6. 编辑器 ---------------- */
.editor-wrap { padding: 44px 0 56px; background: #fff; border-bottom: 1px solid var(--line); }
.editor-head { text-align: center; margin-bottom: 26px; }
.editor-title { margin-bottom: 6px; }
.editor-desc { margin: 0; }

.editor-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); gap: 22px; align-items: start; }

.editor-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stage-panel {
  position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow-sm);
}
.stage-label {
  position: absolute; top: 12px; left: 12px; z-index: 2; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
}
.canvas-box { border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); min-height: 220px; display: grid; place-items: center; }
.canvas-box canvas { width: 100%; height: auto; max-height: 58vh; object-fit: contain; }

.editor-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.panel-tabs { display: flex; border-bottom: 1px solid var(--line); background: #fbfcfe; }
.tab {
  flex: 1; padding: 13px 6px; border: 0; background: transparent; cursor: pointer;
  font-size: 14.5px; font-weight: 600; color: var(--ink-3); border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--brand-dark); border-bottom-color: var(--brand); background: #fff; }
.panel-body { padding: 18px; max-height: 70vh; overflow-y: auto; }
.group-title { font-size: 13px; font-weight: 700; text-transform: none; color: var(--ink-3); letter-spacing: .04em; margin: 0 0 10px; }
.panel-hint { font-size: 13px; color: var(--ink-3); margin: 0 0 14px; }
.panel-divider { height: 1px; background: var(--line); margin: 18px 0; }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 8px; margin-bottom: 18px; }
.swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 4px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; font-size: 11.5px; color: var(--ink-2); transition: border-color .2s ease, box-shadow .2s ease;
}
.swatch i { display: block; width: 100%; height: 26px; border-radius: 6px; border: 1px solid rgba(15, 23, 42, .1); }
.swatch .i-checker {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #dfe6f2 25%, transparent 25%),
    linear-gradient(-45deg, #dfe6f2 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #dfe6f2 75%),
    linear-gradient(-45deg, transparent 75%, #dfe6f2 75%);
  background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0;
}
.swatch:hover { border-color: #b9cbf0; }
.swatch.is-active { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(43, 108, 255, .18); color: var(--brand-dark); font-weight: 600; }
.swatch-lg i { height: 34px; }

.color-row { display: flex; gap: 8px; align-items: center; margin-bottom: 18px; }
.color-row input[type="color"] { width: 46px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; cursor: pointer; }
.color-row input[type="text"] {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; font-size: 14px;
  border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink); background: #fff;
}
.color-row input[type="text"]:focus { outline: none; border-color: var(--brand); }

.upload-mini {
  display: grid; place-items: center; margin-bottom: 10px; padding: 22px 12px;
  border: 2px dashed #c8d8f5; border-radius: var(--radius-sm); cursor: pointer;
  font-size: 13.5px; color: var(--ink-2); background: #fbfdff; transition: border-color .2s ease, background .2s ease;
}
.upload-mini:hover, .upload-mini.is-drag { border-color: var(--brand); background: var(--brand-soft); }

.slider-row { display: block; margin-bottom: 14px; font-size: 13.5px; color: var(--ink-2); }
.slider-row > span { display: flex; justify-content: space-between; margin-bottom: 6px; }
.slider-row em { font-weight: 700; color: var(--brand-dark); }
input[type="range"] { width: 100%; height: 6px; border-radius: 999px; background: #e3eaf7; -webkit-appearance: none; appearance: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; border: 3px solid var(--brand); box-shadow: var(--shadow-sm);
}
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); }

.field-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 13.5px; color: var(--ink-2); }
.field-row select {
  flex: 1; min-width: 0; height: 38px; padding: 0 10px; font-size: 13.5px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer;
}
.field-row select:focus { outline: none; border-color: var(--brand); }

.panel-actions { display: grid; gap: 8px; margin-top: 14px; }
.img-info { margin: 14px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-3); word-break: break-all; }

.change-image {
  display: block; margin: 22px auto 0; padding: 9px 18px; font-size: 14px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
}
.change-image:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ---------------- 7. 内容区块 ---------------- */
.feature h3 { margin-bottom: 6px; }
.feature p, .scene p { margin: 0; font-size: 14.5px; }
.feature-icon {
  width: 44px; height: 44px; margin-bottom: 12px; display: grid; place-items: center;
  border-radius: 12px; color: var(--brand); background: var(--brand-soft);
}
.feature-icon svg { width: 24px; height: 24px; }
.scene { border-left: 3px solid var(--brand-soft); }
.scene h3 { font-size: 16px; }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; margin: 0 0 34px; padding: 0; list-style: none; }
.step { position: relative; padding: 24px 20px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.step-no {
  display: grid; place-items: center; width: 34px; height: 34px; margin-bottom: 12px; border-radius: 11px;
  font-size: 15px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent));
}
.step h3 { margin-bottom: 6px; font-size: 16px; }
.step p { margin: 0; font-size: 14.5px; }

.tips { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm); }
.tips h3 { margin-bottom: 12px; }
.tips ul { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 14.5px; }

.faq { max-width: 900px; margin: 0 auto; display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 4px 18px; box-shadow: var(--shadow-sm); }
.faq summary {
  padding: 14px 0; font-size: 15.5px; font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; position: relative; padding-right: 26px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 12px; font-size: 20px; font-weight: 400; color: var(--brand); transition: transform .2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; font-size: 14.5px; }

.cta-band { background: linear-gradient(135deg, #12295e, #2b6cff 55%, #7c5cff); color: #fff; }
.cta-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 22px; }
.cta-band h2, .cta-band p { color: #fff; }
.cta-band p { margin: 0; opacity: .88; }
.cta-band .btn-primary { background: #fff; color: var(--brand-dark); box-shadow: 0 10px 26px rgba(0, 0, 0, .2); }

.keywords { background: var(--bg); }
.keywords h2 { font-size: 18px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud span {
  padding: 6px 13px; font-size: 13px; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); border-radius: 999px;
}

/* ---------------- 8. 页脚 ---------------- */
.site-footer { background: #0f172a; color: #94a3b8; padding: 42px 0 22px; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 24px; justify-content: space-between; align-items: flex-start; }
.footer-brand strong { display: block; margin-bottom: 6px; font-size: 17px; color: #fff; }
.footer-brand p { margin: 0; font-size: 14px; color: #94a3b8; max-width: 420px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer-nav a { color: #cbd5e1; font-size: 14.5px; }
.footer-nav a:hover { color: #fff; }
.copyright { margin-top: 22px; padding-top: 16px; border-top: 1px solid rgba(148, 163, 184, .2); }
.copyright p { margin: 0; font-size: 13px; color: #7c8798; }

/* ---------------- 9. 提示层 ---------------- */
.loading { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(15, 23, 42, .42); }
.loading-box {
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 26px 34px;
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.loading-box p { margin: 0; font-size: 14.5px; color: var(--ink); }
.spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #e3eaf7; border-top-color: var(--brand); animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 70; transform: translate(-50%, 20px);
  max-width: min(90vw, 420px); padding: 11px 20px; border-radius: 999px;
  font-size: 14px; color: #fff; background: rgba(15, 23, 42, .92);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .25s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 10. 响应式 ---------------- */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 30px; }
  .hero-sub { max-width: none; }
  .editor-grid { grid-template-columns: 1fr; }
  .panel-body { max-height: none; }
}

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px 16px 16px; background: #fff; border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow); display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 10px; border-radius: var(--radius-sm); }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 70px; }
  .section { padding: 46px 0; }
  .hero { padding: 34px 0 40px; }
  .uploader { padding: 24px 16px; }
  .uploader-actions .btn { flex: 1 1 100%; }
  .editor-stage { grid-template-columns: 1fr; }
  .canvas-box canvas { max-height: 46vh; }
  .card { padding: 18px; }
  .panel-body { padding: 15px; }
  .color-row { flex-wrap: wrap; }
  .color-row input[type="text"] { flex: 1 1 120px; }
  .color-row .btn { flex: 1 1 100%; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
  .cta-band .btn-lg { width: 100%; }
  .footer-inner { flex-direction: column; gap: 18px; }
  .toast { bottom: 18px; }
}

@media (max-width: 400px) {
  .swatches { grid-template-columns: repeat(3, 1fr); }
  .header-inner { gap: 10px; }
  .logo-text { font-size: 15.5px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
