/* ============================================================
   插件库样式 — Apple Light Theme
   ============================================================ */

/* ---------- Modal 容器 ---------- */
.plugin-library-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.plugin-library-modal.show {
    opacity: 1;
    pointer-events: auto;
}

/* ---------- 内容区 ---------- */
.plugin-library-content {
    width: 680px;
    max-width: 96vw;
    max-height: 88vh;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
    transform: translateY(30px) scale(0.96);
    transition: transform 0.3s ease;
}
.plugin-library-modal.show .plugin-library-content {
    transform: translateY(0) scale(1);
}

/* ---------- 头部 ---------- */
.plugin-library-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.plugin-library-title {
    font-size: 20px;
    font-weight: 700;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 8px;
}
.title-icon {
    font-size: 24px;
}
.plugin-library-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: rgba(134, 134, 139, 0.8);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.plugin-library-close:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1d1d1f;
}

/* ---------- 标签页 ---------- */
.plugin-library-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 24px 0;
}
.plugin-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    color: rgba(134, 134, 139, 0.7);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.plugin-tab:hover {
    color: rgba(29, 29, 31, 0.7);
}
.plugin-tab.active {
    color: #0071e3;
    border-bottom-color: #0071e3;
}

/* ---------- 内容体 ---------- */
.plugin-library-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px 24px;
}
.plugin-tab-content {
    display: none;
}
.plugin-tab-content.active {
    display: block;
}

/* ---------- 插件卡片 ---------- */
.plugin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.plugin-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 14px;
    transition: all 0.2s ease;
}
.plugin-card:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.08);
}

.plugin-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 113, 227, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.plugin-card-info {
    flex: 1;
    min-width: 0;
}
.plugin-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 2px;
}
.plugin-card-desc {
    font-size: 12px;
    color: rgba(134, 134, 139, 0.9);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.plugin-card-version,
.plugin-card-meta {
    font-size: 11px;
    color: rgba(174, 174, 178, 0.8);
    margin-top: 2px;
}
.plugin-card-meta span + span::before {
    content: ' \00b7 ';
}

.plugin-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* ---------- 开关 ---------- */
.plugin-toggle {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    cursor: pointer;
}
.plugin-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}
.plugin-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    transition: all 0.25s ease;
}
.plugin-toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.plugin-toggle input:checked + .plugin-toggle-slider {
    background: #34c759;
}
.plugin-toggle input:checked + .plugin-toggle-slider::before {
    transform: translateX(18px);
}

/* ---------- 按钮 ---------- */
.plugin-btn {
    padding: 6px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.04);
    color: rgba(29, 29, 31, 0.7);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.plugin-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1d1d1f;
}
.plugin-btn.install {
    background: rgba(0, 113, 227, 0.1);
    border-color: rgba(0, 113, 227, 0.2);
    color: #0071e3;
}
.plugin-btn.install:hover {
    background: rgba(0, 113, 227, 0.15);
}
.plugin-btn.uninstall {
    border-color: rgba(255, 59, 48, 0.15);
    color: rgba(255, 59, 48, 0.7);
}
.plugin-btn.uninstall:hover {
    background: rgba(255, 59, 48, 0.08);
}

.plugin-status-label {
    font-size: 12px;
    color: #34c759;
    font-weight: 600;
}
.plugin-status-label.off {
    color: rgba(174, 174, 178, 0.7);
}

/* ---------- 空状态 / 加载提示 ---------- */
.plugin-empty-hint,
.plugin-loading-hint {
    text-align: center;
    padding: 40px 20px;
    color: rgba(134, 134, 139, 0.6);
    font-size: 14px;
}
.plugin-loading-hint {
    color: rgba(134, 134, 139, 0.8);
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .plugin-library-content {
        width: 100vw;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .plugin-library-header {
        padding: 14px 16px;
    }
    .plugin-library-body {
        padding: 12px 16px 20px;
    }
    .plugin-card {
        flex-wrap: wrap;
    }
    .plugin-card-actions {
        width: 100%;
        justify-content: flex-end;
    }
}
