/* 基础布局与通用样式 */
:root {
    --main-blue: #0d6efd;
    --hover-blue: #0b5ed7;
}

.main-container {
    height: calc(100vh - 110px); /* 仅考虑底部版权栏高度 */
    min-height: 800px; /* 提升最小高度 */
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 通用容器样式 */
.nav-container,
.form-container,
.response-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* 智能高度控制 */
@media (min-width: 992px) {
    .form-control-lg,
    textarea.form-control {
        font-size: 0.95rem;
    }
    .nav-container,
    .form-container,
    .response-container {
        height: calc(100vh - 160px); /* 恢复原有高度 */
        min-height: 880px; /* 确保最小高度 */
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .nav-container,
    .form-container,
    .response-container {
        height: 78vh;
        min-height: 700px;
    }
}

@media (max-width: 767.98px) {
    .nav-container,
    .form-container {
        height: 80vh; /* 恢复原有高度 */
        min-height: 700px; /* 确保最小高度 */
    }
    .response-container {
        height: auto;
        min-height: 400px;
    }
}

/* 导航系统 */
.nav-container {
    padding: 15px;
}

.nav-title {
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--main-blue);
}

.nav-pills {
    flex-direction: column;
    gap: 8px;
}

.nav-pills .nav-link {
    text-align: center;
    justify-content: center;
    border-radius: 8px;
    padding: 12px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    display: flex;
    align-items: center;
}

.nav-pills .nav-link.active {
    background: var(--main-blue);
    color: white !important;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
}

/* 表单区域 */
.form-container {
    padding: 20px;
    overflow-y: auto; /* 启用智能滚动 */
}

@media (min-width: 768px) {
    .form-container {
        overflow-y: hidden; /* 大屏幕下禁用滚动条 */
    }
}

.form-section {
    margin-bottom: 0.8rem;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.form-label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.4rem;
    font-size: 0.92rem;
}

/* 响应区域 */
.response-container {
    overflow: hidden;
}

.result-header {
    background: #f8f9fa;
    padding: 1.2rem;
    border-bottom: 2px solid var(--main-blue);
    border-radius: 12px 12px 0 0;
}

.result-header span {
    color: var(--main-blue);
    font-size: 1.3rem;
}

.response-content {
    position: relative;
    height: calc(100% - 60px);
    padding: 20px;
    overflow-y: auto;
}

/* 加载层 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* 按钮样式 */
.btn-submit {
    padding: 14px;
    font-size: 1.1rem;
    border-radius: 8px;
    background: var(--main-blue);
    transition: all 0.3s ease;
    margin-top: 1.5rem;
}

.btn-submit:hover {
    background: var(--hover-blue);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* 表单元素优化 */
.form-control-lg {
    padding: 0.8rem 1.2rem;
}

.form-select {
    padding: 0.8rem 2.5rem 0.8rem 1.2rem;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.6;
}

/* 单选按钮组 */
.bg-light.p-3.rounded {
    padding: 0.75rem !important;
}

.form-check {
    margin-bottom: 0.3rem;
}

/* 响应式布局 */
@media (max-width: 767.98px) {
    .row.g-4 {
        --bs-gutter-x: 0.6rem;
    }

    .col-4 {
        flex: 0 0 40%;
        max-width: 40%;
    }

    .col-8 {
        flex: 0 0 60%;
        max-width: 60%;
    }

    .form-container {
        padding: 15px;
    }
}

@media (min-width: 768px) {
    .main-container .row {
        align-items: stretch;
        justify-content: center; /* 水平居中 */
    }
}

/* 优雅滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--main-blue);
    border-radius: 4px;
    transition: background 0.3s;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hover-blue);
}

/* 辅助样式 */
.default-prompt {
    height: 100%; /* 确保填满容器 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/*.copyright-area {*/
/*    position: relative; !* 从fixed改为relative *!*/
/*    bottom: 0;*/
/*    width: 100%;*/
/*    background: #f8f9fa;*/
/*    padding: 15px 0;*/
/*    text-align: center;*/
/*    border-top: 1px solid #dee2e6;*/
/*}*/
.user-level {
    font-size: 0.8em;
    padding: 3px 8px;
    border-radius: 15px;
    color: #fff;
    background-color: #6c757d; /* 默认灰色 */
}
.user-level[class*="bg-"] {
    color: white !important; /* 确保所有等级颜色都有足够对比度 */
}

/* 统一小屏字体 */
@media (max-width: 991.98px) {
    .form-control-lg,
    .compact-textarea {
        font-size: 0.875rem;
    }
}

/* 优化文本域内联样式 */
.compact-textarea {
    padding: 8px 12px;
    line-height: 1.4;
    min-height: 50px;
}