/* ============================================================
   头像生成器 avatars — 样式自包含（av- 前缀，不与其它工具冲突）
   设计语言与全站一致：白卡、#eff2f8 底、品牌蓝 #4f6ef7、无渐变
   工具本体保持浅色纸张（不随暗色外壳变化）
   ============================================================ */

.av-wrap { max-width: 920px; margin: 0 auto; }

/* ---------- 卡片 ---------- */
.av-card {
    background: #fff; border: 1px solid var(--z-line, #e2e8f0);
    border-radius: 14px; padding: 18px; margin-bottom: 14px;
}
.av-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 700; color: #0f172a; margin-bottom: 14px;
}
.av-card-title .svg-icon { color: #4f6ef7; }

/* ---------- 预览区 ---------- */
.av-preview-zone {
    display: flex; align-items: center; justify-content: center;
    background:
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%),
        linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%);
    background-size: 20px 20px; background-position: 0 0, 10px 10px;
    border: 1px solid var(--z-line, #e2e8f0); border-radius: 12px;
    min-height: 240px; padding: 20px; margin-bottom: 14px;
}
.av-preview-zone > svg, .av-preview-zone > img {
    width: 200px; height: 200px; display: block;
    background: #fff; border-radius: 10px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
    animation: av-pop .18s ease;
}
@keyframes av-pop { from { opacity: .4; transform: scale(.96); } to { opacity: 1; transform: none; } }

.av-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.av-actions .av-btn { flex: 1 1 auto; min-width: 0; }

/* ---------- Seed 行 ---------- */
.av-seed-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.av-seed-row label { font-size: 13px; font-weight: 600; color: #334155; flex-shrink: 0; }
.av-seed-row input {
    flex: 1; min-width: 140px; height: 38px; padding: 0 12px;
    border: 1px solid var(--z-line, #e2e8f0); border-radius: 9px;
    font-size: 13.5px; color: #0f172a; background: #fff; outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.av-seed-row input:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79, 110, 247, .14); }
.av-seed-hint { font-size: 12px; color: #94a3b8; }

/* ---------- 按钮 ---------- */
.av-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 38px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
    font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background .18s, color .18s, border-color .18s, transform .12s;
    white-space: nowrap;
}
.av-btn:active { transform: scale(.96); }
.av-btn-primary { background: #4f6ef7; color: #fff; }
.av-btn-primary:hover { background: #3d5ce0; }
.av-btn-ghost { background: #f1f5f9; color: #334155; }
.av-btn-ghost:hover { background: #e2e8f0; }
.av-btn-outline { background: #fff; color: #4f6ef7; border-color: #c7d2fe; }
.av-btn-outline:hover { background: #eef2ff; }
.av-btn:disabled { opacity: .55; cursor: not-allowed; }
.av-btn .svg-icon { font-size: 16px; }

/* ---------- 风格网格 ---------- */
.av-styles {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: 8px;
}
.av-style {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    padding: 9px 4px 7px; border: 1.5px solid var(--z-line, #e2e8f0);
    border-radius: 11px; background: #fff; cursor: pointer;
    transition: border-color .15s, background .15s, transform .12s;
}
.av-style:hover { border-color: #a5b4fc; background: #f8faff; transform: translateY(-1px); }
.av-style.active { border-color: #4f6ef7; background: #eef2ff; }
.av-style .av-thumb { width: 44px; height: 44px; border-radius: 8px; background: #f1f5f9; overflow: hidden; }
.av-style .av-thumb svg, .av-style .av-thumb img { width: 100%; height: 100%; display: block; }
.av-style .av-style-name {
    font-size: 11px; color: #475569; text-align: center; line-height: 1.25;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.av-style.active .av-style-name { color: #4f6ef7; font-weight: 700; }

/* ---------- 参数表单 ---------- */
.av-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.av-field label {
    display: block; font-size: 12.5px; font-weight: 600; color: #334155; margin-bottom: 6px;
}
.av-field .av-sub { font-weight: 400; color: #94a3b8; margin-left: 4px; }
.av-field input[type="number"], .av-field select, .av-field input[type="text"] {
    width: 100%; height: 38px; padding: 0 10px;
    border: 1px solid var(--z-line, #e2e8f0); border-radius: 9px;
    font-size: 13px; color: #0f172a; background: #fff; outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.av-field input:focus, .av-field select:focus { border-color: #4f6ef7; box-shadow: 0 0 0 3px rgba(79, 110, 247, .14); }
.av-field input[type="range"] { width: 100%; accent-color: #4f6ef7; margin: 8px 0 2px; }
.av-field input[type="color"] {
    width: 38px; height: 38px; padding: 2px; border: 1px solid var(--z-line, #e2e8f0);
    border-radius: 9px; background: #fff; cursor: pointer; flex-shrink: 0;
}
.av-range-row { display: flex; align-items: center; gap: 8px; }
.av-range-val {
    min-width: 44px; text-align: center; font-size: 12px; font-weight: 700;
    color: #4f6ef7; background: #eef2ff; border-radius: 6px; padding: 3px 0;
    font-variant-numeric: tabular-nums;
}
.av-color-row { display: flex; align-items: center; gap: 8px; }
.av-color-row input[type="text"] { flex: 1; min-width: 0; }

.av-checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 2px; }
.av-check {
    display: inline-flex; align-items: center; gap: 7px;
    font-size: 13px; color: #334155; cursor: pointer; user-select: none;
}
.av-check input { width: 16px; height: 16px; accent-color: #4f6ef7; cursor: pointer; }

.av-bg-seg { display: flex; gap: 0; border: 1px solid var(--z-line, #e2e8f0); border-radius: 9px; overflow: hidden; width: fit-content; }
.av-bg-seg button {
    height: 38px; padding: 0 14px; border: none; background: #fff;
    font-size: 12.5px; font-weight: 600; color: #64748b; cursor: pointer;
    border-right: 1px solid var(--z-line, #e2e8f0);
    transition: background .15s, color .15s;
}
.av-bg-seg button:last-child { border-right: none; }
.av-bg-seg button.active { background: #4f6ef7; color: #fff; }

/* ---------- Toast ---------- */
.av-toast {
    position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(8px);
    background: #0f172a; color: #fff; font-size: 13px; font-weight: 600;
    padding: 9px 18px; border-radius: 10px; z-index: 9999;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
    max-width: 80vw; text-align: center;
}
.av-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 说明 ---------- */
.av-note { font-size: 12.5px; color: #64748b; line-height: 1.8; }
.av-note b { color: #334155; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
    .av-card { padding: 14px; border-radius: 12px; }
    .av-styles { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
    .av-grid { grid-template-columns: 1fr; }
    .av-preview-zone { min-height: 200px; padding: 14px; }
    .av-preview-zone > svg, .av-preview-zone > img { width: 160px; height: 160px; }
    .av-actions .av-btn { flex: 1 1 44%; padding: 0 8px; }
}
