/* —— AI 子站 —— */
.ai-site .page { padding-top: 20px; padding-bottom: 48px; max-width: 960px; margin: 0 auto; }
.ai-site .search-section { margin-bottom: 16px; }
.ai-site .brand-home { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; color: inherit; font: inherit; padding: 0; }
.quota {
  margin-left: auto; padding: 4px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink);
  font-size: 13px; font-weight: 800;
}
.quota.is-empty { background: var(--warn-bg); color: var(--warn-text); border: 1px solid var(--warn-border); }

.work {
  padding: 20px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 240px; padding: 32px 20px;
  border: 2px dashed var(--border); border-radius: 18px;
  background: var(--soft); color: var(--muted); text-align: center; cursor: pointer;
}
.dropzone strong { color: var(--text); font-size: 16px; }
.dropzone .fmt { font-size: 13px; }
.dropzone svg { width: 40px; height: 40px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; color: var(--muted); }
.dropzone.is-disabled, .dropzone[aria-disabled="true"] { cursor: not-allowed; opacity: .55; pointer-events: none; }
.limit-note { margin: 14px 0 0; text-align: center; color: var(--warn-text); font-weight: 700; }
.legal { margin: 16px 0 0; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.7; }

.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.actions .left { margin-right: auto; }
.tool-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 8px; }

.status-panel {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; min-height: 240px; color: var(--muted); font-weight: 700;
}
.status-panel .spinner {
  display: inline-block; width: 32px; height: 32px;
  border: 3px solid var(--border); border-top-color: var(--accent); border-right-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.sample { position: relative; overflow: hidden; width: 100%; aspect-ratio: 4/3; max-height: 420px; border-radius: 16px; background: linear-gradient(160deg, #d7e4f2, #f3efe8); }
.sample svg { display: block; width: 100%; height: 100%; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-grid figure { margin: 0; }
.result-grid figcaption { margin-top: 8px; text-align: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.checker { background-color:var(--surface);background-image:repeating-conic-gradient(var(--border) 0 25%, transparent 0 50%);background-size:16px 16px;border-radius:16px;overflow:hidden; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chips button {
  height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 700;
}
.chips button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.chips input[type=color] { width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 8px; background: none; }

[hidden] { display:none!important; }
.ai-site .page {width:100%;padding-inline:20px;box-sizing:border-box}
.mark {display:block}
.ai-site .brand {flex-wrap:wrap}.ai-site .tool-name {font-size:14px}
.dropzone {width:100%;font:inherit}.dropzone.is-dragging {border-color:var(--accent);background:var(--accent-soft)}
.ai-upload-icon {font-size:40px}.sample {display:flex;align-items:center;justify-content:center}
.sample img,.sample canvas {display:block;width:100%;height:100%;object-fit:contain;min-width:0}
.ai-error {color:var(--err-text);text-align:center}
.ai-landing {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.ai-landing>a {padding:24px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);color:var(--text);text-decoration:none;box-shadow:var(--shadow)}
.ai-landing h2 {font-size:18px}.ai-landing p {color:var(--muted);font-size:14px}.ai-card-icon {font-size:28px;color:var(--accent)}
@media(max-width:700px){.ai-site .page {padding-inline:16px}.work {padding:14px}.ai-landing {grid-template-columns:1fr}.result-grid {gap:12px;grid-template-columns:1fr}.actions {justify-content:flex-start}.ai-site .brand {gap:8px}.ai-site .wordmark {font-size:40px}.ai-site .tool-name {font-size:14px}.site-footer {overflow-wrap:anywhere}}

.sample:not(.checker) {background:var(--soft)}

.work,.tool-head,.ai-landing {width:100%;box-sizing:border-box}
.ai-card-icon svg {width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

@media(max-width:700px){.quota {margin-inline:auto}.sample {max-height:260px}}
@media(prefers-reduced-motion:reduce){.status-panel .spinner{animation:none}}

.ai-editor,.ai-compare {display:block;width:100%;height:auto;max-width:100%;border-radius:12px;background:var(--soft)}
.ai-editor {touch-action:none;cursor:crosshair}
.ai-video-result {display:block;width:100%;max-height:480px;background:#0f172a;border-radius:12px}
.ai-compare-label {display:flex;align-items:center;flex-wrap:wrap;gap:12px;margin-top:12px}
.ai-compare-label input {flex:1;min-width:120px}
.ai-box-list {display:flex;flex-wrap:wrap;gap:8px;padding:0;list-style:none}
.ai-tool[data-tool$="-watermark"] .actions label {display:flex;align-items:center;flex-wrap:wrap;gap:8px;max-width:100%}
.ai-tool[data-tool$="-watermark"] input[type=range] {max-width:100%;accent-color:var(--accent)}
.ai-tool[data-tool$="-watermark"] .actions button,.ai-box-list button {font:inherit;border:1px solid var(--border);border-radius:10px;padding:8px 12px;background:var(--soft);color:var(--text);cursor:pointer}
.ai-tool[data-tool$="-watermark"] .actions .primary-button {background:var(--accent);color:var(--accent-text,#fff);text-decoration:none;border-radius:10px;padding:8px 14px}
.ai-tool[data-tool$="-watermark"] button:disabled {cursor:not-allowed;opacity:.55}
.ai-tool[data-tool$="-watermark"] progress {max-width:100%;accent-color:var(--accent)}

.ai-rewards {margin-top:20px;padding:24px;border:1px solid var(--warn-border);border-radius:16px;background:var(--warn-bg);text-align:center;overflow-wrap:anywhere}
.ai-rewards p {font-size:13px;color:var(--muted)}

@media(max-width:700px){.ai-rewards{padding:20px 12px}}

/* Shared dialog geometry and close controls used by the site's modals. */
dialog.modal{box-sizing:border-box;width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 48px);padding:0;border:0;border-radius:18px;background:var(--surface);color:var(--text);box-shadow:0 24px 64px #0005;overflow:auto}
dialog.modal::backdrop{background:#16131a8c;backdrop-filter:blur(2px)}
.modal-card{display:flex;flex-direction:column;gap:16px;padding:0 22px 20px;overflow-wrap:anywhere;min-width:0}
.modal-head{display:flex;align-items:center;gap:12px;margin:0 -22px;padding:16px 16px 14px 22px;border-bottom:1px solid var(--border)}
.modal-head h2{margin:0;font-size:1.05rem}.modal-x{margin-left:auto;flex:none;width:32px;height:32px;border:0;border-radius:8px;background:var(--soft);color:var(--text);cursor:pointer}
[data-ad-content]{max-width:100%;overflow:hidden;min-width:0}[data-ad-content] img{display:block;max-width:100%;height:auto}[data-ad-content] iframe{max-width:100%}
.modal-card p{margin:0;color:var(--muted)}.modal-card button:disabled{opacity:.55;cursor:default}
