/**
 * OAII 文档版本选择弹窗 — 前端样式
 * 使用 OAII 主题 CSS 变量，与设计系统保持一致
 */

/* ===== 遮罩层 ===== */
.oaii-doc-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.oaii-doc-modal-overlay.oaii-doc-modal-open {
    opacity: 1;
    visibility: visible;
}

/* ===== 弹窗容器 ===== */
.oaii-doc-modal {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: scale(0.92) translateY(20px);
    transition: transform .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.oaii-doc-modal-overlay.oaii-doc-modal-open .oaii-doc-modal {
    transform: scale(1) translateY(0);
}

/* ===== 弹窗头部 ===== */
.oaii-doc-modal-header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.oaii-doc-modal-title-area {
    flex: 1;
}
.oaii-doc-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px;
    line-height: 1.4;
}
.oaii-doc-modal-subtitle {
    font-size: 13px;
    color: #64748b;
}
.oaii-doc-modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f1f5f9;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #64748b;
    transition: background .2s, color .2s;
    flex-shrink: 0;
}
.oaii-doc-modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* ===== 版本列表区 ===== */
.oaii-doc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 28px 24px;
}

/* 加载状态 */
.oaii-doc-modal-loading {
    text-align: center;
    padding: 48px 0;
    color: #94a3b8;
    font-size: 14px;
}
.oaii-doc-modal-loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 12px auto 0;
    border: 3px solid #e2e8f0;
    border-top-color: #005fcd;
    border-radius: 50%;
    animation: oaii-doc-spin 0.8s linear infinite;
}
@keyframes oaii-doc-spin {
    to { transform: rotate(360deg); }
}

/* 单个版本卡片 */
.oaii-doc-version-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 12px;
    transition: border-color .2s, box-shadow .2s;
}
.oaii-doc-version-item:hover {
    border-color: #005fcd;
    box-shadow: 0 2px 12px rgba(16, 58, 151, 0.08);
}
.oaii-doc-version-item:last-child {
    margin-bottom: 0;
}

/* 最新版本标记 */
.oaii-doc-version-item.oaii-doc-version-latest {
    border-color: #005fcd;
    background: linear-gradient(135deg, rgba(16, 58, 151, 0.03) 0%, rgba(16, 58, 151, 0.02) 100%);
}

/* 版本图标 */
.oaii-doc-version-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.oaii-doc-version-item.oaii-doc-version-latest .oaii-doc-version-icon {
    background: #005fcd;
    color: #fff;
}

/* 版本信息 */
.oaii-doc-version-info {
    flex: 1;
    min-width: 0;
}
.oaii-doc-version-label {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.oaii-doc-version-latest-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #005fcd;
    color: #fff;
}
.oaii-doc-version-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.oaii-doc-version-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.oaii-doc-version-desc {
    font-size: 12px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
}

/* 下载按钮 */
.oaii-doc-version-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #005fcd;
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s, transform .15s;
    flex-shrink: 0;
}
.oaii-doc-version-download:hover {
    background: #0a2766;
    color: #fff;
    transform: translateY(-1px);
}
.oaii-doc-version-download svg {
    width: 15px;
    height: 15px;
}

/* 空状态 */
.oaii-doc-modal-empty {
    text-align: center;
    padding: 48px 0;
    color: #94a3b8;
}
.oaii-doc-modal-empty svg {
    margin: 0 auto 12px;
    color: #cbd5e1;
}

/* ===== 响应式 ===== */
@media (max-width: 640px) {
    .oaii-doc-modal {
        width: 94%;
        max-height: 90vh;
        border-radius: 12px;
    }
    .oaii-doc-modal-header {
        padding: 18px 20px 16px;
    }
    .oaii-doc-modal-title {
        font-size: 16px;
    }
    .oaii-doc-modal-body {
        padding: 16px 20px 20px;
    }
    .oaii-doc-version-item {
        flex-wrap: wrap;
        padding: 14px 16px;
    }
    .oaii-doc-version-download {
        width: 100%;
        justify-content: center;
        margin-top: 4px;
    }
    .oaii-doc-version-icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
}
