/* ============================================
   模态弹窗样式
   ============================================ */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn var(--anim-fast);
    pointer-events: auto;
}

.modal-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    position: relative;
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    background: var(--bg-panel);
    border: 2px solid #4a9eff;
    border-radius: 8px;
    padding: var(--spacing-xl);
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
    overflow-y: auto;
    animation: modalSlideIn var(--anim-normal);
    pointer-events: auto;
}

/* 维度风险榜弹窗：蓝色主题 */
.modal-content.dimension-modal {
    border-color: #4a9eff;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
}

.modal-content.dimension-modal .modal-title {
    color: #4a9eff;
}

/* 模型安全榜弹窗：蓝色主题 */
.modal-content.model-modal {
    border-color: #4a9eff;
    box-shadow: 0 0 30px rgba(74, 158, 255, 0.3);
}

.modal-content.model-modal .modal-title {
    color: #4a9eff;
}

.modal-content.dimension-modal .modal-rank-item.top-3 {
    border-color: var(--color-safe);
    background: rgba(0, 184, 102, 0.1);
}

.modal-content.dimension-modal .modal-rank-item.top-3 .modal-rank-number {
    color: var(--color-safe);
}

.modal-content.dimension-modal .modal-rank-item.top-3 .modal-rank-score {
    color: var(--color-safe);
}

.modal-content.dimension-modal .modal-rank-number {
    color: #4a9eff;
}

.modal-content.dimension-modal .modal-rank-score {
    color: #4a9eff;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-size: 24px;
    line-height: 1;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--anim-fast);
}

.modal-close:hover {
    border-color: var(--color-danger);
    color: var(--color-danger);
    background: rgba(204, 68, 68, 0.1);
}

.modal-title {
    font-size: 24px;
    font-weight: bold;
    color: #4a9eff;
    margin-bottom: var(--spacing-lg);
    font-family: var(--font-sans);
}

.modal-rank-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.modal-rank-item {
    padding: var(--spacing-md);
    background: var(--bg-darker);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-rank-item.top-3 {
    border-color: var(--color-safe);
    background: rgba(0, 184, 102, 0.1);
}

.modal-rank-item.top-3 .modal-rank-number {
    color: var(--color-safe);
}

.modal-rank-item.top-3 .modal-rank-score {
    color: var(--color-safe);
}

/* 最后三名红色高亮样式 */
.modal-rank-item.bottom-3 {
    border-color: var(--color-danger);
    background: rgba(204, 68, 68, 0.1);
}

.modal-rank-item.bottom-3 .modal-rank-number {
    color: var(--color-danger);
}

.modal-rank-item.bottom-3 .modal-rank-score {
    color: var(--color-danger);
}

.modal-rank-number {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: bold;
    color: var(--color-safe);
    width: 40px;
    text-align: center;
}

.modal-rank-name {
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
    margin-left: var(--spacing-md);
}

.modal-rank-score {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: bold;
    color: var(--color-cyan);
}

/* 日志详情弹窗样式 */
.log-detail-modal {
    max-width: 900px;
    max-height: 85vh;
}

.log-detail-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.log-detail-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.log-detail-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #4a9eff;
    margin-bottom: var(--spacing-xs);
    font-family: var(--font-sans);
}

.log-detail-question,
.log-detail-answer,
.log-detail-comment {
    padding: var(--spacing-md);
    background: var(--bg-darker);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-text);
    line-height: 1.7;
    font-size: 14px;
}

.log-detail-question {
    font-weight: 500;
    border-left: 3px solid #4a9eff;
}

.log-detail-answer {
    min-height: 100px;
    max-height: 300px;
    overflow-y: auto;
}

.log-highlight-text {
    background: rgba(204, 68, 68, 0.3);
    color: var(--color-danger);
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

.log-highlight-text.safe {
    background: rgba(0, 184, 102, 0.3);
    color: var(--color-safe);
}

.log-detail-comment {
    font-style: italic;
    color: var(--color-text-dim);
}

.log-detail-badge {
    display: inline-block;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    font-family: var(--font-sans);
    width: fit-content;
}

.log-detail-badge.safe {
    background: rgba(0, 184, 102, 0.2);
    color: var(--color-safe);
    border: 1px solid var(--color-safe);
}

.log-detail-badge.warning {
    background: rgba(255, 136, 0, 0.2);
    color: var(--color-warning);
    border: 1px solid var(--color-warning);
}

.log-detail-badge.danger {
    background: rgba(204, 68, 68, 0.2);
    color: var(--color-danger);
    border: 1px solid var(--color-danger);
}
