/* 这个文件包含对Tailwind CSS的自定义补充样式 */

/* 
 * 注意：大部分基础样式已经在Tailwind组件中定义
 * 这个文件只包含Tailwind难以实现的特殊效果
 */

:root {
    /* 颜色系统 - 仅用于特殊效果，基础颜色已在Tailwind配置中定义 */
    --primary-color: #4f46e5; /* Indigo-600 */
    --primary-light: #6366f1; /* Indigo-500 */
    --primary-dark: #4338ca; /* Indigo-700 */
    --success-color: #10b981; /* Emerald-500 */
    --warning-color: #f59e0b; /* Amber-500 */
    --danger-color: #ef4444; /* Red-500 */
}

/* 背景样式 - 复杂渐变效果 */
body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f0f4ff 0%, #f9fafb 50%, #f0fdfa 100%);
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0.02) 25%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(16, 185, 129, 0.06) 0%, rgba(16, 185, 129, 0.01) 30%, transparent 55%),
        radial-gradient(circle at 70% 80%, rgba(245, 158, 11, 0.05) 0%, rgba(245, 158, 11, 0.01) 35%, transparent 60%);
    z-index: -1;
    pointer-events: none;
    opacity: 0.8;
}

.dark-theme body {
    background: linear-gradient(135deg, #111827 0%, #1e293b 50%, #0f172a 100%);
}

.dark-theme body::before {
    background-image: 
        radial-gradient(circle at 20% 20%, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0.03) 30%, transparent 60%),
        radial-gradient(circle at 80% 30%, rgba(6, 182, 212, 0.06) 0%, rgba(6, 182, 212, 0.02) 35%, transparent 65%),
        radial-gradient(circle at 70% 80%, rgba(124, 58, 237, 0.07) 0%, rgba(124, 58, 237, 0.02) 40%, transparent 70%);
    opacity: 0.7;
}

/* 暗色主题变量 - 仅用于特殊效果 */
.dark-theme {
    --primary-color: #6366f1; /* Indigo-500 */
    --primary-light: #818cf8; /* Indigo-400 */
    --primary-dark: #4338ca; /* Indigo-700 */
}

/* 隐藏滚动条但保持功能 */
.hide-scrollbar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 文本渐变效果 */
.text-gradient {
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: modalFadeIn 0.3s forwards;
}

/* 模态框动画 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.dark-theme .modal-content {
    background: rgba(31, 41, 55, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.5);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s;
}

.close-modal:hover {
    color: var(--danger-color);
    background-color: rgba(239, 68, 68, 0.1);
}

/* 响应式调整 - 移动设备特殊处理 */
@media (max-width: 767px) {
    .test-modes-container {
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .test-mode-card {
        scroll-snap-align: start;
        flex: 0 0 auto;
        min-width: 200px;
        padding: 0.4rem 0.6rem;
    }
    
    .mode-icon {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .mode-info h3 {
        font-size: 0.75rem;
    }
    
    .mode-info p {
        font-size: 0.65rem;
    }
}

/* 通用玻璃面板效果 - Tailwind无法直接实现的效果 */
.glass-panel {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.dark-theme .glass-panel {
    background: rgba(31, 41, 55, 0.7);
    border-color: rgba(55, 65, 81, 0.5);
}

/* 头部样式 - 特殊渐变和效果 */
header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(229, 231, 235, 0.5);
}

.dark-theme header {
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.95) 0%, rgba(17, 24, 39, 0.95) 100%);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(55, 65, 81, 0.5);
}

/* 导航菜单样式 - 特殊交互效果 */
.nav-menu {
    display: flex;
    align-items: center;
    margin-left: 2rem; /* 恢复桌面端的左边距 */
    flex: 1;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-menu li {
    position: relative;
}

.nav-menu a {
    color: var(--tw-text-secondary, #374151);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--tw-primary-600, #4f46e5);
    transition: width 0.15s;
}

.nav-menu a:hover {
    color: var(--tw-primary-600, #4f46e5);
}

.nav-menu a:hover::after {
    width: 100%;
}

.nav-menu a.active {
    color: var(--tw-primary-600, #4f46e5);
}

.nav-menu a.active::after {
    width: 100%;
}

/* 测试模式卡片样式 - 特殊交互和布局 */
.test-modes-container {
    display: flex;
    overflow-x: auto;
    gap: 0.75rem;
    scrollbar-width: thin;
    scroll-behavior: smooth;
    margin-bottom: 0.7rem;
    margin-top: 0;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
}

.test-mode-card {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    width: auto;
    min-width: 0;
    background-color: white;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    color: #111827;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid rgba(229, 231, 235, 0.5);
    text-align: center;
    justify-content: flex-start;
}

.dark-theme .test-mode-card {
    background-color: #1f2937;
    color: #f9fafb;
    border-color: rgba(55, 65, 81, 0.5);
}

.test-mode-card:hover {
    color: #4f46e5;
    border-color: #4f46e5;
}

.test-mode-card.active {
    border-color: #4f46e5;
    color: #4f46e5;
}

.mode-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    background-color: #f9fafb;
    margin-right: 0.5rem;
    font-size: 1rem;
    color: #4f46e5;
}

.dark-theme .mode-icon {
    background-color: #1f2937;
}

.mode-info {
    flex-grow: 0;
    text-align: left;
}

.mode-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.2rem 0;
    color: #111827;
}

.dark-theme .mode-info h3 {
    color: #f9fafb;
}

.mode-info p {
    font-size: 0.7rem;
    margin: 0;
    color: #374151;
    line-height: 1.2;
}

.dark-theme .mode-info p {
    color: #e5e7eb;
}

/* 主题切换按钮 */
.theme-toggle {
    cursor: pointer;
    font-size: 1rem;
    color: #6b7280;
    transition: all 0.15s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background-color: transparent;
}

.theme-toggle:hover {
    color: #4f46e5;
    background-color: rgba(79, 70, 229, 0.05);
}

/* 卡片样式 - 玻璃效果 */
.card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 8px;
    border: 1px solid rgba(229, 231, 235, 0.5);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.dark-theme .card {
    background: rgba(31, 41, 55, 0.7);
    border: 1px solid rgba(55, 65, 81, 0.5);
}

/* 游戏手柄可视化样式 */
.gamepad-visualization {
    position: relative;
    width: 100%;
    height: 100%;
}

.gamepad-button {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    color: #4b5563;
    transition: all 0.15s ease;
}

.gamepad-button.pressed {
    background-color: #4f46e5;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 8px rgba(79, 70, 229, 0.5);
}

.gamepad-stick {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.gamepad-stick-indicator {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #6366f1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.05s ease;
}

.dark-theme .gamepad-button {
    background-color: #374151;
    color: #d1d5db;
}

.dark-theme .gamepad-stick {
    background-color: #1f2937;
    border-color: #374151;
}

/* 响应式样式 */
@media (max-width: 767px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        margin-left: 0; /* 移动端视图下移除左边距 */
        background: #ffffff; /* 使用纯色白色背景，不透明 */
        padding: 1rem;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        z-index: 99;
        border-bottom: 1px solid rgba(229, 231, 235, 0.5);
    }
    
    .dark-theme .nav-menu {
        background: #111827; /* 暗色模式使用纯色深色背景，不透明 */
        border-bottom: 1px solid rgba(55, 65, 81, 0.5);
    }
    
    .nav-menu.active {
        display: block;
    }
    
    .nav-menu ul {
        flex-direction: column;
    }
    
    /* 移动菜单按钮样式 */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background-color: transparent;
        cursor: pointer;
        color: #6b7280;
        transition: all 0.15s;
        border: 1px solid transparent;
    }
    
    .mobile-menu-btn:hover {
        color: #4f46e5;
        background-color: rgba(79, 70, 229, 0.05);
        border-color: rgba(79, 70, 229, 0.1);
    }
    
    /* 移动端模式卡片样式 */
    .test-modes-container {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .test-mode-card {
        scroll-snap-align: start;
        flex: 0 0 auto;
        min-width: 200px;
        padding: 0.4rem 0.6rem;
    }
    
    .mode-icon {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .mode-info h3 {
        font-size: 0.75rem;
    }
    
    .mode-info p {
        font-size: 0.65rem;
    }
}

.dark-theme {
    /* 暗色主题颜色 */
    --text-primary: #f9fafb; /* Gray-50 */
    --text-secondary: #e5e7eb; /* Gray-200 */
    --text-tertiary: #9ca3af; /* Gray-400 */
    --text-quaternary: #6b7280; /* Gray-500 */
    --bg-light: #1f2937; /* Gray-800 */
    --bg-color: #111827; /* Gray-900 */
    --bg-color-rgb: 17, 24, 39;
    --bg-dark: #111827; /* Gray-900 */
    --bg-secondary: #374151; /* Gray-700 */
    --bg-tertiary: #374151; /* Gray-700 */
    --bg-quaternary: #4b5563; /* Gray-600 */
    --card-bg: #1f2937; /* Gray-800 */
    --border-color: #374151; /* Gray-700 */
    --border-light: #1f2937; /* Gray-800 */
}

#gamepad-buttons::-webkit-scrollbar {
    width: 6px;
}

#gamepad-buttons::-webkit-scrollbar-track {
    background: transparent;
}

#gamepad-buttons::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

#gamepad-buttons::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.7);
}

.dark #gamepad-buttons::-webkit-scrollbar-thumb {
    background-color: rgba(75, 85, 99, 0.5);
}

.dark #gamepad-buttons::-webkit-scrollbar-thumb:hover {
    background-color: rgba(75, 85, 99, 0.7);
}

/* 测试日志项样式 */
.log-item {
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.log-item:hover {
    background-color: rgba(243, 244, 246, 0.8);
}

.dark-theme .log-item:hover {
    background-color: rgba(31, 41, 55, 0.6);
}

html {
    scroll-behavior: smooth;
} 