:root {
    --primary-color: #4a6baf;
    --secondary-color: #f8f9fa;
    --accent-color: #ff7043;
    --text-color: #333;
    --light-text: #666;
    --border-color: #ddd;
    --success-color: #4caf50;
    --error-color: #f44336;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

header {
    background-color: var(--primary-color);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    margin-bottom: 10px;
    font-size: 2.2rem;
}
.result-container h2{
    margin-bottom: 8px;
    font-size: 1.5rem;
    color: var(--primary-color);
}
.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

.survey-container {
    padding: 30px;
}

.progress-bar {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0;
    transition: var(--transition);
}

.progress-text {
    text-align: right;
    font-size: 0.9rem;
    color: var(--light-text);
    margin-bottom: 20px;
}
.hidden{
    display: none;
}
.section {
    display: none;
    animation: fadeIn 0.5s;
}

.section.active {
    display: block;
}

.section h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(74, 107, 175, 0.2);
}

.radio-group,
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.radio-group label,
.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

input[type="radio"],
input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-group, .day-row {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}
.day-row {
   max-width: 260px; 
}
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.next-btn, .submit-btn {
    background-color: var(--primary-color);
    color: white;
}

.prev-btn {
    background-color: var(--secondary-color);
    color: var(--text-color);
}

.restart-btn {
    background-color: var(--accent-color);
    color: white;
    margin-top: 20px;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.result-container {
    display: none;
    animation: fadeIn 0.5s;
}

.result-card {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.result-card h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
}

.result-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.chart-container {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    body{
        padding: 15px;
        font-size: 15px;
    }
    .radio-group,
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .result-charts {
        grid-template-columns: 1fr;
    }
    
    .btn {
        padding: 10px 16px;
    }
    .survey-container {
        padding: 15px;
    }
    label {
        margin-bottom: 3px;
    }
    header h1 {
        margin-bottom: 10px;
        font-size: 1.8rem;
    }
    .result-container h2{
        margin-bottom: 8px;
        font-size: 1.3rem;
        color: var(--primary-color);
    }
    .day-row {
        margin-top: 12px; 
        max-width: none;
    }
    .day-row .label {
        min-width: 60px;
    }
}

/* 添加以下样式到您现有的styles.css文件中 */

.radio-group-vertical {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.radio-group-vertical label {
    margin-bottom: 5px;
}

.time-selection {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
}

.day-column {
    background-color: var(--secondary-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.day-column h3 {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 1rem;
}

.time-slots {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.time-slots label {
    display: flex;
    align-items: center;
    font-weight: normal;
}

small {
    display: block;
    color: var(--light-text);
    margin-top: 5px;
    font-size: 0.8rem;
}
.error {
    border-color: var(--error-color) !important;
}

.error-message {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 5px;
}

.form-group.error label {
    color: var(--error-color);
}

.timelist span{
  margin: 0 5px; 
}
.loading-message {
    background-color: #f8f9fa;
    color: #495057;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    text-align: center;
}

.warning-message {
    background-color: #fff3cd;
    color: #856404;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
}
@media (max-width: 768px) {
    .time-selection {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .time-selection {
        grid-template-columns: 1fr;
    }
}

/* 新增水平布局样式 */
.form-group.inline-group {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.form-group.inline-group label {
    flex: 0 0 80px;
    margin-bottom: 0;
    text-align: right;
}

.form-group.inline-group input, 
.form-group.inline-group select {
    flex: 1;
    max-width: 300px;
}

/* 调整地区选择器布局 */
#distpicker {
    display: flex;
    gap: 10px;
    width: 100%;
}

#distpicker select {
    flex: 1;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .form-group.inline-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .form-group.inline-group label {
        text-align: left;
        flex: none;
    }
    
    #distpicker {
        flex-direction: column;
    }
}

/* 自定义弹窗样式 */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.custom-alert {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 400px;
    text-align: center;
    border: 3px solid #2196F3;
    animation: alertSlide 0.3s ease-out;
}

@keyframes alertSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.alert-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.alert-title {
    color: #333;
    margin: 0 0 1rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.alert-message {
    color: #666;
    margin: 0 0 2rem;
    line-height: 1.5;
}

.alert-confirm {
    background: #2196F3;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.alert-confirm:hover {
    background: #1976D2;
}

/* 根据类型调整颜色 */
.custom-alert.success { border-color: #4CAF50; }
.custom-alert.success .alert-confirm { background: #4CAF50; }
.custom-alert.warning { border-color: #FF9800; }
.custom-alert.warning .alert-confirm { background: #FF9800; }
.custom-alert.error { border-color: #F44336; }
.custom-alert.error .alert-confirm { background: #F44336; }

/* 提交按钮加载状态 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 禁用状态的按钮样式 */
.btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}