/* public/css/style.css */

/* --- 默认样式 (桌面优先) --- */

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #eef2f9; 
    padding: 1rem;
    box-sizing: border-box;
}

#app-wrapper {
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* 【结构优化】将左侧所有控件包裹起来 */
#side-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem; /* 统一侧边栏项目间距 */
    align-items: center;
}

#game-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    text-align: center;
    width: 600px;
    min-height: 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#question-title {
    margin-top: 0;
    color: #333;
}

#question-text {
    font-size: 1.2rem;
    font-style: italic;
    margin: 1rem 0 2rem 0;
    color: #555;
    line-height: 1.6;
    min-height: 50px;
}

#options-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

button {
    padding: 1rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

button:hover:not(:disabled) {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

#feedback {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 1.5rem;
    height: 2rem;
    transition: color 0.3s;
}

button.correct { background-color: #d4edda; border-color: #c3e6cb; color: #155724; }
button.incorrect { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; }

#difficulty-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.difficulty-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    width: 90px;
}

.difficulty-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
    font-weight: bold;
}

#streak-container {
    margin-top: 0; /* 移除顶部边距，由side-panel的gap控制 */
    color: #6c757d;
    font-size: 0.9rem;
    background-color: #f8f9fa;
    padding: 0.3rem 0.4rem;
    border-radius: 20px;
    width: 100px;
    text-align: center;
}

#streak-counter {
    font-weight: bold;
    font-size: 1.1rem;
    color: #28a745;
    margin-left: 0.5rem;
}

/* ▼▼▼▼▼▼▼▼▼▼ 新增语言切换器样式 ▼▼▼▼▼▼▼▼▼▼ */
#language-selector {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
 /*    width: 100%;     */
}

.lang-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    width: 90px;
    border-radius: 15px;
    border: 1px solid #ddd;
    background-color: #fff;
}

.lang-btn.active {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
    font-weight: bold;
}
/* ▲▲▲▲▲▲▲▲▲▲ 新增结束 ▲▲▲▲▲▲▲▲▲▲ */


/* --- 响应式设计 --- */
@media (max-width: 768px) {
    
    #app-wrapper {
        flex-direction: column;
        gap: 1.5rem;
    }

    #side-panel {
        flex-direction: row; /* 在手机上，让侧边栏变为水平 */
        order: -1;
        width: 100%;
        justify-content: center;
    }

    #difficulty-selector, #language-selector {
        flex-direction: row; /* 难度和语言按钮组也变为水平 */
        gap: 0.5rem;
    }

    .difficulty-btn, .lang-btn {
        width: auto; /* 自动宽度 */
    }

    #streak-container {
        width: auto;
    }

    #game-container {
        width: 90vw;
        min-width: 0;
        padding: 1.5rem;
    }

    #options-container {
        grid-template-columns: 1fr;
    }

    #question-text {
        font-size: 1.1rem;
    }

    button {
        padding: 0.8rem;
        font-size: 0.9rem;
    }
}
