/* 资源库页面样式 */
.resources {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.resource-card {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.resource-card:hover {
    transform: translateY(-5px);
}

.resource-img {
    height: 180px;
    background-color: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 50px;
}

.resource-content {
    padding: 20px;
}

.resource-content h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.resource-content p {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

.resource-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 5px;
    margin-bottom: 5px;
}

/*************************评估页面*****************************/
/* 评估选择区域样式 */
.assessment-selection {
    margin-bottom: 40px;
}

.questionnaire-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 30px;
}

.questionnaire-card {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.questionnaire-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.questionnaire-icon {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 15px;
}

.questionnaire-card h3 {
    margin-bottom: 15px;
    color: var(--dark);
}

.questionnaire-card p {
    color: #666;
    margin-bottom: 20px;
    flex-grow: 1;
}

.questionnaire-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #888;
}

.questionnaire-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 评估头部样式 */
.assessment-header {
    background-color: white;
    border-radius: 15px 15px 0 0;
    padding: 25px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.assessment-header h3 {
    margin-bottom: 10px;
    color: var(--dark);
}

.assessment-header p {
    color: #666;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
}

/* 问题容器样式 */
.questions-container {
    background-color: white;
    padding: 25px;
}

.question {
    margin-bottom: 30px;
    animation: fadeIn 0.5s ease;
}

.question h3 {
    margin-bottom: 15px;
    color: var(--dark);
    font-size: 1.2rem;
}

.options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.option {
    flex: 1;
    min-width: 120px;
    text-align: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.option:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.option.selected {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(106, 137, 204, 0.3);
}

/* 评估控制按钮 */
.assessment-controls {
    background-color: white;
    border-radius: 0 0 15px 15px;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #eee;
}

/* 评估结果样式 */
.assessment-result {
    background-color: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    margin-top: 30px;
}

.result-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.result-score {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 10px;
}

.result-description {
    color: #666;
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.result-details {
    margin-bottom: 30px;
}

.result-details h3 {
    margin-bottom: 20px;
    color: var(--dark);
}

.result-chart {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-bar {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.chart-label {
    width: 120px;
    font-weight: 500;
    color: var(--dark);
}

.chart-bar-container {
    flex: 1;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 1s ease;
}

.dimension-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.dimension-score {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.dimension-name {
    font-weight: 500;
    margin-bottom: 5px;
    color: var(--dark);
}

.dimension-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.recommendations {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.recommendation {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.recommendation:hover {
    transform: translateY(-5px);
}

.recommendation h4 {
    margin-bottom: 10px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.recommendation-icon {
    color: var(--primary);
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .questionnaire-cards {
        grid-template-columns: 1fr;
    }
    
    .options {
        flex-direction: column;
    }
    
    .option {
        min-width: auto;
    }
    
    .assessment-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-actions {
        flex-direction: column;
    }
    
    .dimension-scores {
        grid-template-columns: 1fr;
    }
}


/*************************心理辅导*****************************/
/* 心理辅导页面样式 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.chat-header {
    background-color: var(--primary);
    color: white;
    padding: 20px;
    text-align: center;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    margin-bottom: 15px;
    border-radius: 18px;
    position: relative;
}

.user-message {
    align-self: flex-end;
    background-color: var(--secondary);
    color: var(--dark);
    border-bottom-right-radius: 5px;
}

.ai-message {
    align-self: flex-start;
    background-color: #f0f0f0;
    color: var(--dark);
    border-bottom-left-radius: 5px;
}

.chat-input {
    display: flex;
    padding: 20px;
    border-top: 1px solid #eee;
}

.chat-input input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 30px;
    outline: none;
    font-size: 1rem;
}

.chat-input button {
    background-color: var(--primary);
    color: white;
    border: none;
    width: 50px;
    border-radius: 50%;
    margin-left: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-input button:hover {
    background-color: #5a70a8;
}

@media (max-width: 768px) {
    .message {
        max-width: 90%;
    }
}

/* 聊天历史侧边栏样式 */
.chat-layout {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.chat-sidebar {
    width: 300px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    padding: 20px;
    max-height: 700px;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--dark);
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.chat-main {
    flex: 1;
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-history-item {
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.chat-history-item:hover {
    background-color: #e9ecef;
    transform: translateY(-2px);
}

.chat-history-item.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.chat-history-title {
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-preview {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-item.active .chat-history-preview {
    color: rgba(255, 255, 255, 0.8);
}

.chat-history-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-top: 5px;
    color: #999;
}

.chat-history-item.active .chat-history-meta {
    color: rgba(255, 255, 255, 0.7);
}

.empty-history {
    text-align: center;
    color: #999;
    padding: 30px 0;
    font-style: italic;
}

/* API配置区域样式 */
.api-config {
    background-color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.api-config h3 {
    margin-bottom: 15px;
    color: var(--dark);
    border-bottom: 2px solid var(--secondary);
    padding-bottom: 10px;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--dark);
}

.form-group input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

/* 打字指示器样式 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    margin-top: 10px;
    color: #666;
    font-style: italic;
}

.typing-dots {
    display: flex;
    gap: 4px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--primary);
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-layout {
        flex-direction: column;
    }
    
    .chat-sidebar {
        width: 100%;
        max-height: 250px;
        order: 2;
    }
    
    .chat-main {
        order: 1;
    }
    
    .sidebar-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .sidebar-header h3 {
        margin-bottom: 0;
    }
}

/* 调试信息样式 */
.debug-info {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 10px;
    margin: 10px 0;
    font-family: monospace;
    font-size: 0.8rem;
    color: #666;
    display: none; /* 默认隐藏 */
}

.debug-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 网络状态指示器 */
.connection-status {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    z-index: 1000;
}

.connection-status.connected {
    background-color: var(--success);
    color: white;
}

.connection-status.disconnected {
    background-color: var(--danger);
    color: white;
}