/* ===== 证件照换底色与规格处理 - 专属 CSS 样式 (Premium UX Redesign) ===== */

.image-idphoto-page {
    background-color: var(--page-bg, #f8fafc);
}

/* 下拉选择框 垂直居中对齐修正 (Fix select text vertical alignment) */
.image-idphoto-page select.form-control,
.id-modal-sidebar select.form-control {
    height: 38px !important;
    padding: 6px 32px 6px 12px !important;
    font-size: 13px !important;
    line-height: 24px !important;
    vertical-align: middle !important;
    box-sizing: border-box !important;
    border-radius: 8px !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-weight: 500 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml;utf8,<svg fill='%2364748b' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>") !important;
    background-repeat: no-repeat !important;
    background-position: right 8px center !important;
    transition: all 0.2s ease !important;
}

.image-idphoto-page select.form-control:focus,
.id-modal-sidebar select.form-control:focus {
    border-color: #2563eb !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

/* 示例照片体验按钮 */
.btn-demo-photo {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: #ffffff !important;
    border: none;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}
.btn-demo-photo:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* 核心工作区与卡片布局增强 */
.tool-workspace-card {
    background: #ffffff;
    border: 1px solid var(--border-main, #e2e8f0);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px -4px rgba(15, 23, 42, 0.05);
    margin-bottom: 24px;
    transition: all 0.2s ease;
}

/* 底色选择块 Grid */
.id-color-selector {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.id-color-pill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.id-color-pill:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.08);
}

.id-color-pill.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.id-color-dot-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.id-color-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.id-color-dot.grad-blue {
    background: linear-gradient(180deg, #4a90e2 0%, #1b56b5 100%);
}
.id-color-dot.grad-red {
    background: linear-gradient(180deg, #ff6b6b 0%, #c0392b 100%);
}

.id-pill-check {
    font-size: 12px;
    color: #2563eb;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.id-color-pill.is-active .id-pill-check {
    opacity: 1;
}

/* 规格尺寸卡片 Selector */
.id-spec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.id-spec-card {
    padding: 14px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.id-spec-card:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(59, 130, 246, 0.1);
}

.id-spec-card.is-active {
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25), 0 4px 12px rgba(37, 99, 235, 0.1);
}

.id-spec-card .spec-name {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    display: block;
    margin-bottom: 4px;
}

.id-spec-card.is-active .spec-name {
    color: #1d4ed8;
}

.id-spec-card .spec-dim {
    font-size: 12px;
    color: #64748b;
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.id-spec-card .spec-tag {
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 3px 9px;
    border-radius: 6px;
    display: inline-block;
    line-height: 1.3;
}

.id-spec-card.is-active .spec-tag {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
    font-weight: 600;
}

/* 自定义尺寸输入组 */
.id-custom-dim-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    background: #f8fafc;
    border-radius: 10px;
    border: 1px dashed #cbd5e1;
}

/* 网格图片卡片区 */
.id-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.id-image-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.id-image-card:hover {
    border-color: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
}

.id-image-card .card-idx-badge {
    position: absolute;
    top: 18px;
    left: 18px;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 6px;
    z-index: 2;
}

.id-image-card .card-thumb-wrap {
    width: 100%;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8fafc;
    background-image: 
        linear-gradient(45deg, #e2e8f0 25%, transparent 25%), 
        linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #e2e8f0 75%), 
        linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
    cursor: pointer;
    border: 1px solid #e2e8f0;
}

.id-image-card .card-thumb-wrap canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.id-image-card .card-thumb-wrap .card-hover-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.id-image-card .card-thumb-wrap:hover .card-hover-overlay {
    opacity: 1;
}

.id-image-card .card-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 4px;
}

.id-image-card .card-filename {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 170px;
}

.id-image-card .card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 10px;
}

.id-image-card .card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

/* 弹窗编辑器 (Modal Editor) */
.id-modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.id-modal-dialog {
    background: #ffffff;
    border-radius: 16px;
    width: 100%;
    max-width: 1080px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.id-modal-header {
    padding: 16px 24px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.id-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 8px;
}

.id-modal-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.id-modal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

@media (max-width: 768px) {
    .id-modal-body {
        flex-direction: column;
        overflow-y: auto;
    }
}

.id-modal-canvas-container {
    flex: 1;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 20px;
    overflow: hidden;
    user-select: none;
}

.id-modal-canvas-stage {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1e293b;
    background-image: 
        linear-gradient(45deg, #334155 25%, transparent 25%), 
        linear-gradient(-45deg, #334155 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #334155 75%), 
        linear-gradient(-45deg, transparent 75%, #334155 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #475569;
}

.id-modal-canvas-stage canvas {
    max-width: 100%;
    max-height: 60vh;
    display: block;
}

/* 人像对齐辅助线 */
.id-guide-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    display: none;
}

.id-guide-overlay.is-active {
    display: block;
}

.id-guide-line-eye {
    position: absolute;
    top: 35%;
    left: 0;
    right: 0;
    height: 1px;
    border-top: 1px dashed rgba(255, 255, 255, 0.6);
}

.id-guide-line-center {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    border-left: 1px dashed rgba(255, 255, 255, 0.6);
}

.id-guide-line-top {
    position: absolute;
    top: 12%;
    left: 0;
    right: 0;
    height: 1px;
    border-top: 1px dashed rgba(239, 68, 68, 0.7);
}

.id-modal-canvas-info {
    position: absolute;
    bottom: 12px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #94a3b8;
    font-size: 12px;
    background: rgba(15, 23, 42, 0.8);
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.id-pipette-toast {
    position: absolute;
    top: 20px;
    background: #ef4444;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: 30px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
    z-index: 10;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* 右侧参数面板 */
.id-modal-sidebar {
    width: 360px;
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (max-width: 768px) {
    .id-modal-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #e2e8f0;
    }
}

.sidebar-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 14px;
}

.sidebar-card-header {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.id-color-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.id-color-picker {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    background: none;
}

.id-hex-input {
    flex: 1;
    height: 36px;
    font-family: monospace;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
}

.id-pipette-btn {
    height: 36px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.id-pipette-btn:hover {
    border-color: #2563eb;
    color: #2563eb;
    background: #eff6ff;
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #475569;
    margin-bottom: 4px;
}

.slider-val-badge {
    font-weight: 700;
    color: #2563eb;
}

.id-modal-footer {
    padding: 14px 24px;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 常用规格对照表 Table Styling */
.id-specs-table-wrap {
    overflow-x: auto;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    margin-top: 14px;
}

.id-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.id-specs-table th {
    background: #f1f5f9;
    color: #334155;
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.id-specs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #475569;
}

.id-specs-table tr:hover td {
    background: #f8fafc;
}

.id-specs-table .bg-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}

.id-specs-table .bg-badge.blue { background: #dbeafe; color: #1e40af; }
.id-specs-table .bg-badge.white { background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1; }
.id-specs-table .bg-badge.red { background: #fee2e2; color: #991b1b; }

/* 拍摄指导卡片 Grid */
.id-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.id-guide-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.id-guide-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #eff6ff;
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.id-guide-content h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.id-guide-content p {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
}
