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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 50%, #FF9800 100%);
    background-attachment: fixed;
    color: #333;
    min-height: 100vh;
}

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

/* 卡片样式 */
.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin: 20px 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* 标题样式 */
h1, h2, h3 {
    color: #4CAF50;
    margin-bottom: 20px;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(45deg, #4CAF50, #2196F3, #FF9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 表单样式 */
form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
    color: #555;
}

input, select, textarea {
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-secondary {
    background: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.btn-warning {
    background: #FF9800;
    color: white;
}

.btn-warning:hover {
    background: #F57C00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

/* 问题样式 */
.question {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #4CAF50;
}

.question h3 {
    text-align: left;
    margin-bottom: 15px;
    color: #333;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: #2196F3;
    background: #f0f8ff;
}

.option input[type="radio"] {
    width: 20px;
    height: 20px;
}

/* 二维码样式 */
.qr-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
}

.qr-code {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 结果样式 */
.result {
    text-align: center;
    padding: 30px;
}

.score {
    font-size: 4rem;
    font-weight: bold;
    color: #4CAF50;
    margin: 20px 0;
}

.percentage {
    font-size: 2rem;
    color: #2196F3;
    margin: 10px 0;
}

/* 排行榜样式 */
.leaderboard {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 10px;
}

.leaderboard table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard th, .leaderboard td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e0e0e0;
}

.leaderboard th {
    background: #4CAF50;
    color: white;
    font-weight: 600;
}

.leaderboard tr:hover {
    background: #f0f8ff;
}

/* 导航栏样式 */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    height: auto;
    min-height: 50px;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.navbar-brand {
    font-size: 1.2rem;
    font-weight: bold;
    color: #4CAF50;
    text-decoration: none;
    white-space: nowrap;
    flex: 1;
}

/* 汉堡菜单样式 */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    padding: 5px;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #4CAF50;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.navbar-nav {
    display: flex;
    gap: 15px;
    list-style: none;
    margin: 0;
    transition: all 0.3s ease;
}

.navbar-nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s ease;
    font-size: 0.9rem;
}

.navbar-nav a:hover {
    color: #4CAF50;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .card {
        padding: 20px;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .navbar {
        padding: 6px 0;
        min-height: 45px;
    }
    
    /* 显示汉堡菜单 */
    .hamburger {
        display: flex;
    }
    
    /* 默认隐藏导航菜单 */
    .navbar-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
    }
    
    /* 导航菜单展开状态 */
    .navbar-nav.show {
        max-height: 300px;
        opacity: 1;
        visibility: visible;
        padding: 10px 0;
    }
    
    .navbar-nav a {
        display: block;
        padding: 10px 20px;
        font-size: 0.9rem;
        background: none;
        border-radius: 0;
        text-align: center;
    }
    
    .navbar-nav a:hover {
        background: #f5f5f5;
    }
    
    /* 优化容器布局 */
    .navbar .container {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .navbar-brand {
        font-size: 1.1rem;
        text-align: left;
    }
    
    .score {
        font-size: 3rem;
    }
    
    .percentage {
        font-size: 1.5rem;
    }
    
    .leaderboard th, .leaderboard td {
        padding: 8px;
        font-size: 14px;
    }
}

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

.card {
    animation: fadeIn 0.5s ease;
}

/* 加载状态 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    font-size: 1.2rem;
    color: #4CAF50;
}

/* 错误信息 */
.error {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 5px solid #c62828;
}

/* 成功信息 */
.success {
    background: #e8f5e8;
    color: #2e7d32;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 5px solid #2e7d32;
}
