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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
}

/* 游戏头部样式 */
.game-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.game-header h1 {
    font-size: 2.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.back-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 游戏介绍页面样式 */
.intro-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.intro-content {
    flex: 1;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-intro {
    max-width: 800px;
    width: 100%;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.intro-text h2 {
    color: #ff6b6b;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-align: center;
}

.intro-text h3 {
    color: #667eea;
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
    text-align: left;
}

.intro-text p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    text-align: left;
    color: #555;
}

.intro-text ul {
    text-align: left;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.intro-text li {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #666;
}

.player-status {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
}

.player-status h3 {
    color: white !important;
    text-align: center;
    margin-bottom: 1.5rem;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.status-item {
    background: rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-label {
    font-weight: 600;
}

.status-value {
    font-weight: 700;
    font-size: 1.1rem;
}

/* 警告框样式 */
.warning-box {
    background: linear-gradient(135deg, #ff9a56 0%, #ff6b6b 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 2rem 0;
    border-left: 5px solid #ff4757;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.warning-box h4 {
    color: white !important;
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    text-align: left;
}

.warning-box p {
    color: white !important;
    font-size: 1rem;
    margin-bottom: 0;
    text-align: left;
    font-weight: 500;
}

.warning-text {
    color: #ff4757;
    font-weight: 700;
    background: rgba(255, 71, 87, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 71, 87, 0.3);
}

.start-game-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.start-game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.start-game-btn:active {
    transform: translateY(-1px);
}

/* 游戏进行页面样式 */
.game-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.game-main {
    flex: 1;
    padding: 2rem;
    display: flex;
    flex-direction: column;
}

.game-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 游戏消息区域 */
.game-messages {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    max-height: 600px;
    background: #f8f9fa;
}

.game-message {
    margin-bottom: 2rem;
    animation: fadeInUp 0.3s ease-out;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.message-header strong {
    font-size: 1.1rem;
    font-weight: 600;
}

.message-time {
    font-size: 0.8rem;
    color: #666;
}

.message-content {
    padding: 1.5rem;
    border-radius: 15px;
    line-height: 1.6;
    font-size: 1rem;
    max-width: 90%;
    word-wrap: break-word;
}

.player-message .message-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

.ai-message .message-content {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    color: #333;
    margin-right: auto;
    border-bottom-left-radius: 5px;
    border: 2px solid #ff6b6b;
}

.ai-message.error .message-content {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
}

/* 加载和错误消息样式 */
.loading-message {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 2rem;
    background: #ffe6e6;
    border: 2px solid #ff6b6b;
    border-radius: 10px;
    margin: 1rem;
}

.error-message button {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
}

/* 错误消息样式 */
.error {
    background-color: rgba(255, 0, 0, 0.1);
    border-left: 3px solid #ff0000;
}

/* 加载状态样式 */
.loading {
    opacity: 0.7;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 输入区域样式 */
.input-container {
    padding: 2rem;
    background: white;
    border-top: 2px solid #e9ecef;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

#playerInput {
    flex: 1;
    padding: 1.2rem;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

#playerInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#playerInput:disabled {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.6;
}

.submit-button {
    padding: 1.2rem 2.5rem;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    height: 80px;
}

.submit-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

.submit-button:active {
    transform: translateY(0);
}

.submit-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 底部样式 */
footer {
    background: #f8f9fa;
    padding: 1rem;
    text-align: center;
    color: #666;
    border-top: 1px solid #e9ecef;
    font-size: 0.9rem;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .game-header {
        padding: 1.5rem 1rem;
    }
    
    .game-header h1 {
        font-size: 2.2rem;
    }
    
    .intro-content, .game-main {
        padding: 1rem;
    }
    
    .game-intro {
        padding: 2rem;
    }
    
    .intro-text h2 {
        font-size: 1.8rem;
    }
    
    .status-grid {
        grid-template-columns: 1fr;
    }
    
    .message-content {
        max-width: 95%;
        padding: 1.2rem;
    }
    
    .input-container {
        padding: 1.5rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .submit-button {
        width: 100%;
        min-width: auto;
        height: 60px;
    }
    
    #playerInput {
        min-height: 60px;
    }
    
    .back-btn {
        position: static;
        margin-top: 1rem;
    }
}

@media (max-width: 480px) {
    .game-header h1 {
        font-size: 1.8rem;
    }
    
    .game-intro {
        padding: 1.5rem;
    }
    
    .intro-text h2 {
        font-size: 1.5rem;
    }
    
    .intro-text h3 {
        font-size: 1.2rem;
    }
    
    .game-messages {
        max-height: 400px;
        padding: 1rem;
    }
    
    .start-game-btn {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
}

/* 滚动条样式 */
.game-messages::-webkit-scrollbar {
    width: 8px;
}

.game-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.game-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.game-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}