/* 车牌输入组件样式 */

/* 车牌输入框 */
.plate-input-container {
    width: 100%;
}

.plate-input-box {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
    color: #1B3A6B;
    background: #F8FBFF;
    cursor: pointer;
    user-select: none;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, background .2s;
}

.plate-input-box:hover {
    border-color: #CBD5E1;
    background: #F0F9FF;
}

.plate-input-box.filled {
    border-color: #16A34A;
    background: #F0FFF4;
}

@keyframes plateFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.04); }
    100% { transform: scale(1); }
}

/* 拍照识别按钮 */
.btn-ocr {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 99px;
    border: none;
    background: linear-gradient(135deg, #0EA5E9, #38BDF8);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(14,165,233,.4);
    transition: all .2s;
}

.btn-ocr:active {
    transform: scale(.95);
}

.btn-ocr input {
    display: none;
}

/* 车牌键盘弹窗 */
.plate-kb-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.5);
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.plate-kb-overlay.show {
    display: flex;
}

.plate-kb-box {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 20px 20px 0 0;
    padding: 16px 12px calc(16px + env(safe-area-inset-bottom));
    animation: slideUp .3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.plate-kb-title {
    font-size: 14px;
    font-weight: 700;
    color: #1E293B;
    text-align: center;
    margin-bottom: 12px;
}

/* 显示区域 */
.plate-kb-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
    min-height: 48px;
}

.plate-kb-cell {
    min-width: 34px;
    height: 44px;
    border: 2px solid #CBD5E1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    color: #1B3A6B;
    background: #F8FBFF;
    transition: all .2s;
    flex-shrink: 0;
}

.plate-kb-cell.active-cell {
    border-color: #3B82F6;
    background: #EBF3FB;
    box-shadow: 0 0 0 3px rgba(59,130,246,.2);
    animation: cellPulse .4s ease;
}

@keyframes cellPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.plate-kb-cell.filled {
    border-color: #86EFAC;
    background: #F0FFF4;
}

/* 步骤提示 */
.plate-kb-step {
    font-size: 12px;
    color: #64748B;
    text-align: center;
    margin-bottom: 10px;
    padding: 6px 10px;
    background: #F8FAFC;
    border-radius: 8px;
}

.plate-kb-step b {
    color: #2563EB;
}

/* 键盘容器 - 固定高度避免跳动 */
.kb-container {
    min-height: 210px;
    position: relative;
    transition: all 0.3s ease;
}

/* 省份键盘 */
.prov-kb {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
    animation: fadeIn 0.2s ease;
    min-height: 150px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.prov-btn {
    flex: 0 0 calc(10% - 5px);
    min-width: 30px;
    padding: 10px 0;
    border-radius: 7px;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
}

.prov-btn:active {
    background: #DBEAFE;
    border-color: #93C5FD;
    transform: scale(.94);
}

/* 字母数字键盘 */
.alphanum-kb {
    display: flex;
    flex-direction: column;
    gap: 5px;
    animation: fadeIn 0.2s ease;
    min-height: 160px;
}

.alphanum-row {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.alphanum-btn {
    flex: 1;
    max-width: 36px;
    padding: 10px 0;
    border-radius: 6px;
    border: 1.5px solid #E2E8F0;
    background: #F8FAFC;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
}

.alphanum-btn:active {
    background: #DBEAFE;
    border-color: #93C5FD;
    transform: scale(.94);
}

/* 操作按钮 */
.plate-kb-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #E2E8F0;
}

.plate-kb-cancel,
.plate-kb-del,
.plate-kb-ok {
    flex: 1;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    border: none;
}

.plate-kb-cancel {
    background: #F1F5F9;
    color: #64748B;
}

.plate-kb-cancel:active {
    background: #E2E8F0;
    transform: scale(.96);
}

.plate-kb-del {
    background: #FEF2F2;
    color: #DC2626;
}

.plate-kb-del:active {
    background: #FEE2E2;
    transform: scale(.96);
}

.plate-kb-ok {
    background: #1B3A6B;
    color: #fff;
}

.plate-kb-ok:active {
    background: #2563B0;
    transform: scale(.97);
}

/* 历史记录按钮 */
.history-plate-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}

.history-plate-btn:active {
    background: #DBEAFE;
    border-color: #93C5FD;
}

/* OCR 遮罩 */
.ocr-overlay {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.8);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 20px;
    animation: fadeIn .3s ease;
}

.ocr-stages {
    display: flex;
    gap: 12px;
}

.ocr-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,.4);
    font-size: 12px;
}

.ocr-stage.done {
    color: #86EFAC;
}

.s-icon {
    font-size: 28px;
}

.ocr-progress {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    overflow: hidden;
}

.ocr-progress-fill {
    height: 100%;
    width: 0%;
    background: #86EFAC;
    transition: width .3s ease;
}

/* 车牌确认弹窗 */
.plate-confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,.5);
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .2s ease;
}

.plate-confirm-overlay.show {
    display: flex;
}

.plate-confirm-box {
    background: #fff;
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 20px;
    animation: scaleIn .3s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pc-title {
    font-size: 16px;
    font-weight: 700;
    color: #1E293B;
    text-align: center;
    margin-bottom: 8px;
}

.pc-sub {
    font-size: 13px;
    color: #64748B;
    text-align: center;
    margin-bottom: 12px;
}

.pc-thumb {
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 12px;
    background: #F8FAFC;
}

.pc-plate-display {
    font-size: 28px;
    font-weight: 800;
    color: #1B3A6B;
    text-align: center;
    letter-spacing: 4px;
    margin-bottom: 12px;
    padding: 12px;
    background: #F8FBFF;
    border-radius: 10px;
}

.btn-pc-retry,
.btn-pc-ok {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s;
    border: none;
}

.btn-pc-retry {
    background: #F1F5F9;
    color: #64748B;
}

.btn-pc-retry:active {
    background: #E2E8F0;
}

.btn-pc-ok {
    background: #1B3A6B;
    color: #fff;
}

.btn-pc-ok:active {
    background: #2563B0;
}
