/* --- 全局样式 --- */
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    overflow-x: hidden;
    transition: background-color 0.15s ease-out;
    user-select: none;
}

body {
    background-color: #1a1a1a;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    box-sizing: border-box;
}

/* 内容容器 */
#content-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 页面主标题 */
h1 {
    margin: 10px 0;
    font-weight: 300;
    letter-spacing: 1px;
    text-align: center;
}

/* 引导性内容样式 */
.intro-section {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    border-left: 5px solid #4CAF50;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    width: 100%;
    box-sizing: border-box;
}

.intro-section p {
    font-size: 1.1em;
    line-height: 1.6;
    color: #e0e0e0;
    margin-bottom: 20px;
}

.intro-section strong {
    color: #4CAF50;
    font-weight: 600;
}

.keyboard-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.keyboard-type-tag {
    display: inline-block;
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
    padding: 8px 16px;
    margin: 5px;
    border-radius: 25px;
    font-size: 0.9em;
    font-weight: 500;
    border: 1px solid rgba(76, 175, 80, 0.3);
    transition: all 0.3s ease;
}

.keyboard-type-tag:hover {
    background: rgba(76, 175, 80, 0.25);
    transform: translateY(-2px);
}

/* 屏幕测试容器 */
.screen-test-container {
    width: 100%;
    max-width: 800px;
    margin: 30px 0;
    background: rgba(30, 30, 30, 0.95);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid #444;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

#ui-layer h2 {
    margin: 0 0 15px 0;
    font-weight: 300;
    letter-spacing: 1px;
    color: #ffffff;
}

.test-description {
    color: #aaa;
    margin-bottom: 30px;
    font-size: 1.1em;
    line-height: 1.6;
}

.test-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.btn-start {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    padding: 15px 40px;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.4);
    transition: transform 0.1s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-start:active {
    transform: scale(0.96);
}

.quick-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-color {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 80px;
}

.btn-color:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.test-info {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.test-info p {
    margin: 0;
    color: #ddd;
    font-size: 0.9em;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.test-info i {
    margin-right: 5px;
    color: #4da6ff;
}

/* --- 醒目的提示层 --- */
#large-hint {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 30px 50px;
    border-radius: 12px;
    text-align: center;
    pointer-events: none;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

#large-hint .main-text {
    display: block;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

#large-hint .sub-text {
    display: block;
    font-size: 16px;
    color: #ddd;
}

#large-hint .key {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: monospace;
    margin: 0 3px;
}

.hint-visible {
    opacity: 1 !important;
}

/* 全屏检测模式下的样式 */
body.testing-mode {
    cursor: none;
    padding: 0 !important;
    overflow: hidden;
}

body.testing-mode.mouse-moving {
    cursor: default;
}

/* 全屏时隐藏所有内容面板 */
body.testing-mode #content-container {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

body.testing-mode .screen-test-container {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

/* 相关工具样式 */
.related-tools {
    width: 100%;
    margin: 50px 0 30px;
    padding: 35px;
    background: linear-gradient(135deg, #1a1a1a 0%, #252525 100%);
    border-radius: 15px;
    border: 1px solid #333;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

.related-tools h2 {
    color: #fff;
    font-size: 1.8em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-tools h2 i {
    color: #4CAF50;
    font-size: 1.2em;
}

.related-tools > p {
    color: #aaa;
    font-size: 1.05em;
    margin-bottom: 25px;
    max-width: 800px;
}

.related-tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.related-tool-card {
    background: #2a2a2a;
    padding: 25px;
    border-radius: 10px;
    text-decoration: none;
    color: #ddd;
    transition: all 0.3s ease;
    display: block;
    border: 1px solid #333;
    position: relative;
    overflow: hidden;
}

.related-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4CAF50, #2196F3);
}

.related-tool-card:hover {
    transform: translateY(-8px);
    background: #303030;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    border-color: #444;
}

.related-tool-card i {
    font-size: 2.5em;
    color: #4CAF50;
    margin-bottom: 15px;
    display: block;
}

.related-tool-card h3 {
    color: #fff;
    font-size: 1.3em;
    margin-bottom: 10px;
    font-weight: 600;
}

.related-tool-card p {
    color: #aaa;
    font-size: 0.95em;
    line-height: 1.5;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .intro-section {
        padding: 20px;
    }
    
    .keyboard-types {
        justify-content: center;
    }
    
    .keyboard-type-tag {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .screen-test-container {
        padding: 25px 20px;
        margin: 20px 0;
    }
    
    .btn-start {
        font-size: 18px;
        padding: 12px 30px;
    }
    
    .quick-buttons {
        flex-wrap: wrap;
    }
    
    .btn-color {
        padding: 8px 15px;
        min-width: 70px;
        font-size: 0.9em;
    }
    
    .test-info p {
        flex-direction: column;
        gap: 5px;
    }
    
    .related-tools {
        padding: 25px 20px;
        margin: 40px 0 20px;
    }
    
    .related-tools-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .related-tool-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .intro-section {
        padding: 15px;
    }
    
    .keyboard-type-tag {
        padding: 5px 10px;
        font-size: 0.8em;
    }
    
    .screen-test-container {
        padding: 20px 15px;
    }
    
    .btn-start {
        font-size: 16px;
        padding: 10px 25px;
    }
    
    .btn-color {
        padding: 6px 12px;
        min-width: 60px;
        font-size: 0.85em;
    }
    
    .test-info p {
        font-size: 0.85em;
    }
    
    #large-hint {
        padding: 20px 30px;
    }
    
    #large-hint .main-text {
        font-size: 20px;
    }
    
    #large-hint .sub-text {
        font-size: 14px;
    }
    
    .related-tools {
        padding: 20px 15px;
    }
}

/* --- 语言切换器在全屏模式下的隐藏 --- */
body.testing-mode .language-switcher {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
    pointer-events: none;
}