/* ===== 证件照换底色与规格处理 - 专属 CSS 样式 (基于全局主题变量系统) ===== */

.image-idphoto-page {
    background-color: var(--page-bg);
}

/* 下拉选择框 垂直居中对齐修正 */
.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 var(--border-main) !important;
    background-color: var(--card-bg) !important;
    color: var(--text-main) !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: var(--brand) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px var(--brand-soft) !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: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    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 var(--border-main);
    border-radius: 10px;
    background: var(--card-bg);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    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: var(--brand);
    background: var(--card-muted-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.id-color-pill.is-active {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    box-shadow: 0 0 0 2px var(--brand-soft);
}

.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: var(--brand);
    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 var(--border-main);
    border-radius: 12px;
    background: var(--card-bg);
    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: var(--brand);
    background: var(--card-muted-bg);
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

.id-spec-card.is-active {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: 0 0 0 2px var(--brand-soft);
}

.id-spec-card .spec-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    display: block;
    margin-bottom: 4px;
}

.id-spec-card.is-active .spec-name {
    color: var(--brand);
}

.id-spec-card .spec-dim {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
}

.id-spec-card .spec-tag {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--card-muted-bg);
    border: 1px solid var(--border-main);
    padding: 3px 9px;
    border-radius: 6px;
    display: inline-block;
    line-height: 1.3;
}

.id-spec-card.is-active .spec-tag {
    color: var(--brand);
    background: var(--brand-soft);
    border-color: var(--brand);
    font-weight: 600;
}

/* 自定义尺寸输入组 */
.id-custom-dim-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    background: var(--panel-muted-bg);
    border-radius: 10px;
    border: 1px dashed var(--border-main);
    color: var(--text-main);
}

/* 网格图片卡片区 */
.id-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 14px;
}

.id-image-card {
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    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: var(--brand);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 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: var(--card-muted-bg);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
    position: relative;
    cursor: pointer;
    border: 1px solid var(--border-main);
}

.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: var(--text-main);
    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: var(--text-muted);
    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: var(--card-bg);
    border: 1px solid var(--border-main);
    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.5);
    overflow: hidden;
}

.id-modal-header {
    padding: 16px 24px;
    background: var(--card-muted-bg);
    border-bottom: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.id-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    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;
    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: var(--card-bg);
    border-left: 1px solid var(--border-main);
    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 var(--border-main);
    }
}

.sidebar-card {
    background: var(--panel-muted-bg);
    border: 1px solid var(--border-main);
    border-radius: 10px;
    padding: 14px;
}

.sidebar-card-header {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    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 var(--border-main);
    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 var(--border-main);
    background: var(--card-bg);
    color: var(--text-main);
}

.id-pipette-btn {
    height: 36px;
    padding: 0 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.id-pipette-btn:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft);
}

.slider-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.slider-val-badge {
    font-weight: 700;
    color: var(--brand);
}

.id-modal-footer {
    padding: 14px 24px;
    background: var(--card-muted-bg);
    border-top: 1px solid var(--border-main);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 常用规格对照表 Table Styling */
.id-specs-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-main);
    border-radius: 12px;
    background: var(--card-bg);
    margin-top: 14px;
}

.id-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.id-specs-table th {
    background: var(--table-th-bg);
    color: var(--table-th-color);
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-main);
}

.id-specs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--table-td-border);
    color: var(--table-td-color);
}

.id-specs-table tr:hover td {
    background: var(--table-tr-hover);
}

.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: var(--badge-blue-bg);
    color: var(--badge-blue-color);
    border: 1px solid var(--badge-blue-border);
}
.id-specs-table .bg-badge.white {
    background: var(--card-muted-bg);
    color: var(--text-main);
    border: 1px solid var(--border-main);
}
.id-specs-table .bg-badge.red {
    background: var(--badge-red-bg);
    color: var(--badge-red-color);
    border: 1px solid var(--badge-red-border);
}

/* 拍摄指导卡片 Grid */
.id-guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.id-guide-card {
    background: var(--card-bg);
    border: 1px solid var(--border-main);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.id-guide-card h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
}

.id-guide-card p {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.id-guide-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--brand-soft);
    color: var(--brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
