/**
 * 详情页面样式 - 暗色模式设计
 */

/* 页面主体 */
.detail-page {
    background: #0d1117;
    min-height: 100vh;
    padding: 2rem 0;
    color: #e6edf3;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: #8b949e;
}

.breadcrumb a {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #79c0ff;
}

.breadcrumb span {
    color: #6e7681;
}

.breadcrumb .current {
    color: #e6edf3;
    font-weight: 500;
}

/* 插件头部信息 */
.plugin-header {
    display: flex;
    gap: 2rem;
    background: #161b22;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #30363d;
}

.plugin-icon-wrapper {
    flex-shrink: 0;
    position: relative;
}

.plugin-icon {
    position: relative;
}

.plugin-icon img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #30363d;
}

/* 精选图标徽章 */
.featured-badge-icon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #f97316;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #161b22;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
}

.featured-badge-icon svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    stroke: none;
}

.plugin-info {
    flex: 1;
    min-width: 0;
}

.plugin-title {
    font-size: 2rem;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 1rem 0;
    line-height: 1.25;
}

.plugin-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.plugin-title a:hover {
    color: #58a6ff;
    text-decoration: underline;
}

.plugin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: #8b949e;
}

.plugin-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.plugin-meta svg {
    stroke-width: 2;
    opacity: 0.8;
    stroke: #8b949e;
}

.plugin-description {
    color: #c9d1d9;
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

/* 插件信息卡片 */
.info-card {
    background: #161b22;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #30363d;
}

.info-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #30363d;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-item label {
    font-size: 0.8rem;
    color: #8b949e;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-item span {
    color: #e6edf3;
    font-weight: 500;
    word-break: break-all;
}

.plugin-id {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 0.8rem;
    background: #21262d;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #30363d;
}

/* 插件ID主要显示 */
.plugin-id-main {
    margin: -1.5rem 0 1rem 0;
}

.plugin-id-main code {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', 'Consolas', monospace;
    font-size: 0.75rem;
    background: transparent;
    color: #6e7681;
    padding: 0.2rem 0;
    border: none;
    word-break: break-all;
    font-weight: normal;
}

/* 精选标注样式 */
.plugin-meta .featured {
    color: #f97316;
    font-weight: 600;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1;
}

.plugin-meta .featured svg {
    stroke: #f97316;
    fill: #f97316;
    width: 12px;
    height: 12px;
}

/* Chrome应用商店链接样式 */
.plugin-meta .source a {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.plugin-meta .source a:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* 插件信息卡片内的链接样式 */
.info-item .source-link {
    color: #58a6ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.info-item .source-link:hover {
    color: #79c0ff;
    text-decoration: underline;
}

/* 语言显示样式 */
.languages-display {
    position: relative;
}

.language-summary {
    cursor: pointer;
    color: #58a6ff;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.language-summary:hover {
    color: #79c0ff;
}

.language-tooltip {
    position: absolute;
    top: 100%;
    left: 0;
    background: #21262d;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #e6edf3;
    white-space: nowrap;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    max-width: 300px;
    white-space: normal;
    line-height: 1.4;
}

/* 按钮样式 */
.plugin-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.2;
}

.btn-primary {
    background: #238636;
    color: white;
    border: 1px solid #238636;
}

.btn-primary:hover {
    background: #2ea043;
    border-color: #2ea043;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(35, 134, 54, 0.3);
}

.btn-secondary {
    background: transparent;
    color: #e6edf3;
    border: 1px solid #30363d;
}

.btn-secondary:hover {
    background: #21262d;
    border-color: #484f58;
    color: #f0f6fc;
}

.btn-sm {
    padding: 0.45rem 0.9rem;
    font-size: 0.8rem;
}

.btn svg {
    stroke-width: 2;
    width: 16px;
    height: 16px;
}

/* 两栏布局 */
.content-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    margin-top: 2rem;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0; /* 防止内容溢出 */
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.sidebar-section {
    background: #161b22;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #30363d;
}

.sidebar-section h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #30363d;
}

/* 侧边栏相关推荐 */
.related-sidebar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-sidebar-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #21262d;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    border: 1px solid #30363d;
}

.related-sidebar-item:hover {
    background: #2d333b;
    border-color: #444c56;
    transform: translateY(-1px);
}

.related-sidebar-item img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #30363d;
}

.related-sidebar-info {
    flex: 1;
    min-width: 0;
}

.related-sidebar-info h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e6edf3;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-sidebar-info p {
    font-size: 0.75rem;
    color: #8b949e;
    margin: 0;
    line-height: 1.4;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.content-section {
    background: #161b22;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #30363d;
}

.content-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e6edf3;
    margin: 0 0 1rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #30363d;
}

.content-text {
    color: #c9d1d9;
    line-height: 1.7;
    font-size: 0.95rem;
}

/* 截图网格 */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.screenshot-item {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.screenshot-item:hover {
    transform: scale(1.02);
}

.screenshot-item img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid #30363d;
}

/* 相关推荐 */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

.related-item:hover {
    background: #21262d;
    border-color: #484f58;
    transform: translateY(-1px);
}

.related-item img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #30363d;
    flex-shrink: 0;
}

.related-info {
    flex: 1;
    min-width: 0;
}

.related-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #e6edf3;
    margin: 0 0 0.25rem 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-info p {
    font-size: 0.875rem;
    color: #8b949e;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 返回顶部按钮样式 */
.back-to-top-btn {
    position: fixed;
    right: 2rem;
    bottom: 2.5rem;
    z-index: 1200;
    background: rgba(66,153,225,0.95);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.85;
    transition: opacity 0.2s, background 0.2s;
}
.back-to-top-btn:hover {
    background: #2563eb;
    opacity: 1;
}
.back-to-top-btn .icon {
    width: 28px;
    height: 28px;
    fill: currentColor;
}


/* 响应式设计 */
@media (max-width: 768px) {
    .detail-page {
        padding: 1rem 0;
    }

    .plugin-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1.5rem;
    }

    .plugin-title {
        font-size: 1.5rem;
    }

    .plugin-meta {
        gap: 1rem;
    }

    .plugin-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .screenshots-grid {
        grid-template-columns: 1fr;
    }

    .related-item {
        padding: 0.75rem;
    }

    .info-item span {
        word-break: break-word;
    }

    /* 响应式两栏布局 */
    .content-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .sidebar {
        position: static;
        order: -1; /* 侧边栏移到主内容上方 */
    }

    .related-sidebar-item {
        flex-direction: row;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .plugin-header {
        padding: 1rem;
    }

    .plugin-title {
        font-size: 1.25rem;
    }

    .plugin-actions {
        gap: 0.5rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .content-section {
        padding: 1rem;
    }

    .info-card {
        padding: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.plugin-header,
.info-card,
.content-section {
    animation: fadeInUp 0.6s ease;
}

.content-section:nth-child(2) {
    animation-delay: 0.1s;
}

.content-section:nth-child(3) {
    animation-delay: 0.2s;
}

/* 滚动条样式 */
html {
    scroll-behavior: smooth;
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0d1117;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* 选择文本样式 */
::selection {
    background: rgba(88, 166, 255, 0.3);
    color: #e6edf3;
} 