/* 极简车牌输入组件样式 - 适配移动端 */

:root {
    --lpi-primary: #007bff;
    --lpi-bg: #ffffff;
    --lpi-border: #e0e0e0;
    --lpi-text: #333333;
    --lpi-gray-bg: #f5f7fa;
    --lpi-radius: 8px;
    --lpi-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.license-plate-input-container {
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 触发器按钮 - 模拟输入框 */
.license-plate-trigger {
    width: 100%;
    height: 46px;
    padding: 0 12px;
    background: var(--lpi-bg);
    border: 1px solid var(--lpi-border);
    border-radius: var(--lpi-radius);
    color: #999;
    font-size: 15px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.license-plate-trigger:active {
    border-color: var(--lpi-primary);
}

/* 车牌位显示区域 */
.license-plate-display {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    padding: 4px;
    margin-top: 4px;
}

.license-plate-slot {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--lpi-gray-bg);
    border: 1px solid var(--lpi-border);
    border-radius: 4px;
    font-size: 18px;
    font-weight: 600;
    color: var(--lpi-text);
}

.license-plate-slot.active {
    border-color: var(--lpi-primary);
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.1);
    position: relative;
}

.license-plate-slot.active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--lpi-primary);
    animation: lpi-cursor-blink 1s infinite;
}

@keyframes lpi-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 特殊位置色块提示 (弱化处理) */
.license-plate-slot.province { color: var(--lpi-primary); }
.license-plate-slot.new-energy { border-style: dashed; border-color: #28a745; }

/* 虚拟键盘 - 底部抽屉式 */
.license-plate-keyboard {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ebedf0; /* 类似 iOS 键盘背景色 */
    padding: 8px 6px env(safe-area-inset-bottom);
    z-index: 2000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.keyboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px 10px;
}

.keyboard-title {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.keyboard-done {
    color: var(--lpi-primary);
    font-weight: 600;
    font-size: 15px;
    padding: 4px 8px;
}

.keyboard-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 5px;
}

/* 省份键盘特殊列数 */
.keyboard-province .keyboard-grid {
    grid-template-columns: repeat(9, 1fr);
}

.keyboard-key {
    height: 44px;
    background: #fff;
    border: none;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #333;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
    -webkit-tap-highlight-color: transparent;
}

.keyboard-key:active {
    background: #d1d4d9;
}

/* 功能按键 */
.keyboard-key.action {
    background: #abb2bb;
    color: #fff;
    grid-column: span 1.5;
}

.keyboard-key.delete {
    grid-column: span 1.5;
    background: #abb2bb;
    color: #fff;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .license-plate-keyboard {
        position: absolute;
        width: 360px; /* 固定宽度，不再占满全屏 */
        left: auto;
        bottom: auto;
        background: var(--lpi-bg);
        border: 1px solid var(--lpi-border);
        box-shadow: var(--lpi-shadow);
        border-radius: var(--lpi-radius);
        padding: 12px;
        margin-top: 5px;
        /* 默认隐藏，由 JS 动态计算位置 */
    }

    .keyboard-header {
        padding-top: 0;
    }

    .keyboard-key {
        height: 38px;
        font-size: 15px;
        cursor: pointer;
    }

    .keyboard-key:hover {
        background: #f0f0f0;
        border-color: var(--lpi-primary);
    }
}
