/* 自定义样式 */

/* 键盘按键样式 */
.key {
    transition: all 0.1s ease;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 1.25rem;
    border: 1px solid #444;
}

.key.active {
    background-color: #06b6d4 !important;
    color: #000;
    transform: translateY(2px);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.5);
}

/* 反馈信息样式 */
#feedback {
    transition: all 0.3s ease;
    border-left: 4px solid #444;
}

#feedback.success {
    border-left-color: #22c55e;
    color: #22c55e;
}

#feedback.warning {
    border-left-color: #f59e0b;
    color: #f59e0b;
}

#feedback.error {
    border-left-color: #ef4444;
    color: #ef4444;
}

#feedback.info {
    border-left-color: #3b82f6;
    color: #3b82f6;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* 图表样式 */
canvas {
    max-width: 100%;
}

/* 模态框动画 */
#report-modal, #principles-modal {
    transition: opacity 0.3s ease;
}

#report-modal.hidden, #principles-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .key {
        width: 14vw;
        height: 14vw;
        max-width: 64px;
        max-height: 64px;
    }
    
    .keyboard-container {
        margin-bottom: 20px;
    }
}

/* 按钮动画 */
button {
    transition: all 0.2s ease;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 历史记录项样式 */
.history-item {
    padding: 8px;
    border-bottom: 1px solid #374151;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item.success {
    color: #22c55e;
}

.history-item.warning {
    color: #f59e0b;
}

.history-item.error {
    color: #ef4444;
}

/* 仪表盘数值动画 */
#stop-error, #reaction-percentage {
    transition: all 0.5s ease;
}

/* 背景网格效果 */
body {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
}

/* 卡片阴影 */
.bg-gray-800 {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 输入框焦点样式 */
input:focus, select:focus {
    outline: none;
    border-color: #06b6d4 !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}