/* MetLife 安全意识测试答题系统 - 统一样式表 */
:root {
    --primary-color: #009688;
    --primary-light: #e0f2f1;
    --primary-dark: #00796b;
    --secondary-color: #0277bd;
    --secondary-light: #e1f5fe;
    --secondary-dark: #01579b;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --gray-color: #78909c;
    --text-color: #37474f;
    --bg-color: #f5f5f5;
    
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.16);
    
    --transition-fast: 200ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* 基础样式 */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}

html, body { 
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body { 
    font-family: 'Noto Sans SC', 'Source Han Sans CN', sans-serif; 
    background: linear-gradient(135deg, #e0f7fa, #80cbc4); 
    color: var(--text-color); 
    min-height: 100vh; 
    line-height: 1.6; 
    display: flex;
    flex-direction: column;
}

/* 布局容器 */
.page-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: var(--spacing-md);
    
    align-items: center; /* 确保内容居中 */
    margin-top: -30px; /* 额外向上移动30px */
}

.container { 
    max-width: 900px; 
    margin: 0 auto; 
   
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center; /* 容器内容居中 */
}

.admin-container {
    max-width: 1200px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

/* 标题和文本 */
h1, h2, h3, h4, h5, h6 { 
    color: var(--primary-color); 
    margin-bottom: var(--spacing-sm);
    text-align: center; /* 标题居中 */
    width: 100%;
}

h1 { 
    font-size: 1.8rem; 
}

/* Logo 容器 */
.logo-container {
    padding: var(--spacing-sm) 0; /* 减少上下间距 */
    width: 100%;
    text-align: center; /* 默认居中（移动端） */
}

.logo-container img {
    height: 35px;
}

/* 移动端logo居中，PC端logo左对齐 */
@media (min-width: 768px) {
    .logo-container {
        text-align: left;
        padding-left: var(--spacing-md);
    }
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: var(--spacing-md);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid #eceff1;
}

.card-title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.card-content {
    padding: var(--spacing-md);
}

/* 表单样式 */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all var(--transition-fast);
    font-family: 'Noto Sans SC', 'Source Han Sans CN', sans-serif;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    outline: none;
}

/* 下拉框样式 */
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all var(--transition-fast);
    font-family: 'Noto Sans SC', 'Source Han Sans CN', sans-serif;
    background-color: white;
    appearance: none; /* 移除默认的下拉箭头 */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23009688' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-group select:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    outline: none;
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

/* 按钮样式 */
button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 25px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: 'Noto Sans SC', 'Source Han Sans CN', sans-serif;
    position: relative;
    overflow: hidden;
}

button:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

button:active {
    transform: translateY(0);
}

button.btn-disabled {
    background-color: var(--gray-color);
    cursor: not-allowed;
}

/* 按钮容器 */
.btn-container { 
    text-align: center; 
    margin: 20px 0;
    width: 100%; /* 确保按钮容器占满宽度 */
    display: flex;
    justify-content: center; /* 按钮居中 */
    gap: 10px; /* 按钮之间的间距 */
    align-items: center; /* 垂直居中 */
}

/* 返回按钮 */
.return-btn {
    background-color: var(--gray-color); /* 使用灰色区分返回按钮 */
    padding: 12px 25px; /* 确保与其他按钮大小一致 */
    font-size: 1rem;
    font-weight: 600;
    min-width: 100px; /* 确保最小宽度与其他按钮一致 */
}

/* 第一题的按钮容器，确保返回按钮在左侧，下一题按钮在右侧 */
.first-question-btns {
    justify-content: space-between;
    padding: 0 var(--spacing-md);
}

/* 登录按钮容器 */
.login-btn-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: var(--spacing-md);
    align-items: center;
}

/* 脉动动画按钮在卡片中居中 */
.card-content .animate-pulse {
    margin: 0 auto;
    display: block;
}

/* 验证码容器 */
.captcha-container {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center; /* 确保内容居中 */
    width: 100%;
    margin-bottom: var(--spacing-sm);
    flex-direction: row; /* 确保横向排列 */
    flex-wrap: nowrap; /* 防止换行 */
}

.captcha-code {
    background-color: #f5f5f5;
    padding: 10px 15px;
    border-radius: var(--radius-md);
    font-weight: bold;
    letter-spacing: 3px;
    font-size: 1.2rem;
    color: var(--primary-dark);
    min-width: 100px;
    text-align: center;
    user-select: none;
}

.refresh-btn {
    background-color: var(--gray-color);
    padding: 8px 12px; /* 减小按钮尺寸 */
    font-size: 0.8rem; /* 减小字体大小 */
    height: auto; /* 确保高度自适应 */
    min-width: auto; /* 确保宽度自适应 */
    display: inline-flex; /* 使按钮内容居中对齐 */
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* 防止文字换行 */
    letter-spacing: normal; /* 正常字间距 */
}

.refresh-btn:hover {
    background-color: #546e7a;
}

/* 答题容器 */
.quiz-container { 
    background: white; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-md); 
    overflow: hidden; 
    margin-bottom: var(--spacing-md); 
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%; /* 确保宽度占满容器 */
    max-width: 800px; /* 限制最大宽度 */
}

.quiz-container:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.question-container { 
    padding: var(--spacing-md); 
    border-bottom: 1px solid #eceff1;
    text-align: center; /* 问题容器内容居中 */
}

.question-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
    justify-content: flex-start; /* 问题标题左对齐 */
    text-align: left; /* 问题文本左对齐 */
    width: 100%; /* 确保宽度占满容器 */
   
}

.question-number {
    background-color: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 0.85rem;
    margin-top: 2px;
}

.question {
    font-weight: 600;
    font-size: 1rem;
}

.options { 
    display: grid; 
    gap: 10px; 
}

.option { 
    padding: 12px; 
    border: 2px solid #eceff1; 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    transition: all var(--transition-fast); 
    display: flex; 
    align-items: center; 
    position: relative;
    overflow: hidden;
    text-align: left; /* 选项文字左对齐 */
}

.option:hover { 
    background-color: #f5f5f5; 
}

.option.selected { 
    background-color: var(--primary-light); 
    border-color: var(--primary-color); 
}

.option-label { 
    margin-right: 12px; 
    font-weight: bold; 
    min-width: 22px; 
    height: 22px; 
    background-color: #eceff1; 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.8rem; 
}

.option.selected .option-label { 
    background-color: var(--primary-color); 
    color: white; 
}

/* 单选题和多选题指示器样式 */
.radio-indicator, .checkbox-indicator {
    position: absolute;
    right: 15px;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    transition: all var(--transition-fast);
}

.radio-indicator {
    border-radius: 50%;
}

.checkbox-indicator {
    border-radius: 4px;
}

.option.selected .radio-indicator {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.option.selected .checkbox-indicator {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

/* 选中状态的内部圆点和勾选标记 */
.option.selected .radio-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: white;
}

.option.selected .checkbox-indicator::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* 得分和进度显示区域 */
.score-progress-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: var(--spacing-sm);
    padding: 10px 15px;
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.current-score, .answered-count {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-color);
}

.score-value {
    font-weight: bold;
    color: var(--primary-color);
    margin: 0 3px;
    font-size: 1.1rem;
}

/* 进度条样式 */
.progress-container {
    width: 100%;
    background-color: #e0e0e0;
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    height: 6px;
    overflow: hidden;
}

.progress-bar {
    height: 6px;
    background-color: var(--primary-color);
    border-radius: var(--radius-sm);
    transition: width var(--transition-normal) ease;
}

.progress-text {
    text-align: center;
    margin-bottom: var(--spacing-sm);
    font-size: 0.85rem;
    color: var(--gray-color);
}

/* 答案反馈样式 */
.answer-feedback {
    margin-top: 15px;
    padding: 10px;
    border-radius: var(--radius-md);
    background-color: #f5f5f5;
    transition: all var(--transition-normal);
}

.feedback-correct, .feedback-incorrect {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
}

.feedback-correct {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.feedback-incorrect {
    background-color: #ffebee;
    color: #c62828;
}

.feedback-correct svg, .feedback-incorrect svg {
    margin-right: 8px;
}

.correct-answer {
    font-weight: bold;
    margin-left: 5px;
}

/* 结果容器 */
.result-container { 
    background: white; 
    border-radius: var(--radius-lg); /* 添加圆角 */
    padding: var(--spacing-md); 
    box-shadow: var(--shadow-md); 
    text-align: center; 
    margin-bottom: var(--spacing-md); 
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    width: 100%; /* 确保宽度占满容器 */
    max-width: 800px; /* 限制最大宽度 */
    overflow: hidden; /* 确保内容不会溢出圆角 */
}

/* 结果详情样式 */
.result-details {
    margin: 20px 0;
    width: 100%;
}

.result-summary {
    display: flex;
    justify-content: space-around;
    margin: 15px 0;
    flex-wrap: wrap;
}

.result-summary-item {
    padding: 15px;
    min-width: 100px;
    text-align: center;
    background-color: var(--primary-light);
    border-radius: var(--radius-md);
    margin: 5px;
    flex: 1;
}

.summary-label {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 5px;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.result-container:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.result-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.result-score { 
    font-size: 3rem; 
    font-weight: bold; 
    margin-bottom: var(--spacing-sm); 
    color: var(--primary-color); 
}

.points-info { 
    margin-top: var(--spacing-sm); 
    padding: 12px; 
    background-color: var(--primary-light); 
    border-radius: var(--radius-md); 
    text-align: center; 
}

.result-details { 
    display: flex; 
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm); 
    margin-top: var(--spacing-md); 
}

.result-detail { 
    text-align: center; 
    padding: 12px; 
    background-color: #f5f5f5; 
    width: 100%;
    max-width: 600px;
    border-bottom: 1px solid #e0e0e0;
}

/* 排名表格容器 */
.ranking-container {
    margin-top: var(--spacing-md);
    width: 100%;
    max-width: 600px;
}

.ranking-title {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-sm);
    color: var(--primary-color);
    font-weight: 600;
}

.detail-value { 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: var(--primary-color); 
}

.detail-label { 
    font-size: 0.85rem; 
    color: #546e7a; 
}

/* 模态框样式 */
.modal { 
    position: fixed; 
    z-index: 1000; 
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    display: none; /* 默认不显示，避免遮挡滚动 */
    align-items: center; 
    justify-content: center; 
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.modal.show {
    display: flex; /* 仅在显示时启用布局 */
    opacity: 1;
}

.modal-content { 
    background-color: white; 
    padding: var(--spacing-md); /* 减小内边距 */
    border-radius: var(--radius-lg); 
    width: 90%; 
    max-width: 350px; 
    text-align: center; 
    box-shadow: var(--shadow-lg); 
    transform: translateY(20px);
    opacity: 0;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal.show .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-title { 
    font-size: 1.2rem; 
    margin-bottom: var(--spacing-sm); 
    font-weight: 600; 
}

/* 简化的模态框内容 */
.modal-simple-text {
    font-size: 1rem;
    margin-bottom: var(--spacing-sm);
}

.modal-buttons { 
    margin-top: var(--spacing-md); 
    display: flex; 
    justify-content: center; 
    gap: 10px; 
    flex-wrap: wrap;
}

/* 头部操作区 */
.header-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
    margin-top: var(--spacing-sm);
    -webkit-overflow-scrolling: touch;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 0;
    box-shadow: var(--shadow-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

th {
    padding: 10px;
    border-bottom: 2px solid var(--primary-color);
    background-color: var(--primary-light);
    position: sticky;
    top: 0;
    z-index: 10;
}

td {
    padding: 8px;
    border-bottom: 1px solid #e0e0e0;
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.animate-fadeIn {
    animation: fadeIn var(--transition-normal) ease-out forwards;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* 响应式设计 */
@media (min-width: 768px) {
    .container {
        padding: var(--spacing-lg);
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .question {
        font-size: 1.1rem;
    }
    
    .question-number {
        width: 26px;
        height: 26px;
    }
    
    .option {
        padding: 15px;
    }
    
    .option-label {
        min-width: 24px;
        height: 24px;
    }
    
    .result-score {
        font-size: 4rem;
    }
    
    .result-title {
        font-size: 1.5rem;
    }
    
    button {
        padding: 12px 30px;
        font-size: 1rem;
    }
    
    .logo-container {
        padding: var(--spacing-md) 0;
        text-align: center;
    }
    
    .logo-container img {
        height: 40px;
    }
    
    /* PC端特定样式 */
    .header-actions {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .header-actions h1 {
        text-align: left;
    }
    
    /* 确保PC端按钮居中 */
    .btn-container {
        justify-content: center;
    }
    
    .table-container {
        max-height: 500px;
    }
}