/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: white;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-50px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #7f8c8d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-close:hover {
    color: #e74c3c;
    background: none;
    transform: none;
    box-shadow: none;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-footer button {
    padding: 8px 16px;
    font-size: 14px;
}

/* JSON 代码样式（用于弹窗内的 <code> 标签） */
.modal-body code {
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    color: #333;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    padding: 4px 6px;
    display: block; /* 作为块级元素以便换行占满内容区 */
    max-width: 100%;
    white-space: pre-wrap; /* 保留空白并允许换行 */
    word-break: break-word; /* 长单词在边界换行（更友好） */
    overflow-wrap: anywhere; /* 没有空格也可在任意位置断行 */
}

/* 详情内容中的代码块在窄屏下缩放字体并允许换行 */
@media (max-width: 768px) {
    .modal-body code {
        font-size: 11px;
    }
}

@media (max-width: 600px) {
    .modal-container {
        width: 95%;
    }

    .modal-footer {
        flex-direction: column;
    }

    .modal-footer button {
        width: 100%;
    }
}