/* 蓝色主题CSS变量 */
:root {
    --primary-color: #1890FF;
    --primary-light: #40A9FF;
    --primary-dark: #096DD9;
    --secondary-color: #F0F8FF;
    --accent-color: #52C41A;
    --warning-color: #FA8C16;
    --error-color: #FF4D4F;
    --text-primary: #262626;
    --text-secondary: #8C8C8C;
    --text-light: #BFBFBF;
    --background-color: #F0F8FF;
    --background-gradient: linear-gradient(135deg, #F0F8FF 0%, #E6F7FF 100%);
    --card-background: #FFFFFF;
    --card-hover: #FAFAFA;
    --border-color: #D9D9D9;
    --border-light: #F0F0F0;
    --shadow-light: 0 2px 8px rgba(24, 144, 255, 0.1);
    --shadow-medium: 0 4px 16px rgba(24, 144, 255, 0.15);
    --shadow-hover: 0 8px 24px rgba(24, 144, 255, 0.2);
    --border-radius: 8px;
    --border-radius-large: 12px;
    --border-radius-xl: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-primary);
    line-height: 1.6;
}

/* 主容器 */
#app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    position: relative;
}

/* 页面通用样式 */
.page {
    display: none;
    background: var(--card-background);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    padding: 40px;
    min-height: 600px;
}

.page.active {
    display: block;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.page-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* 游戏标题 */
.game-title {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 1px;
}

.game-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
    text-align: center;
    font-weight: 400;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #096DD9;
    transform: translateY(-1px);
    box-shadow: var(--shadow-medium);
}

.btn-primary:disabled {
    background-color: #D9D9D9;
    color: #BFBFBF;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background-color: white;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-light);
}

/* 角色徽章 */
.role-badge {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 12px;
}

/* 游戏规则文本 */
.game-rules {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

.instruction-text {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .page {
        padding: 30px;
    }
    
    .game-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 768px) {
    #app {
        padding: 10px;
    }
    
    .page {
        padding: 20px;
        min-height: auto;
    }
    
    .page-header {
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
        margin-bottom: 30px;
    }
    
    .game-title {
        font-size: 2rem;
        text-align: center;
        width: 100%;
    }
    
    .game-subtitle {
        font-size: 1rem;
        text-align: center;
        width: 100%;
    }
    
    .current-role-info {
        text-align: center;
        width: 100%;
    }
    
    .page-actions {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .game-title {
        font-size: 1.8rem;
    }
    
    .game-subtitle {
        font-size: 0.9rem;
    }
    
    .page {
        padding: 15px;
    }
    
    .page-header {
        margin-bottom: 20px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px; /* 确保触摸友好 */
    }
    
    .role-badge {
        font-size: 11px;
        padding: 3px 10px;
    }
}

@media (max-width: 360px) {
    .game-title {
        font-size: 1.6rem;
    }
    
    .page {
        padding: 12px;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* 模态框通用样式 */
.modal {
    display: none; /* 默认隐藏 */
    position: fixed;
    z-index: 1000; /* 确保在最上层 */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* 允许滚动 */
    background-color: rgba(0, 0, 0, 0.4); /* 半透明背景 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.active {
    display: flex; /* 显示模态框 */
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--card-background);
    margin: auto; /* 自动边距，配合flex实现居中 */
    padding: 30px;
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-medium);
    width: 90%;
    max-width: 500px;
    position: relative;
    transform: translateY(-20px); /* 初始位置稍微向上 */
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0); /* 激活时回到原位 */
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.modal-close {
    color: var(--text-secondary);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--error-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-body {
    padding: 10px 0;
    text-align: center;
}

.completion-message {
    margin-bottom: 25px;
}

.completion-message p {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.completion-message span {
    font-weight: 600;
    color: var(--primary-color);
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

/* 警告颜色 */
.modal-header .modal-title {
    color: var(--warning-color); /* 恭喜您答对啦！ */
}

.completion-message p {
    color: var(--text-primary);
}

.completion-message span {
    color: var(--error-color); /* 分数和时间用警告色 */
}

/* 邮件内容中的钓鱼特征 */
.phishing-feature {
    cursor: pointer;
    font-weight: inherit;
    transition: none;
    padding: 2px 4px;
    border-radius: 4px;
    display: inline-block;
    color: inherit;
    background: none;
    border: none;
}

.phishing-feature:hover {
    background: none;
}

.phishing-feature.identified {
    background-color: var(--accent-color);
    color: white;
}

.phishing-feature.just-identified {
    animation: pulse 0.5s ease-out;
}

/* Fixed bottom button for email modal */
.fixed-bottom-btn {
    position: fixed;
    bottom: 20px; /* Adjust as needed */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001; /* Ensure it's above the modal content */
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 25px; /* Rounded corners */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.fixed-bottom-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}