/* ==================== 证件照换底色 ==================== */
* { box-sizing: border-box; }

:root {
    --brand: #667eea;
    --brand-2: #764ba2;
    --ink: #1a202c;
    --muted: #718096;
    --line: #e2e8f0;
    --bg: #f7f8fc;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
}

.wrap { width: min(1080px, calc(100% - 32px)); margin: 0 auto; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==================== 顶栏 ==================== */
.topbar {
    background: #fff;
    border-bottom: 1px solid var(--line);
    position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 0;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}
.brand-title { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.brand-subtitle { margin: 0; font-size: 12px; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 16px; }
.nav a { color: #4a5568; text-decoration: none; font-size: 14px; }
.nav a:hover { color: var(--brand); }

/* ==================== 区块 ==================== */
.section { padding: 32px 0; }
.hero { text-align: center; margin-bottom: 24px; }
.hero-title { margin: 0 0 10px; font-size: 28px; font-weight: 800; }
.hero-desc { margin: 0 auto; max-width: 680px; color: var(--muted); font-size: 15px; }
.hero-free {
    display: inline-block; margin: 14px 0 0; padding: 7px 16px; border-radius: 999px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.12));
    border: 1px solid rgba(102, 126, 234, 0.28);
    color: var(--brand); font-size: 14px; font-weight: 700;
}

/* ==================== 工具区 ==================== */
.tool-shell {
    display: grid; grid-template-columns: 1.1fr 1fr; gap: 20px;
    background: #fff; border: 1px solid var(--line); border-radius: 16px;
    padding: 20px; box-shadow: 0 8px 30px rgba(102, 126, 234, 0.08);
}
.upload-panel { display: flex; flex-direction: column; }
.drop-zone {
    flex: 1; min-height: 300px; border: 2px dashed #cbd5e0; border-radius: 12px;
    background: #fbfcfe; display: flex; flex-direction: column;
    align-items: center; justify-content: center; text-align: center;
    padding: 24px; cursor: pointer; transition: all 0.2s; outline: none;
}
.drop-zone:hover, .drop-zone:focus { border-color: var(--brand); background: #f5f7ff; }
.drop-zone.dragover { border-color: var(--brand); background: #eef1ff; }
.drop-icon { color: var(--brand); margin-bottom: 12px; }
.drop-icon svg { width: 48px; height: 48px; }
.drop-main { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.drop-sub { margin: 0; font-size: 13px; color: var(--muted); max-width: 320px; }

.preview-wrap { display: flex; align-items: center; gap: 16px; }
.preview-thumb {
    width: 120px; height: 160px; border-radius: 10px; overflow: hidden;
    background: #edf2f7; flex-shrink: 0; border: 1px solid var(--line);
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-name { margin: 0 0 8px; font-size: 13px; color: #4a5568; word-break: break-all; }
.link-btn {
    background: none; border: none; color: var(--brand); cursor: pointer;
    font-size: 13px; padding: 0; text-decoration: underline;
}
.link-btn:hover { color: var(--brand-2); }

/* ==================== 参数面板 ==================== */
.setting-panel { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-label { font-size: 14px; font-weight: 600; color: #2d3748; }

.color-options { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 12px 7px 8px; border: 2px solid var(--line); border-radius: 999px;
    background: #fff; cursor: pointer; font-size: 13px; color: #4a5568;
    transition: all 0.15s;
}
.color-swatch::before {
    content: ""; width: 18px; height: 18px; border-radius: 50%;
    background: var(--swatch); border: 1px solid rgba(0, 0, 0, 0.12);
}
.color-swatch:hover { border-color: #c3cbe4; }
.color-swatch.active { border-color: var(--brand); color: var(--brand); font-weight: 600; }
/* 透明底 = 去底色，用棋盘格表示透明 */
.color-swatch-transparent::before {
    background: repeating-conic-gradient(#d1d5db 0% 25%, #fff 0% 50%) 50% / 12px 12px;
}
.field-hint { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.custom-color { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.custom-color input[type="color"] {
    width: 34px; height: 28px; padding: 0; border: 1px solid var(--line);
    border-radius: 6px; background: #fff; cursor: pointer;
}

.size-select {
    width: 100%; padding: 11px 12px; border: 1px solid var(--line);
    border-radius: 10px; font-size: 14px; color: var(--ink); background: #fff; cursor: pointer;
}
.size-select:focus { outline: none; border-color: var(--brand); }

.btn-primary {
    width: 100%; padding: 14px; border: none; border-radius: 10px; cursor: pointer;
    color: #fff; font-size: 16px; font-weight: 700;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    transition: opacity 0.2s;
}
.btn-primary:hover:not(:disabled) { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.flash { margin: 0; min-height: 20px; font-size: 13px; color: var(--muted); }
.flash.ok { color: #2f855a; }
.flash.bad { color: #c53030; }
/* 处理中：更醒目的提示 */
.flash.loading {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 12px 14px; border-radius: 10px;
    background: #eef1ff; color: var(--brand);
    font-size: 15px; font-weight: 700;
}
.flash.loading::before {
    content: ""; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.28); border-top-color: var(--brand);
    animation: flash-spin 0.7s linear infinite;
}
@keyframes flash-spin { to { transform: rotate(360deg); } }

/* ==================== 结果区 ==================== */
.result {
    margin-top: 24px; background: #fff; border: 1px solid var(--line);
    border-radius: 16px; padding: 20px;
}
.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.result-head h2 { margin: 0; font-size: 18px; }
.result-note { margin: 0; font-size: 12px; color: var(--muted); }
.result-grid { display: flex; justify-content: center; }
.result-card { margin: 0; width: 100%; max-width: 360px; border: 1px solid var(--line); border-radius: 12px; padding: 14px; text-align: center; }
.result-card figcaption { font-size: 14px; font-weight: 600; color: #4a5568; margin-bottom: 10px; }
.result-img {
    background: repeating-conic-gradient(#f0f2f7 0% 25%, #fff 0% 50%) 50% / 16px 16px;
    border-radius: 8px; min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.result-img img { max-width: 100%; max-height: 320px; display: block; }
.btn-download {
    display: inline-block; margin-top: 12px; padding: 10px 20px; border-radius: 8px;
    background: var(--brand); color: #fff; text-decoration: none; font-size: 14px; font-weight: 600;
}
.btn-download:hover { background: var(--brand-2); }

/* ==================== 通用区块 ==================== */
.section-head { text-align: center; margin-bottom: 24px; }
.section-tag {
    display: inline-block; padding: 4px 12px; border-radius: 999px;
    background: #eef1ff; color: var(--brand); font-size: 12px; font-weight: 600; margin-bottom: 10px;
}
.section-title { margin: 0 0 8px; font-size: 22px; }
.section-copy { margin: 0; color: var(--muted); font-size: 14px; }

.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.info-card {
    background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px;
}
.info-index { display: block; font-size: 20px; font-weight: 800; color: #c3cbe4; margin-bottom: 6px; }
.info-card h3 { margin: 0 0 8px; font-size: 16px; }
.info-card p { margin: 0; font-size: 14px; color: var(--muted); }

.free-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; }
.free-card p { margin: 0 0 10px; color: #4a5568; font-size: 14px; line-height: 1.9; }
.free-card p:last-child { margin-bottom: 0; }
.free-card strong { color: var(--ink); }
.free-card .free-note { margin-top: 2px; color: var(--muted); font-size: 13px; }

.faq-list { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.faq-item summary { cursor: pointer; font-weight: 600; font-size: 15px; }
.faq-item p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* ==================== 页脚 ==================== */
.footer { margin-top: 32px; padding: 28px 0; background: #fff; border-top: 1px solid var(--line); }
.footer-inner { text-align: center; }
.footer-copy { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.simple-footer-links { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; }
.simple-footer-links a { color: #4a5568; text-decoration: none; font-size: 14px; }
.simple-footer-links a:hover { color: var(--brand); }
.footer-feedback { text-align: center; margin-top: 16px; }
.footer-feedback a { color: #4a5568; text-decoration: none; }
.footer-feedback a:hover { color: var(--brand); }
.footer-contact { margin-top: 14px; }
.footer-contact a { color: #4a5568; text-decoration: none; font-size: 14px; }
.footer-contact a:hover { color: var(--brand); }

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .tool-shell { grid-template-columns: 1fr; }
    .drop-zone { min-height: 200px; }
    .card-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 22px; }
    .topbar-inner { flex-wrap: wrap; }
}
@media (max-width: 520px) {
    .brand-subtitle { display: none; }
    .nav { gap: 10px; }
    .nav a { font-size: 13px; }
}
