/* ==========================================================================
   证件照生成工具 id_photo.css — 复刻腾讯帮小忙证件照工具风格
   主蓝 #136ce9 · 页面背景 #f6f7fa · 工具容器 1140px 圆角 10px
   三端断点：>=992 两栏 / 768-991 两栏窄 / <768 单栏
   ========================================================================== */

/* ---------- 页面骨架 ---------- */
.ip-page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    color: #242424;
}

.ip-hero { text-align: center; margin-bottom: 22px; }
.ip-title { font-size: 28px; font-weight: 700; margin: 0 0 10px; color: #242424; }
.ip-sub { font-size: 14px; color: #8f8f8f; line-height: 1.8; max-width: 720px; margin: 0 auto; }

/* ---------- 工具容器 ---------- */
.ip-tool {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    padding: 24px;
}

/* ---------- 步骤指示器 ---------- */
.ip-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 26px;
    flex-wrap: wrap;
}
.ip-step {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #aaa;
    font-size: 13px;
    user-select: none;
}
.ip-step-num {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: #e8e8fd;
    color: #8f8f8f;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex: none;
}
.ip-step.is-active { color: #136ce9; font-weight: 600; }
.ip-step.is-active .ip-step-num { background: #136ce9; color: #fff; }
.ip-step.is-done { color: #136ce9; }
.ip-step.is-done .ip-step-num { background: #136ce9; color: #fff; }
.ip-step-line { width: 34px; height: 2px; background: #e2e2e2; border-radius: 1px; }

/* ---------- 通用按钮 ---------- */
.ip-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    padding: 10px 30px;
    line-height: 1;
    transition: all .15s ease;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
}
.ip-btn-primary { background: #136ce9; color: #fff; }
.ip-btn-primary:hover { background: #0f5fd0; }
.ip-btn-primary:active { background: #0b53b6; transform: scale(.98); }
.ip-btn-ghost {
    background: #fff;
    color: #136ce9;
    border: 1px solid #136ce9;
}
.ip-btn-ghost:hover { background: #f0f6ff; }
.ip-btn-ghost:active { transform: scale(.98); }
.ip-btn:disabled { opacity: .5; cursor: not-allowed; }

.ip-panel-footer {
    margin-top: 22px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* ---------- Step1 规格选择 ---------- */
.ip-tabs {
    display: flex;
    gap: 6px;
    border-bottom: 2px solid #f0f1f5;
    padding-bottom: 12px;
    margin-bottom: 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.ip-tab {
    border: none;
    background: none;
    cursor: pointer;
    padding: 8px 18px;
    font-size: 15px;
    color: #7b7b7b;
    border-radius: 20px;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
    font-family: inherit;
    transition: all .15s ease;
}
.ip-tab:hover { color: #136ce9; background: #f0f6ff; }
.ip-tab.is-active { color: #fff; background: #136ce9; font-weight: 500; }

.ip-size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    max-height: 420px;
    overflow-y: auto;
    padding: 4px;
    -webkit-overflow-scrolling: touch;
}
.ip-size-item {
    border: 2px solid #eee;
    border-radius: 8px;
    background: #fff;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}
.ip-size-item:hover { border-color: #9ec1f5; background: #f7faff; }
.ip-size-item.is-active {
    border-color: #136ce9;
    background: #f0f6ff;
    box-shadow: 0 2px 10px rgba(19, 108, 233, .12);
}
.ip-size-name { font-size: 14px; font-weight: 600; color: #242424; margin-bottom: 4px; }
.ip-size-meta { font-size: 12px; color: #8f8f8f; }

/* ---------- Step2 上传区 ---------- */
.ip-upload {
    display: block;
    cursor: pointer;
    border: 2px dashed #e2e2e2;
    border-radius: 24px;
    background: #fafbfc;
    padding: 0;
    transition: border-color .2s ease, background .2s ease;
    overflow: hidden;
}
.ip-upload:hover { border-color: #9ec1f5; }
.ip-upload.is-dragging { border-color: #136ce9; background: #f0f6ff; }
.ip-upload-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 48px 20px;
    text-align: center;
}
.ip-upload-icon { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 34px; }
.ip-upload-text { font-size: 17px; font-weight: 600; color: #242424; }
.ip-upload-sub { font-size: 13px; color: #8f8f8f; line-height: 1.7; max-width: 420px; }
.ip-upload-btn { margin-top: 8px; min-height: 42px; padding: 10px 32px; }
.ip-camera-btn { min-height: 40px; }
.ip-upload-tip { font-size: 12px; color: #aaa; line-height: 1.6; padding: 12px 20px; background: #f7f8fa; }

/* ---------- Step3 编辑区（两栏） ---------- */
.ip-edit-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}
.ip-preview {
    flex: 0 0 46%;
    max-width: 46%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
.ip-preview-wrap {
    width: 100%;
    position: relative;
    background: #f6f7fa;
    border-radius: 10px;
    border: 1px solid #eee;
    overflow: hidden;
    aspect-ratio: 3 / 4;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ip-preview-wrap canvas {
    max-width: 100%;
    max-height: 100%;
    display: block;
}
.ip-preview-size { font-size: 13px; color: #8f8f8f; }

.ip-ops {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.ip-ops-info { padding-bottom: 14px; border-bottom: 1px solid #f0f1f5; }
.ip-ops-name { font-size: 18px; font-weight: 700; color: #242424; }
.ip-ops-meta { font-size: 13px; color: #8f8f8f; margin-top: 3px; }

.ip-ops-row { display: flex; flex-direction: column; gap: 8px; }
.ip-ops-label { font-size: 14px; font-weight: 500; color: #242424; }
.ip-ops-colors { display: flex; gap: 10px; align-items: center; }
.ip-color {
    width: 34px; height: 34px;
    border-radius: 8px;
    border: 2px solid #e2e2e2;
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    -webkit-appearance: none;
    appearance: none;
    transition: all .15s ease;
}
.ip-color:hover { transform: scale(1.06); }
.ip-color.is-active { border-color: #136ce9; box-shadow: 0 0 0 2px rgba(19, 108, 233, .18); }
.ip-color.is-active::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #136ce9;
    background: rgba(255, 255, 255, .35);
    border-radius: 6px;
}
.ip-color-custom {
    overflow: hidden;
    position: relative;
    font-size: 18px;
    color: #7b7b7b;
    background: conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00) !important;
}
.ip-color-custom input { position: absolute; inset: -12px; opacity: 0; cursor: pointer; }
.ip-color-picker {
    background: #f0f6ff !important;
    border-style: dashed;
    color: #136ce9;
    font-size: 16px;
    font-weight: 700;
}
.ip-color-picker.is-picking {
    background: #136ce9 !important;
    color: #fff;
    border-color: #136ce9;
    animation: ip-pulse 1s infinite;
}
@keyframes ip-pulse { 50% { box-shadow: 0 0 0 5px rgba(19, 108, 233, .25); } }

.ip-range {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: #e8e8fd;
    outline: none;
    margin: 4px 0;
}
.ip-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: #136ce9;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    cursor: pointer;
}
.ip-range::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: #136ce9;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    cursor: pointer;
}
.ip-ops-hint { font-size: 12px; color: #aaa; line-height: 1.5; }

.ip-ops-note {
    font-size: 13px;
    color: #136ce9;
    background: #f0f6ff;
    border-radius: 6px;
    padding: 10px 12px;
    line-height: 1.6;
}
.ip-ops-note.is-warn { color: #8e520d; background: #f6eee5; }

.ip-ops-btns {
    display: flex;
    gap: 12px;
    margin-top: 4px;
}
.ip-ops-btns .ip-btn { flex: 1; min-height: 44px; }

/* ---------- Step4 完成 ---------- */
.ip-done { text-align: center; padding: 30px 0 10px; }
.ip-done-icon { font-size: 52px; }
.ip-done-title { font-size: 22px; font-weight: 700; color: #242424; margin: 12px 0 6px; }
.ip-done-sub { font-size: 14px; color: #8f8f8f; }
.ip-done-btns {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 18px 0 10px;
    flex-wrap: wrap;
}

/* ---------- 使用说明 ---------- */
.ip-guide {
    margin-top: 24px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    padding: 22px 26px;
}
.ip-guide h3 { font-size: 16px; color: #242424; margin: 0 0 12px; }
.ip-guide ol { margin: 0; padding-left: 20px; }
.ip-guide li { font-size: 13px; color: #7b7b7b; line-height: 2; }
.ip-guide p { font-size: 13px; color: #aaa; line-height: 1.8; margin: 12px 0 0; }

/* ==================== 平板：768-991px ==================== */
@media (max-width: 991px) {
    .ip-size-grid { grid-template-columns: repeat(3, 1fr); }
    .ip-edit-layout { flex-direction: column; }
    .ip-preview { flex: none; max-width: 100%; width: 100%; }
    .ip-preview-wrap { max-width: 420px; margin: 0 auto; }
    .ip-ops { width: 100%; }
}

/* ==================== 手机：<768px ==================== */
@media (max-width: 767px) {
    .ip-page { padding: 18px 12px 40px; }
    .ip-title { font-size: 22px; }
    .ip-sub { font-size: 13px; }

    .ip-tool { padding: 16px 14px; border-radius: 8px; }

    .ip-steps { gap: 6px; margin-bottom: 18px; }
    .ip-step { font-size: 11px; gap: 4px; }
    .ip-step-num { width: 22px; height: 22px; font-size: 11px; }
    .ip-step-line { width: 16px; }

    .ip-tab { padding: 7px 14px; font-size: 14px; }
    .ip-size-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; max-height: 360px; }
    .ip-size-item { padding: 12px 8px; }
    .ip-size-name { font-size: 13px; }
    .ip-size-meta { font-size: 11px; }

    .ip-upload-inner { padding: 40px 14px; gap: 7px; }
    .ip-upload-icon { width: 46px; height: 46px; font-size: 28px; }
    .ip-upload-text { font-size: 15px; }
    .ip-upload-sub { font-size: 12px; }
    .ip-upload-btn, .ip-camera-btn { width: 100%; min-height: 44px; max-width: 300px; }

    .ip-edit-layout { gap: 16px; }
    .ip-preview-wrap { max-width: 100%; }
    .ip-ops-name { font-size: 16px; }

    .ip-ops-row { gap: 7px; }
    .ip-ops-colors { flex-wrap: wrap; }
    .ip-color { width: 38px; height: 38px; }
    .ip-ops-btns { flex-direction: column; }
    .ip-ops-btns .ip-btn { width: 100%; }

    .ip-done-btns { flex-direction: column; }
    .ip-done-btns .ip-btn { width: 100%; }

    .ip-guide { padding: 18px 16px; }
    .ip-guide li { font-size: 12px; line-height: 1.9; }
}
