/* GRBLHAL开发板调查系统样式 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    margin-bottom: 10px;
}

/* 主要内容区域 */
main {
    flex: 1;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* 公告样式 */
.announcement {
    padding: 40px;
    text-align: center;
}

.announcement h2 {
    color: #4a5568;
    margin-bottom: 25px;
    font-size: 1.8rem;
}

.announcement-content {
    background: #f7fafc;
    padding: 30px;
    border-radius: 10px;
    border-left: 5px solid #667eea;
    margin-bottom: 30px;
    text-align: left;
    font-size: 1.1rem;
    line-height: 1.8;
}

.start-survey {
    margin-top: 30px;
}

/* 调查表单样式 */
.survey-form {
    padding: 40px;
}

.progress-bar {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    margin-bottom: 30px;
    overflow: hidden;
}

.progress {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.question-info {
    text-align: center;
    margin-bottom: 30px;
}

.question-number {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.question h2 {
    color: #2d3748;
    margin-bottom: 30px;
    font-size: 1.5rem;
    text-align: center;
}

.options {
    space-y: 15px;
}

.option {
    display: block;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.option:hover {
    border-color: #667eea;
    background: #edf2f7;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option input[type="radio"]:checked + .option-text {
    color: #667eea;
    font-weight: 600;
}

.option:has(input[type="radio"]:checked) {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
    transform: translateY(-1px);
}

/* 为不支持 :has() 的浏览器提供备用方案 */
.option.checked {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea15, #764ba215);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.25);
    transform: translateY(-1px);
}

.option-text {
    font-size: 1.1rem;
    line-height: 1.5;
    display: block;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-outline:hover {
    background: #667eea;
    color: white;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 15px;
}

/* 结果页面样式 */
.result-page {
    padding: 40px;
}

.success-message {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #10b98110, #059f6910);
    border-radius: 10px;
    border: 1px solid #10b981;
}

.success-message h2 {
    color: #059669;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.user-answers {
    margin-bottom: 40px;
}

.user-answers h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.answers-list {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
}

.answer-item {
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
}

.answer-item:last-child {
    border-bottom: none;
}

.question-title {
    margin-bottom: 8px;
    color: #4a5568;
}

.answer-value {
    color: #667eea;
    font-weight: 600;
}

/* 统计样式 */
.statistics {
    margin-bottom: 40px;
}

.statistics h3 {
    color: #2d3748;
    margin-bottom: 20px;
    font-size: 1.3rem;
}

.stats-grid {
    display: grid;
    gap: 20px;
}

.stat-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
    border: 1px solid #e2e8f0;
}

.stat-item h4 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.stat-bar {
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 5px;
}

.stat-progress {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 5px;
}

.stat-fill {
    background: linear-gradient(90deg, #667eea, #764ba2);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stat-value {
    font-size: 0.8rem;
    color: #718096;
    text-align: right;
}

.actions {
    text-align: center;
    margin-bottom: 40px;
    gap: 15px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.cooldown-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #fecaca;
    margin-bottom: 20px;
}

.contact-info {
    background: #f0f9ff;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #bae6fd;
}

.contact-info h3 {
    color: #0369a1;
    margin-bottom: 10px;
}

.contact-info p {
    color: #0c4a6e;
    margin-bottom: 5px;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 20px;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .survey-form,
    .announcement,
    .result-page {
        padding: 25px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
    }
    
    .actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .survey-form,
    .announcement,
    .result-page {
        padding: 20px;
    }
    
    .option {
        padding: 15px;
    }
    
    .option-text {
        font-size: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.survey-form,
.announcement,
.result-page {
    animation: fadeIn 0.5s ease-out;
}

/* 打印样式 */
@media print {
    body {
        background: white;
    }
    
    .container {
        box-shadow: none;
    }
    
    main {
        box-shadow: none;
    }
    
    .btn {
        display: none;
    }
    
    .actions {
        display: none;
    }
}