/* ==================== 问卷样式 ==================== */

.questionnaire-container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px;
}

.questionnaire-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 32px;
    padding: 0 8px;
}

.progress-bar {
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.questionnaire-page {
    animation: fadeIn 0.3s ease;
}

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

.page-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-light);
}

.question-group {
    margin-bottom: 24px;
}

.question-label {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.5;
}

.question-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Radio / Checkbox */
.option-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    user-select: none;
}

.option-item:hover {
    border-color: var(--primary);
}

.option-item.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.option-item input { display: none; }

/* Text input */
.text-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color 0.2s;
}

.text-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

.textarea-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
}

.textarea-input:focus {
    outline: none;
    border-color: var(--border-focus);
}

/* Row input */
.row-input {
    display: flex;
    gap: 12px;
    align-items: center;
}

.row-input .text-input { width: 80px; text-align: center; }

/* Slider */
.slider-group {
    margin-bottom: 20px;
}

.slider-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.slider-value {
    font-weight: 600;
    color: var(--primary);
    font-size: 18px;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    background: var(--border);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

/* Score grid (PHQ-9 / JFLS-20) */
.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.score-table th {
    padding: 8px 4px;
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

.score-table td {
    padding: 8px 4px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.score-table td:first-child {
    text-align: left;
    max-width: 200px;
}

.score-cell {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.score-cell:hover { border-color: var(--primary); }

.score-cell.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.score-total {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    padding: 8px 0;
}

/* Behavior frequency table */
.behavior-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.behavior-table th {
    padding: 6px 4px;
    text-align: center;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
}

.behavior-table td {
    padding: 6px 4px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.behavior-table td:first-child {
    text-align: left;
    max-width: 240px;
}

/* Navigation buttons */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Name random button */
.name-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.name-row .text-input { flex: 1; }

.btn-random {
    padding: 8px 12px;
    background: var(--primary-light);
    color: var(--primary-dark);
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
}

.btn-random:hover { background: var(--primary); color: white; }

/* Voice input */
.voice-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.voice-btn:hover { border-color: var(--primary); color: var(--primary); }

.voice-btn.recording {
    border-color: var(--danger);
    color: var(--danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* JFLS-20 新布局 - 条目和评分分行显示 */
.jfls-group {
    margin-bottom: 16px;
}

.jfls-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.jfls-item:last-child {
    border-bottom: none;
}

.jfls-item-text {
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.jfls-item-scores {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.jfls-label {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 8px;
}

/* 自动保存提示 */
.auto-save-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 100;
    pointer-events: none;
}

.auto-save-hint.show {
    opacity: 1;
}
