/**
 * 智能填表系统 - 页面专属样式
 */

/* ========== 通用表单元素 ========== */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-label-sub {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.125rem;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.375rem 0.625rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #1f2937;
    transition: border-color 0.15s, box-shadow 0.15s;
    background-color: #fff;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary, #4f46e5);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
    background-color: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
}

.form-input[readonly] {
    background-color: #f9fafb;
    color: #4b5563;
}

.form-textarea {
    resize: vertical;
    min-height: 60px;
    line-height: 1.6;
}

.form-radio,
.form-checkbox {
    width: 14px;
    height: 14px;
    accent-color: var(--primary, #4f46e5);
    cursor: pointer;
}

/* ========== 分区标题 ========== */
.section-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
}

.section-title i {
    color: var(--primary, #0066FF);
}

/* ========== 描述子组标题 ========== */
.desc-subgroup-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px dashed #e5e7eb;
    display: flex;
    align-items: center;
}

.desc-subgroup-title i {
    color: #9ca3af;
    font-size: 0.75rem;
}

/* ========== 空间需求卡片 ========== */
.space-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
}

/* ========== 落款备注 ========== */
.form-footer-note {
    font-size: 0.8125rem;
    color: #9ca3af;
    padding: 0.75rem 0;
    border-top: 1px dashed #e5e7eb;
}

/* ========== 表单容器 ========== */
.form-container {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

.form-section {
    position: relative;
    background: #f9fafb;
    border-left: 3px solid var(--primary, #0066FF);
    border-radius: 0 0.375rem 0.375rem 0;
    padding: 1rem 1.25rem;
}

.form-field {
    transition: background-color 0.3s ease;
    border-radius: 0.375rem;
    padding: 0.25rem;
}

/* ========== 高亮动画 ========== */
.form-field.highlight {
    background-color: #fef3c7;
    box-shadow: 0 0 0 2px #f59e0b;
    animation: pulse-highlight 0.6s ease;
}

@keyframes pulse-highlight {
    0% { background-color: #fef9c3; }
    50% { background-color: #fde68a; }
    100% { background-color: #fef3c7; }
}

/* ========== 日志区 ========== */
.log-content {
    font-family: "Consolas", "Microsoft YaHei", monospace;
    font-size: 0.8125rem;
}

.log-entry {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: #4b5563;
    animation: log-fade-in 0.3s ease;
}

.log-entry .log-icon {
    color: var(--primary, #4f46e5);
    margin-top: 2px;
    flex-shrink: 0;
}

.log-entry .log-text {
    line-height: 1.6;
    word-break: break-all;
}

.log-entry.log-success .log-icon {
    color: #10b981;
}

.log-entry.log-info .log-icon {
    color: #3b82f6;
}

.log-entry.log-complete {
    color: #059669;
    font-weight: 600;
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
}

@keyframes log-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 进度条动画 ========== */
#progress-fill {
    transition: width 0.4s ease;
}

/* ========== 工具栏按钮 ========== */
.btn-primary {
    background-color: var(--primary, #4f46e5);
}

.btn-primary:hover {
    background-color: var(--primary-dark, #4338ca);
}

.btn-success {
    background-color: #059669;
    color: #ffffff;
}

.btn-success:hover:not(:disabled) {
    background-color: #047857;
}

.btn-success:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 企业搜索浮层 ========== */
.enterprise-dropdown {
    position: fixed;
    z-index: 9999;
    min-width: 280px;
}

.enterprise-dropdown .search-item:last-child {
    border-bottom: none;
}

/* ========== 知识库文件管理区 ========== */
/* 知识库区在侧边栏内，滚动由内部 file-list 的 flex-1 overflow-y-auto 控制 */

.knowledge-file-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.625rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
}

.knowledge-file-item:hover {
    border-color: #c7d2fe;
}

.knowledge-file-name {
    flex: 1;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knowledge-file-status {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
}

.knowledge-file-status.status-pending {
    color: #92400e;
    background: #fef3c7;
}

.knowledge-file-status.status-processing {
    color: #1e40af;
    background: #dbeafe;
}

.knowledge-file-status.status-success {
    color: #065f46;
    background: #d1fae5;
}

.knowledge-file-status.status-failed {
    color: #991b1b;
    background: #fee2e2;
}

.knowledge-file-date {
    color: #9ca3af;
    font-size: 0.75rem;
    white-space: nowrap;
}

.knowledge-file-delete {
    color: #ef4444;
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0.125rem 0.25rem;
}

.knowledge-file-delete:hover {
    color: #dc2626;
}

/* ========== Tab 切换 ========== */
.tab-header {
    flex-shrink: 0;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.625rem 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #374151;
    background-color: #f9fafb;
}

.tab-btn.active {
    color: var(--primary, #4f46e5);
    border-bottom-color: var(--primary, #4f46e5);
    font-weight: 600;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: flex;
}

/* ========== 项目评估面板 ========== */
.eval-content {
    font-size: 0.875rem;
}

.eval-placeholder {
    text-align: center;
    padding: 3rem 1rem;
    color: #d1d5db;
}

.eval-placeholder i {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}

.eval-placeholder p {
    font-size: 0.8125rem;
}

.eval-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
}

.eval-card p {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.eval-card .eval-hint {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-top: 0.75rem;
}

.eval-generate-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary, #4f46e5);
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s;
}

.eval-generate-btn:hover {
    background: var(--primary-dark, #4338ca);
}

.eval-generate-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eval-generating {
    text-align: center;
    padding: 3rem 1rem;
}

.eval-generating .spinner {
    font-size: 2rem;
    color: var(--primary, #4f46e5);
    margin-bottom: 1rem;
}

.eval-generating p {
    color: #6b7280;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
}

.eval-generating .eval-hint {
    color: #9ca3af;
    font-size: 0.75rem;
}

.eval-done-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.eval-done-header .check-icon {
    color: #10b981;
    font-size: 1.125rem;
}

.eval-done-header .eval-date {
    color: #9ca3af;
    font-size: 0.75rem;
    margin-left: auto;
}

.eval-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #fff;
    background: #059669;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.15s;
    margin-bottom: 1.25rem;
}

.eval-download-btn:hover {
    background: #047857;
}

.eval-download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eval-section-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid #f3f4f6;
}

.eval-section-title i {
    font-size: 0.75rem;
}

.eval-section-title .icon-intro { color: #3b82f6; }
.eval-section-title .icon-highlight { color: #f59e0b; }
.eval-section-title .icon-risk { color: #ef4444; }
.eval-section-title .icon-advice { color: #10b981; }

.eval-brief-text {
    color: #4b5563;
    font-size: 0.8125rem;
    line-height: 1.7;
    white-space: pre-wrap;
}

.eval-brief-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.625rem;
}

.eval-brief-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.15s;
}

.eval-brief-btn:hover {
    border-color: var(--primary, #4f46e5);
    color: var(--primary, #4f46e5);
}

.eval-brief-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eval-brief-streaming {
    color: #4b5563;
    font-size: 0.8125rem;
    line-height: 1.7;
    min-height: 4rem;
}

/* 评估面板 Markdown 渲染样式覆盖（全局 .md-rendered-content 字号过大） */
.eval-brief-streaming.md-rendered-content h2 {
    font-size: 1rem;
    font-weight: 700;
    color: #374151;
    margin-top: 1rem;
    margin-bottom: 0.375rem;
}

.eval-brief-streaming.md-rendered-content h2:first-child {
    margin-top: 0;
}

.eval-brief-streaming.md-rendered-content h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #4b5563;
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

.eval-brief-streaming.md-rendered-content p {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}

.eval-brief-streaming.md-rendered-content ul,
.eval-brief-streaming.md-rendered-content ol {
    font-size: 0.8125rem;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
}

.eval-brief-streaming .cursor-blink::after {
    content: '▋';
    animation: blink 0.8s infinite;
    color: var(--primary, #4f46e5);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .sidebar {
        display: none;
    }
}

/* ========== 折叠日志 ========== */
.log-collapsible {
    transition: box-shadow 0.2s ease;
}

.log-collapsible.expanded #log-chevron {
    transform: rotate(180deg);
}
