/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    min-height: 100vh;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1da88a 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #e8650e 100%);
}

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

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* 表单样式 */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: #2196F3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
    outline: none;
}

.form-control.error {
    border-color: #dc3545;
}

.form-control.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* 单选框和复选框样式 */
.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-item,
.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.radio-item:hover,
.checkbox-item:hover {
    border-color: #2196F3;
    background-color: #E3F2FD;
}

.radio-item.selected,
.checkbox-item.selected {
    border-color: #2196F3;
    background-color: #E3F2FD;
}

.radio-item input,
.checkbox-item input {
    margin-right: 12px;
    transform: scale(1.2);
}

/* 评分样式 */
.rating-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-wrap: nowrap;
}

.rating-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    flex: 1;
}

.rating-item:hover {
    background-color: #E3F2FD;
}

.rating-item.selected {
    background-color: #2196F3;
    color: white;
}

.rating-number {
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 4px;
}

.rating-label {
    font-size: 12px;
    text-align: center;
}

/* 模态框样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 24px 24px 0;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0 0 16px 0;
    color: #333;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 0 24px 24px;
    text-align: right;
}

.modal-footer .btn {
    margin-left: 12px;
}

.modal-actions-below {
    padding: 12px 0 20px;
}

/* 问卷作答页弹窗居中（作用于 index.html 的 .container 布局） */
.container .modal-body { text-align: center; }
.container .modal-footer { text-align: center; }
.container .modal-actions-below { display: flex; justify-content: center; }

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.loader { 
   position: relative; 
   width: 33px; 
   height: 33px; 
   perspective: 67px; 
   margin-bottom: 16px;
} 

/* 加载覆盖层中的问卷标题样式 */
.loading-overlay .loading-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px; /* 与下方“正在加载...”文字的间距 */
    text-align: center;
    padding: 0 20px; /* 保持与容器一致的左右留白 */
}

.loader div { 
   width: 100%; 
   height: 100%; 
   background: #2196F3; 
   position: absolute; 
   left: 50%; 
   transform-origin: left; 
   animation: loader 2s infinite; 
} 

.loader div:nth-child(1) { 
   animation-delay: 0.15s; 
} 

.loader div:nth-child(2) { 
   animation-delay: 0.3s; 
} 

.loader div:nth-child(3) { 
   animation-delay: 0.45s; 
} 

.loader div:nth-child(4) { 
   animation-delay: 0.6s; 
} 

.loader div:nth-child(5) { 
   animation-delay: 0.75s; 
} 

@keyframes loader { 
   0% { 
     transform: rotateY(0deg); 
   } 

   50%, 80% { 
     transform: rotateY(-180deg); 
   } 

   90%, 100% { 
     opacity: 0; 
     transform: rotateY(-180deg); 
   } 
}

/* 跳转提示样式 */
.jump-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(33, 150, 243, 0.95);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.jump-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.jump-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 500;
}

.jump-notification-content i {
    font-size: 18px;
    animation: slideRight 0.6s ease-in-out infinite alternate;
}

@keyframes slideRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(5px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .question-container {
        padding: 20px;
    }
    
    .question-title {
        font-size: 18px;
    }
    
    .radio-item, .checkbox-item {
        padding: 12px;
    }
    
    .navigation {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    .jump-notification {
        padding: 15px 25px;
        font-size: 14px;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-20px); }
}

/* 错误提示 */
.error-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 8px;
    display: block;
}

.success-message {
    color: #28a745;
    font-size: 14px;
    margin-top: 8px;
    display: block;
}
