/* 键盘容器 */
.keytest-keyboard-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow-x: auto;
}

.keytest-keyboard-row {
    display: flex;
    gap: 6px;
    margin-bottom: 6px;
    justify-content: center;
}

.keytest-key {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px 8px;
    min-width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.keytest-key:hover {
    border-color: #2196F3;
    transform: translateY(-1px);
}

.keytest-key.active {
    background: #2196F3;
    color: white;
    border-color: #1976D2;
    transform: translateY(2px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.keytest-key.wide {
    min-width: 80px;
}

.keytest-key.wider {
    min-width: 100px;
}

.keytest-key.space {
    min-width: 320px;
}

.keytest-key.backspace {
    min-width: 90px;
}

.keytest-key.tab {
    min-width: 75px;
}

.keytest-key.caps {
    min-width: 90px;
}

.keytest-key.enter {
    min-width: 105px;
}

.keytest-key.shift-left {
    min-width: 115px;
}

.keytest-key.shift-right {
    min-width: 135px;
}

.keytest-key.ctrl {
    min-width: 65px;
}

.keytest-key.alt {
    min-width: 55px;
}

.keytest-key.fn {
    min-width: 50px;
}

.keytest-key-count {
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 10px;
    color: #999;
}

.keytest-key.active .keytest-key-count {
    color: rgba(255, 255, 255, 0.8);
}

/* 方向键布局 */
.keytest-arrow-keys-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 15px;
}

.keytest-arrow-row {
    display: flex;
    gap: 6px;
}

.keytest-arrow-row.top {
    margin-bottom: 6px;
}

.keytest-arrow-spacer {
    width: 54px;
}

/* 按键信息显示 */
.keytest-key-info-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.keytest-key-info-box h3 {
    color: #2196F3;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keytest-key-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.keytest-info-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid #2196F3;
}

.keytest-info-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.keytest-info-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
}

/* 统计信息 */
.keytest-stats-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.keytest-stats-box h3 {
    color: #2196F3;
    font-size: 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.keytest-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.keytest-stat-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.keytest-stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #2196F3;
}

.keytest-stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
}

/* 提示消息 */
.keytest-toast {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    z-index: 9999;
    animation: keytest-slideIn 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.keytest-toast.success {
    background: #4CAF50;
}

.keytest-toast.error {
    background: #f44336;
}

.keytest-toast.info {
    background: #2196F3;
}

.keytest-toast.warning {
    background: #FF9800;
}

@keyframes keytest-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .keytest-key {
        min-width: 40px;
        height: 40px;
        font-size: 11px;
        padding: 8px 4px;
    }

    .keytest-key.space {
        min-width: 200px;
    }

    .keytest-key.backspace,
    .keytest-key.caps,
    .keytest-key.enter,
    .keytest-key.shift-left,
    .keytest-key.shift-right {
        min-width: 60px;
    }
}

@media (max-width: 768px) {
    .keytest-key-info-grid {
        grid-template-columns: 1fr;
    }

    .keytest-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .keytest-keyboard-container {
        padding: 10px;
    }

    .keytest-key {
        min-width: 32px;
        height: 36px;
        font-size: 10px;
        padding: 6px 3px;
    }

    .keytest-key.space {
        min-width: 150px;
    }

    .keytest-key.backspace,
    .keytest-key.caps,
    .keytest-key.enter,
    .keytest-key.shift-left,
    .keytest-key.shift-right {
        min-width: 50px;
    }
}

@media (max-width: 480px) {
    .keytest-key {
        min-width: 28px;
        height: 32px;
        font-size: 9px;
        padding: 4px 2px;
    }

    .keytest-key.space {
        min-width: 100px;
    }

    .keytest-key-count {
        font-size: 8px;
    }
}