/**
 * 身份证上传组件样式
 * 用于实名认证的身份证照片上传和预览
 */

.id-card-upload {
    margin-top: 10px;
}

.id-card-preview {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.id-front, .id-back {
    flex: 1;
    height: 120px;
    border: 2px dashed #ddd;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.id-front:hover, .id-back:hover {
    border-color: #007bff;
    background-color: #f8f9fa;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #666;
    text-align: center;
    padding: 10px;
}

.upload-placeholder i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #999;
}

.upload-placeholder p {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 500;
}

.upload-text {
    font-size: 12px;
    color: #999;
}

/* 预览图片样式 */
.id-front img, .id-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 6px;
}

.id-front img:hover, .id-back img:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* 预览图片重新上传提示 */
.id-front::after, .id-back::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    white-space: nowrap;
}

.id-front.has-image:hover::after, .id-back.has-image:hover::after {
    content: '点击重新上传';
    opacity: 1;
}

.id-card-tip {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.id-card-tip p {
    margin: 0 0 5px 0;
}

.id-card-tip p:last-child {
    margin-bottom: 0;
}

/* OCR处理状态 */
.id-front.processing, .id-back.processing {
    border-color: #007bff;
    background-color: #e7f3ff;
}

.ocr-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10;
}

.ocr-loading i {
    margin-right: 5px;
}

/* 自动填写状态 */
.form-group input.auto-filled {
    background-color: #e8f5e8;
    border-color: #28a745;
}

.form-group input.auto-filled:focus {
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.15);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .id-card-preview {
        flex-direction: column;
        gap: 10px;
    }
    
    .id-front, .id-back {
        height: 100px;
    }
    
    .upload-placeholder i {
        font-size: 20px;
        margin-bottom: 5px;
    }
    
    .upload-placeholder p {
        font-size: 13px;
    }
    
    .upload-text {
        font-size: 11px;
    }
}

/* 图片预览样式 */
.id-front img, .id-back img {
    border-radius: 6px;
}

/* 上传成功状态 */
.id-front.uploaded, .id-back.uploaded {
    border-color: #28a745;
    border-style: solid;
}

.id-front.uploaded:hover, .id-back.uploaded:hover {
    border-color: #1e7e34;
}

/* 上传失败状态 */
.id-front.error, .id-back.error {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.id-front.error:hover, .id-back.error:hover {
    border-color: #bd2130;
}

/* 身份证日期信息区域样式 */
.main-label {
    display: block;
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
    font-weight: 600;
}

.id-date-group {
    display: flex;
    gap: 20px;
    margin-top: 0;
}

.date-field {
    flex: 1;
    min-width: 0; /* 防止flex项目溢出 */
}

.field-label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 500;
}

.date-field input[type="text"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.date-field input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.expiry-wrapper {
    position: relative;
}

.long-term-option {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-size: 13px;
}

.long-term-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.long-term-option label {
    color: #666;
    cursor: pointer;
    user-select: none;
    margin: 0;
    font-weight: normal;
}

/* 长期选中时的样式 */
.long-term-option input[type="checkbox"]:checked + label {
    color: #007bff;
    font-weight: 500;
}

/* 当选择长期时，禁用有效期输入框 */
#id-expiry-date:disabled {
    background-color: #f8f9fa;
    color: #999;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .id-date-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .id-date-group {
        flex-direction: column;
        gap: 15px;
    }
    
    .long-term-option {
        margin-top: 6px;
    }
} 