/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", Arial, "Source Han Sans CN", sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* 页面切换 */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* 首页样式 */
.game-title {
    font-size: 28px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    color: #333;
}

.game-intro {
    text-align: center;
    margin-bottom: 30px;
    color: #666;
    font-size: 16px;
}

.feedback-mode-selector {
    text-align: center;
    margin-bottom: 30px;
}

.feedback-mode-selector label {
    margin: 0 15px;
    cursor: pointer;
    font-size: 16px;
}

.feedback-mode-selector input[type="radio"] {
    margin-right: 5px;
}

.game-modes {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.mode-btn {
    padding: 15px 30px;
    font-size: 18px;
    background-color: #1677ff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background-color: #4096ff;
    transform: scale(1.05);
}

.mode-btn:active {
    transform: scale(0.95);
}

.rules-info {
    text-align: center;
    margin-top: 30px;
    color: #888;
    font-size: 14px;
}

/* 通用游戏区域样式 */
.game-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    font-size: 16px;
    font-weight: bold;
}

.game-input-area {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.game-input-area input {
    padding: 12px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    width: 200px;
    outline: none;
    transition: border-color 0.3s ease;
}

.game-input-area input:focus {
    border-color: #1677ff;
}

.submit-btn {
    padding: 12px 20px;
    font-size: 16px;
    background-color: #1677ff;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background-color: #4096ff;
}

.action-btn {
    padding: 10px 15px;
    font-size: 14px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background-color: #e0e0e0;
}

.error-message {
    text-align: center;
    color: #ff4d4f;
    margin-bottom: 15px;
    min-height: 20px;
}

.history-area h3,
.history-area h4 {
    margin-bottom: 10px;
    text-align: center;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    background-color: white;
    margin-bottom: 20px;
}

.no-records {
    text-align: center;
    color: #999;
    font-style: italic;
}

.history-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.history-item:last-child {
    border-bottom: none;
}

.result-a {
    color: #52c41a;
    font-weight: bold;
}

.result-b {
    color: #faad14;
    font-weight: bold;
}

.game-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

/* 双人游戏样式 */
.two-player-setup,
.two-player-game {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.player-section {
    flex: 1;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.player-section h3 {
    text-align: center;
    margin-bottom: 15px;
    color: #333;
}

.setup-input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.setup-input-area input {
    padding: 10px;
    font-size: 14px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.setup-input-area button {
    margin-top: 5px;
}

.player-status {
    text-align: center;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.modal-content h3 {
    margin-bottom: 15px;
    color: #333;
}

.modal-content p {
    margin-bottom: 20px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: nowrap;
}

.modal-btn {
    padding: 10px 10px;
    font-size: 16px;
    background-color: #1677ff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-btn:hover {
    background-color: #4096ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .game-title {
        font-size: 24px;
    }
    
    .game-modes {
        flex-direction: column;
        align-items: center;
    }
    
    .game-input-area {
        flex-direction: column;
    }
    
    .game-input-area input {
        width: 100%;
        max-width: 250px;
    }
    
    .two-player-setup,
    .two-player-game {
        flex-direction: column;
    }
    
    .game-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-btn,
    .modal-btn {
        width: 100%;
        max-width: 200px;
    }
}

/* 特殊状态样式 */
.input-disabled {
    background-color: #f5f5f5 !important;
    border-color: #d9d9d9 !important;
    color: #aaa !important;
    cursor: not-allowed !important;
}

.p1-section {
    border-left: 4px solid #1890ff;
}

.p2-section {
    border-left: 4px solid #ff7875;
}
