/* 页面容器 */
.page-container {
    padding: 120px 5% 80px;
    max-width: 1400px;
    margin: 0 auto;
}


/* 核心：插件详情头部（合并重复定义，统一两列布局+高度同步） */
.plugin-detail-header {
    display: grid;
    grid-template-columns: 2fr 1fr; /* 左2份，右1份 */
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: stretch; /* 强制左右高度同步 */
}

/* 左侧容器：图片+基础信息（合并重复定义） */
.plugin-header-left {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    height: 100%; /* 继承父列高度，确保与右侧同步 */
}

/* 图片+标题同行容器 */
.plugin-title-bar {
    display: flex;
    align-items: center;
    gap: 1rem; /* 图片与标题间距 */
}

/* 插件图标（原图片，改为圆形图标） */
.plugin-title-bar .plugin-image {
    height: 60px;
    width: 60px;
    max-width: none;
    margin: 0; /* 取消居中，左对齐 */
    border-radius: 50%; /* 圆形图标 */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 208, 255, 0.2);
    background: var(--card-bg);
    border: 2px solid var(--primary-accent);
}

.plugin-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 左侧基础信息区（合并重复定义） */
.plugin-basic-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.5rem;
    flex: 1; /* 占满剩余高度，超出时撑开容器 */
}

.plugin-title {
    font-size: 1.8rem;
    color: var(--primary-accent);
    margin: 0;
    line-height: 1.2; /* 垂直居中对齐图标 */
}

.plugin-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* 插件元信息（合并重复定义） */
.plugin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    align-items: center;
}

.plugin-author, .plugin-power, .plugin-version, .plugin-install {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    color: var(--primary-dark);
    font-weight: 600;
}

.plugin-power .power-icon {
    background: linear-gradient(45deg, var(--primary-accent), var(--secondary-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.plugin-vip-badge {
    background: linear-gradient(45deg, #ffd700, #ffa500);
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 安装按钮 */
.install-form {
    margin-top: 0.5rem;
}

.install-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

/* 插件标签（合并重复定义） */
.plugin-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.plugin-tag {
    display: inline-block;
    padding: 0.3rem 1rem;
    font-size: 0.85rem;
    color: var(--primary-accent);
    background: rgba(0, 208, 255, 0.1);
    border-radius: 20px;
}

.light-theme .plugin-tag {
    background: rgba(0, 102, 204, 0.08);
}

/* 右侧容器：插件功能介绍（合并重复定义） */
.plugin-header-right {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    height: 100%; /* 继承父列高度，确保与左侧同步 */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.light-theme .plugin-header-right {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
}

.plugin-function-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-accent);
    position: relative;
    padding-bottom: 8px;
}

.plugin-function-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(to right, var(--primary-accent), var(--secondary-accent));
    border-radius: 2px;
}

.plugin-function-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.95rem;
    flex: 1; /* 占满剩余高度 */
    overflow-y: auto; /* 超出滚动 */
    padding-right: 0.5rem; /* 预留滚动条空间 */
}

/* 插件详情内容（通用模块样式） */
.plugin-section, .api-section {
    background: var(--card-bg);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.light-theme .plugin-section, .light-theme .api-section {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.05);
}

/* 通用标题样式（合并重复定义） */
.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--primary-accent);
    position: relative;
    padding-bottom: 8px;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 16px;
    background: var(--primary-accent);
    border-radius: 2px;
    margin-right: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(to right, var(--primary-accent), var(--secondary-accent));
    border-radius: 2px;
}

.plugin-section p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    line-height: 1.7;
}

/* 插件功能列表 */
.plugin-features {
    list-style: none;
}

.plugin-features li {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
}

.light-theme .plugin-features li {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.plugin-features li:last-child {
    border-bottom: none;
}

.plugin-features li i {
    color: var(--primary-accent);
    margin-right: 10px;
    font-size: 1.1rem;
}

/* API 接口部分（合并重复定义） */
.api-endpoint {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.light-theme .api-endpoint {
    background: rgba(255, 255, 255, 0.5);
}

.api-method {
    display: inline-block;
    background: var(--primary-accent);
    color: var(--primary-dark);
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: 600;
    margin-bottom: 10px;
}

.api-url {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.3);
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
    overflow-x: auto;
}

.light-theme .api-url {
    background: rgba(255, 255, 255, 0.7);
}

.api-params {
    margin-top: 15px;
}

.param-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.param-table th, .param-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.light-theme .param-table th, .light-theme .param-table td {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.param-table th {
    color: var(--primary-accent);
    font-weight: 600;
}

.param-table td {
    color: var(--text-secondary);
}

/* 代码块样式 */
.code-block {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    overflow-x: auto;
    font-family: monospace;
    line-height: 1.5;
}

.light-theme .code-block {
    background: rgba(255, 255, 255, 0.5);
}

.code-comment {
    color: #6a9955;
}

.code-keyword {
    color: #569cd6;
}

.code-string {
    color: #ce9178;
}

.code-function {
    color: #dcdcaa;
}

/* 相关插件（合并重复定义） */
.related-plugins {
    margin: 3rem 0;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.light-theme .related-plugins {
    border-top-color: rgba(0, 0, 0, 0.08);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: var(--card-bg);
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.light-theme .related-card {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.related-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 208, 255, 0.15);
}

.light-theme .related-card:hover {
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.1);
}

.related-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 1rem;
}

.related-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    color: var(--primary-accent);
    background: rgba(0, 208, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 0.75rem;
}

.light-theme .related-tag {
    background: rgba(0, 102, 204, 0.08);
}

.related-title {
    font-size: 1rem;
    font-weight: 500;
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.related-meta span {
    display: flex;
    align-items: center;
}

.related-meta span:first-child::before {
    content: "\f019";
    font-family: "FontAwesome";
    margin-right: 0.25rem;
}

.related-meta span:last-child::before {
    content: "\f0e7";
    font-family: "FontAwesome";
    margin-right: 0.25rem;
}

/* 响应式适配（合并重复定义） */
@media (max-width: 768px) {
    /* 头部改为单列 */
    .plugin-detail-header {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* 图片尺寸调整 */
    .plugin-title-bar .plugin-image {
        max-width: 180px;
        height: 150px;
    }

    /* 右侧容器内边距调整 */
    .plugin-header-right {
        padding: 1.5rem;
    }

    /* 相关插件改为单列 */
    .related-grid {
        grid-template-columns: 1fr;
    }
}




/* 插件星级样式 */
.plugin-star {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffd700;
    font-size: 0.9rem;
}
.plugin-star .fa-star {
    font-size: 0.9rem;
}
.star-active {
    color: #ffd700;
    text-shadow: 0 0 3px rgba(255, 215, 0, 0.5);
}
.star-inactive {
    color: #ccc;
}

/* 调整元信息布局，适配星级显示 */
.plugin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    align-items: center;
    margin: 15px 0;
    color: var(--text-secondary);
}


/* 1. 修复手机端插件图片椭圆形问题 */
@media (max-width: 768px) {
    /* 插件详情页 - 图片保持圆形 */
    .plugin-title-bar .plugin-image {
        width: 60px !important; /* 强制固定宽度 */
        height: 60px !important; /* 强制固定高度 */
        border-radius: 50% !important; /* 保持圆形 */
    }
    
    /* 相关插件列表 - 图片比例正常 */
    .related-image {
        height: 120px !important; /* 适配手机端高度 */
    }
    
    /* 2. 修复API表格超出屏幕问题 */
    .api-section {
        padding: 20px 15px !important; /* 减少左右内边距 */
        overflow-x: auto !important; /* 横向滚动 */
    }
    
    .param-table {
        min-width: 600px !important; /* 给表格最小宽度，确保内容不挤压 */
    }
    
    .param-table th, .param-table td {
        padding: 10px 8px !important; /* 减少单元格内边距 */
        font-size: 0.85rem !important; /* 缩小字体 */
    }
    
    /* 补充：代码块和API地址适配 */
    .api-url, .code-block {
        padding: 10px !important;
        font-size: 0.8rem !important;
    }
}

/* 补充：确保小屏下图标容器不拉伸 */
@media (max-width: 480px) {
    .plugin-title-bar {
        flex-direction: column !important; /* 图片和标题垂直排列 */
        align-items: flex-start !important; /* 左对齐 */
        gap: 0.8rem !important;
    }
    
    .plugin-title {
        font-size: 1.5rem !important;
    }
    
    .plugin-meta {
        gap: 10px 15px !important; /* 缩小元信息间距 */
    }
}


/* 修复手机端插件详情头部被导航遮挡 */
@media (max-width: 768px) {
    /* 增加页面容器顶部内边距，避开导航栏 */
    .page-container {
        padding-top: 160px !important; /* 比原有120px增加40px，根据导航高度调整 */
    }
    
    /* 确保头部区域不被固定导航覆盖 */
    .plugin-detail-header {
        margin-top: 0 !important;
        position: relative !important;
        z-index: 1 !important; /* 低于导航z-index，避免层级冲突 */
    }
}

/* 超小屏（480px以下）额外适配 */
@media (max-width: 480px) {
    .page-container {
        padding-top: 80px !important; /* 进一步增加顶部间距 */
        padding-left: 8px !important;
        padding-right: 8px !important; /* 缩小左右内边距，增加可用空间 */
    }
}
