/* AI 推理工具（照片增强 / 背景移除）控件样式 —— 源自原站 index.html 内联 style，站点化改造 */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; flex-shrink: 0; }

  /* 状态 / 进度 */
  .status-line { display: flex; align-items: center; gap: .625rem; margin-bottom: 1rem; font-size: .8125rem;
    padding: .5rem .75rem; border-radius: .5rem; background: #222228; border: 1px solid #1f2937; }
  .status-dot { width: .5rem; height: .5rem; border-radius: 50%; background: #6b7280; flex-shrink: 0; }
  .status-line.info .status-dot { background: #818cf8; }
  .status-line.ok .status-dot { background: #34d399; }
  .status-line.error .status-dot { background: #f87171; }
  .status-line.error { color: #fca5a5; }
  .status-line.ok { color: #6ee7b7; }
  .pill { margin-left: auto; font-size: .75rem; padding: .125rem .5rem; border-radius: 999px;
    background: rgba(255,255,255,.06); color: #9ca3af; white-space: nowrap; }
  .pill-ok { background: rgba(52,211,153,.15); color: #6ee7b7; }
  #progress-wrap { margin-bottom: 1rem; }
  .progress-track { height: .375rem; border-radius: 999px; background: #1f2937; overflow: hidden; }
  .progress-fill { height: 100%; width: 0; border-radius: 999px;
    background: linear-gradient(90deg,#6366f1,#a78bfa); transition: width .15s linear; }
  .progress-label { display: flex; justify-content: space-between; font-size: .75rem; color: #9ca3af; margin-bottom: .375rem; }
  .error-box { display: none; margin-bottom: 1rem; padding: .75rem 1rem; border-radius: .5rem; font-size: .875rem;
    color: #fca5a5; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.25); }

  /* 上传区 */
  .drop-zone { position: relative; border: 2px dashed #374151; border-radius: .75rem; text-align: center;
    cursor: pointer; padding: 3rem; transition: border-color .15s, background-color .15s; }
  .drop-zone:hover, .drop-zone.dragover { border-color: #818cf8; background: rgba(99,102,241,.05); }
  .upload-ico { width: 4rem; height: 4rem; border-radius: 1rem; background: rgba(99,102,241,.1);
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; color: #818cf8; font-size: 1.75rem; }

  /* 结果区 */
  .result-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1rem; }
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border-radius: .5rem;
    padding: .5rem 1rem; font-size: .875rem; font-weight: 500; cursor: pointer; transition: all .15s; border: 1px solid transparent; }
  .btn-primary { background: #4f46e5; color: #fff; }
  .btn-primary:hover { background: #4338ca; }
  .btn-ghost { background: #222228; color: #d1d5db; border-color: #374151; }
  .btn-ghost:hover { background: #2d2d34; }
  .btn:disabled { opacity: .45; cursor: not-allowed; }
  .meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
  .meta-card { background: #222228; border: 1px solid #1f2937; border-radius: .75rem; padding: .875rem 1rem; }
  .meta-label { font-size: .75rem; color: #6b7280; margin-bottom: .25rem; }
  .meta-value { font-size: .875rem; color: #e5e7eb; font-weight: 500; }
  .meta-thumb { width: 100%; height: 5rem; object-fit: contain; margin-bottom: .5rem; border-radius: .375rem; background: #16161b; }

  /* 结果大图 */
  .result-box { width: 100%; border-radius: .75rem; border: 1px solid #1f2937; overflow: hidden;
    display: flex; align-items: center; justify-content: center; min-height: 12rem; padding: .5rem; background: #16161b; }
  .result-box img { max-width: 100%; height: auto; display: block; }
  .placeholder { min-height: 12rem; display: flex; align-items: center; justify-content: center;
    color: #6b7280; font-size: .875rem; background: #16161b; border-radius: .75rem; border: 1px solid #1f2937; }

  /* 前后对比 */
  .compare-wrap { position: relative; width: 100%; overflow: hidden; border-radius: .75rem;
    border: 1px solid #1f2937; background: #16161b; touch-action: none; cursor: ew-resize; }
  .compare-wrap img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
  .compare-after { position: absolute; inset: 0; overflow: hidden; }
  .compare-after img { position: absolute; top: 0; left: 0; height: 100%; width: 100%; }
  .compare-handle { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff;
    box-shadow: 0 0 8px rgba(0,0,0,.6); pointer-events: none; }
  .compare-handle::after { content: '↔'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
    width: 2rem; height: 2rem; border-radius: 50%; background: #fff; color: #111;
    display: flex; align-items: center; justify-content: center; font-size: 1rem; font-weight: 700; }
  .compare-tag { position: absolute; top: .625rem; font-size: .6875rem; padding: .1875rem .5rem; border-radius: .25rem;
    background: rgba(0,0,0,.65); color: #fff; pointer-events: none; }
  .compare-tag.before { left: .625rem; }
  .compare-tag.after { right: .625rem; }
  .compare-range { width: 100%; margin-top: .75rem; accent-color: #6366f1; }

  /* 自检面板 */
  #selftest-panel { display: none; margin-top: 1rem; padding: 1rem; border-radius: .75rem;
    background: #16161b; border: 1px solid #374151; }
  #selftest-report { font-size: .75rem; line-height: 1.5; color: #a5b4fc; white-space: pre-wrap;
    word-break: break-all; margin: 0; max-height: 26rem; overflow: auto; }
  .footer-note { text-align: center; font-size: .75rem; color: #4b5563; margin-top: 3rem; }


/* ── 站点主题对齐（覆盖原站局部配色，与 tool-page.css 一致） ── */
.it-main .content-card, .it-main .meta-card, .it-main .status-line { background:#111827; border-color:#1f2937; }
.it-main .result-box, .it-main .placeholder, .it-main .drop-zone, .it-main .compare-wrap { background:#0b1220; border-color:#1f2937; }
.it-main .error-box { background:rgba(239,68,68,.10); border-color:rgba(239,68,68,.25); }
.it-main .btn-primary { background:#2563eb; }
.it-main .btn-primary:hover { background:#1d4ed8; }
.it-main .btn-ghost { background:#111827; border-color:#374151; color:#d1d5db; }
.it-main .btn-ghost:hover { background:#1f2937; }
.it-main .progress-fill { background:linear-gradient(90deg,#2563eb,#60a5fa); }
.it-main .status-line.ok { color:#6ee7b7; }
.it-main .status-line.error { color:#fca5a5; }

/* 透明 PNG 棋盘格（背景移除结果） */
.checkerboard {
  background-color:#1a1a1a;
  background-image:
    linear-gradient(45deg,#2a2a2a 25%,transparent 25%,transparent 75%,#2a2a2a 75%,#2a2a2a),
    linear-gradient(45deg,#2a2a2a 25%,transparent 25%,transparent 75%,#2a2a2a 75%,#2a2a2a);
  background-size:16px 16px;
  background-position:0 0,8px 8px;
}
.result-box.checkerboard img { max-width:100%; height:auto; display:block; }
.meta-thumb.checkerboard { background-color:#1a1a1a; }

/* 工具卡片与页面容器（不依赖 Tailwind CDN） */
.it-card { background:#111827; border:1px solid #1f2937; border-radius:16px; padding:24px; }
@media (min-width:640px){ .it-card { padding:32px; } }
.it-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:16px; margin-bottom:18px; padding:14px 16px; border-radius:12px; background:#0b1220; border:1px solid #1f2937; }
.it-toolbar .pill { margin-left:auto; }
.it-section-title { text-align:center; font-size:24px; font-weight:800; color:#fff; margin:0 0 32px; }
.it-steps { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:24px; }
.it-step { text-align:center; }
.it-num { width:40px; height:40px; margin:0 auto 14px; border-radius:999px; background:#2563eb; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700; font-size:14px; }
.it-step h3 { color:#fff; font-size:16px; font-weight:600; margin:0 0 6px; }
.it-step p { color:#9ca3af; font-size:13px; line-height:1.7; margin:0; }
.it-faq { max-width:900px; margin:0 auto; display:grid; gap:16px; }
.it-faq-item { background:#111827; border:1px solid #1f2937; border-radius:12px; padding:20px 24px; }
.it-faq-item h3 { color:#fff; font-size:15px; font-weight:600; margin:0 0 8px; }
.it-faq-item p { color:#9ca3af; font-size:13px; line-height:1.8; margin:0; }
.it-related { display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:16px; }
.it-related a { display:flex; gap:16px; align-items:flex-start; background:#111827; border:1px solid #1f2937; border-radius:12px; padding:18px; text-decoration:none; transition:border-color .15s; }
.it-related a:hover { border-color:rgba(37,99,235,.5); }
.it-related .it-rel-ico { width:40px; height:40px; flex:0 0 auto; border-radius:10px; background:rgba(37,99,235,.12); color:#60a5fa; display:flex; align-items:center; justify-content:center; font-size:18px; }
.it-related strong { color:#fff; font-size:14px; display:block; margin-bottom:4px; }
.it-related small { color:#9ca3af; font-size:12px; line-height:1.6; }
.it-footnote { text-align:center; color:#6b7280; font-size:12px; margin-top:48px; }
@media (max-width:640px){
  .it-wrap { padding:28px 12px 56px; }
  .it-card { padding:16px; }
  .drop-zone { padding:2rem 1rem; }
  .meta-grid { grid-template-columns:1fr; }
}
