﻿/* 问卷填写页面样式 */

:root {
    --primary: #FF6900;
    --primary-light: #FFF5F0;
    --text: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --border: #E5E5E5;
    --bg: #F8F9FA;
    --white: #FFFFFF;
    --success: #22C55E;
    --radius: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

/* 问卷容器 */
.survey-form-page {
    min-height: 100vh;
    padding: 20px;
}

.survey-form-container {
    max-width: 720px;
    margin: 0 auto;
}

/* 问卷头部 */
.survey-header {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.survey-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
    text-align: center;
}

.survey-description {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.survey-progress {
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

/* 问卷表单 */
.survey-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* 题目项 */
.question-item {
    margin-bottom: 32px;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
    transition: background 0.3s;
}

.question-item.question-error {
    background: #fff3f3;
    border-radius: 12px;
    padding: 16px 16px 32px;
    border-bottom: 1px solid var(--border);
    outline: 2px solid #ff4d4f;
}

.question-item:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.question-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.question-number {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.question-title {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.5;
    flex: 1;
}

.required-mark {
    color: var(--primary);
    margin-left: 4px;
}

.question-description {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    margin-left: 40px;
}

.question-content {
    margin-left: 40px;
}

/* 选项列表 */
.options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.option-item:hover {
    background: var(--primary-light);
    border-color: var(--primary);
}

.option-item input {
    display: none;
}

.option-radio,
.option-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    flex-shrink: 0;
    transition: all 0.2s;
}

.option-radio {
    border-radius: 50%;
}

.option-checkbox {
    border-radius: 4px;
}

.option-item input:checked + .option-radio {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: inset 0 0 0 4px var(--white);
}

.option-item input:checked + .option-checkbox {
    background: var(--primary);
    border-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 14px;
    background-position: center;
    background-repeat: no-repeat;
}

.option-label {
    font-size: 15px;
    color: var(--text);
}

/* “其他”选项填写框 */
.other-text-input {
    flex: 1;
    min-width: 120px;
    max-width: 260px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    outline: none;
    transition: border-color 0.2s;
}
.other-text-input:focus {
    border-color: var(--primary);
}
.option-other-item {
    flex-wrap: wrap;
    gap: 10px;
}

/* 输入框 */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: all 0.2s;
    background: var(--white);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 20px;
    background-position: right 12px center;
    background-repeat: no-repeat;
    padding-right: 40px;
}

/* 评分星星 */
.rating-stars {
    display: flex;
    gap: 8px;
}

.rating-star {
    cursor: pointer;
    color: var(--border);
    transition: color 0.2s;
}

.rating-star input {
    display: none;
}

.rating-star svg {
    transition: transform 0.2s;
}

.rating-star:hover svg,
.rating-star.hover svg {
    color: #FFC107;
    transform: scale(1.1);
}

.rating-star.selected svg {
    color: #FFC107;
    fill: #FFC107;
}

/* NPS 题 */
.nps-wrap { display: flex; flex-direction: column; gap: 8px; }
.nps-row  { display: flex; gap: 6px; flex-wrap: wrap; }
.nps-cell { position: relative; cursor: pointer; }
.nps-cell input { display: none; }
.nps-cell span {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 8px;
    border: 1.5px solid #e5e7eb; font-size: 14px; font-weight: 600;
    color: #555; background: #fafafa; transition: all .15s;
}
.nps-cell:hover span { border-color: #f97316; color: #f97316; background: #fff8f3; }
.nps-cell.nps-selected span { background: #f97316; border-color: #f97316; color: #fff; }
.nps-labels { display: flex; justify-content: space-between; font-size: 12px; color: #aaa; padding: 0 2px; }

/* 电子签名 */
.sig-wrap { display: flex; flex-direction: column; align-items: flex-start; }
.sig-canvas { background: #fff; }

/* 个人信息题型 */
.pi-form-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.pi-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.pi-form-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}
.pi-form-input,
.pi-form-select {
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    color: var(--text);
    background: var(--white);
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.pi-form-input:focus,
.pi-form-select:focus {
    border-color: var(--primary);
}
.pi-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pi-radio-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: all 0.15s;
}
.pi-radio-item input[type="radio"] { display: none; }
.pi-radio-item:has(input:checked) {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-light);
}

/* 提交按钮 */
.form-actions {
    margin-top: 40px;
    padding-top: 20px;
}

.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-submit:hover {
    background: #E55D00;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255,105,0,0.3);
}

/* 底部 */
.survey-footer {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
}

/* 成功弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    max-width: 360px;
    width: 90%;
}

.success-icon {
    margin-bottom: 24px;
}

.modal-content h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.btn-primary {
    padding: 14px 32px;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

/* 错误页面 */
.error-page,
.success-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-container,
.success-container {
    text-align: center;
    max-width: 400px;
}

.error-icon {
    margin-bottom: 24px;
}

.error-container h1,
.success-container h1 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 12px;
}

.error-container p,
.success-container p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* 移动端适配 */
@media (max-width: 640px) {
    .survey-form-page {
        padding: 0;
        background: var(--white);
    }
    
    .survey-header {
        border-radius: 0;
        padding: 24px 20px;
        margin-bottom: 0;
        box-shadow: none;
        border-bottom: 1px solid var(--border);
    }
    
    .survey-title {
        font-size: 20px;
    }
    
    .survey-form {
        border-radius: 0;
        padding: 24px 20px;
        box-shadow: none;
    }
    
    .question-header {
        gap: 10px;
    }
    
    .question-number {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .question-title {
        font-size: 16px;
    }
    
    .question-description {
        margin-left: 34px;
        font-size: 13px;
    }
    
    .question-content {
        margin-left: 34px;
    }
    
    .option-item {
        padding: 12px 14px;
    }
    
    .form-input,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .rating-star svg {
        width: 28px;
        height: 28px;
    }
    
    .form-actions {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--white);
        padding: 16px 20px;
        border-top: 1px solid var(--border);
        margin-top: 0;
    }
    
    .survey-footer {
        padding-bottom: 100px;
    }
}

/* 已回答标记 */
.question-item.answered .question-number {
    background: var(--success);
}


/* =============================================
   问卷填写页主题风格
   ============================================= */

/* 禅意风 */
body.theme-zen {
    --primary:        #7C9E7E;
    --primary-light:  #F0F5F0;
    --bg:             #FAFAF6;
    --border:         #DDD8CC;
    --text:           #3A3530;
    --text-secondary: #6B6258;
    font-family: "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
}
body.theme-zen .survey-form-container { background: #FDFCF8; }
body.theme-zen .btn-submit { background: #7C9E7E; }
body.theme-zen .btn-submit:hover { background: #5E8060; }
body.theme-zen .option-item:hover { border-color: #7C9E7E; background: #F0F5F0; }
body.theme-zen .option-item input:checked + .option-radio,
body.theme-zen .option-item input:checked + .option-checkbox { background: #7C9E7E; border-color: #7C9E7E; }
body.theme-zen .progress-fill { background: #7C9E7E; }
body.theme-zen .question-number { background: #7C9E7E; }

/* 中国风 */
body.theme-chinese {
    --primary:        #C0392B;
    --primary-light:  #FDF2F0;
    --bg:             #FAF6F4;
    --border:         #E8D5D0;
    --text:           #2C1A18;
    --text-secondary: #6B4040;
    font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
}
body.theme-chinese .survey-form-page { background-color: #FAF6F4; }
body.theme-chinese .survey-form-container { background: #FEFAF9; border-top: 3px solid #C0392B; }
body.theme-chinese .btn-submit { background: #C0392B; }
body.theme-chinese .btn-submit:hover { background: #992D22; }
body.theme-chinese .option-item:hover { border-color: #C0392B; background: #FDF2F0; }
body.theme-chinese .option-item input:checked + .option-radio,
body.theme-chinese .option-item input:checked + .option-checkbox { background: #C0392B; border-color: #C0392B; }
body.theme-chinese .progress-fill { background: #C0392B; }
body.theme-chinese .survey-title { color: #C0392B; }
body.theme-chinese .question-number { background: #C0392B; }

/* 森林风 */
body.theme-forest {
    --primary:        #2E7D52;
    --primary-light:  #EBF5EF;
    --bg:             #F3F7F4;
    --border:         #C8D8CC;
    --text:           #1A2E22;
    --text-secondary: #4A6B55;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
body.theme-forest .survey-form-page { background-color: #F3F7F4; }
body.theme-forest .survey-form-container { background: #FAFCFA; }
body.theme-forest .btn-submit { background: #2E7D52; }
body.theme-forest .btn-submit:hover { background: #1E5C3A; }
body.theme-forest .option-item:hover { border-color: #2E7D52; background: #EBF5EF; }
body.theme-forest .option-item input:checked + .option-radio,
body.theme-forest .option-item input:checked + .option-checkbox { background: #2E7D52; border-color: #2E7D52; }
body.theme-forest .progress-fill { background: #2E7D52; }
body.theme-forest .question-number { background: #2E7D52; }/* =============================================
   问卷填写页主题风格
   ============================================= */

/* 禅意风 */
body.theme-zen {
    --primary:        #7C9E7E;
    --primary-light:  #F0F5F0;
    --bg:             #FAFAF6;
    --border:         #DDD8CC;
    --text:           #3A3530;
    --text-secondary: #6B6258;
    font-family: "STSong", "SimSun", "Noto Serif SC", Georgia, serif;
}
body.theme-zen .survey-form-container { background: #FDFCF8; }
body.theme-zen .btn-submit { background: #7C9E7E; }
body.theme-zen .btn-submit:hover { background: #5E8060; }
body.theme-zen .option-item:hover { border-color: #7C9E7E; background: #F0F5F0; }
body.theme-zen .option-item input:checked + .option-radio,
body.theme-zen .option-item input:checked + .option-checkbox { background: #7C9E7E; border-color: #7C9E7E; }
body.theme-zen .progress-fill { background: #7C9E7E; }
body.theme-zen .question-number { background: #7C9E7E; }

/* 中国风 */
body.theme-chinese {
    --primary:        #C0392B;
    --primary-light:  #FDF2F0;
    --bg:             #FAF6F4;
    --border:         #E8D5D0;
    --text:           #2C1A18;
    --text-secondary: #6B4040;
    font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
}
body.theme-chinese .survey-form-page { background-color: #FAF6F4; }
body.theme-chinese .survey-form-container { background: #FEFAF9; border-top: 3px solid #C0392B; }
body.theme-chinese .btn-submit { background: #C0392B; }
body.theme-chinese .btn-submit:hover { background: #992D22; }
body.theme-chinese .option-item:hover { border-color: #C0392B; background: #FDF2F0; }
body.theme-chinese .option-item input:checked + .option-radio,
body.theme-chinese .option-item input:checked + .option-checkbox { background: #C0392B; border-color: #C0392B; }
body.theme-chinese .progress-fill { background: #C0392B; }
body.theme-chinese .survey-title { color: #C0392B; }
body.theme-chinese .question-number { background: #C0392B; }

/* 森林风 */
body.theme-forest {
    --primary:        #2E7D52;
    --primary-light:  #EBF5EF;
    --bg:             #F3F7F4;
    --border:         #C8D8CC;
    --text:           #1A2E22;
    --text-secondary: #4A6B55;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}
body.theme-forest .survey-form-page { background-color: #F3F7F4; }
body.theme-forest .survey-form-container { background: #FAFCFA; }
body.theme-forest .btn-submit { background: #2E7D52; }
body.theme-forest .btn-submit:hover { background: #1E5C3A; }
body.theme-forest .option-item:hover { border-color: #2E7D52; background: #EBF5EF; }
body.theme-forest .option-item input:checked + .option-radio,
body.theme-forest .option-item input:checked + .option-checkbox { background: #2E7D52; border-color: #2E7D52; }
body.theme-forest .progress-fill { background: #2E7D52; }
body.theme-forest .question-number { background: #2E7D52; }