/**
 * 详情页面样式
 */

/* ========== 详情头部 ========== */
.detail-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 0 30px;
    color: white;
}

.breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
}

.breadcrumb a {
    color: rgba(255,255,255,0.8);
}

.breadcrumb a:hover {
    color: white;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: rgba(255,255,255,0.5);
}

.breadcrumb .current {
    color: rgba(255,255,255,0.9);
}

.detail-title-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.detail-title {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.detail-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
}

.tag.engine-tag {
    background: rgba(255,255,255,0.2);
    color: white;
}

.tag.type-tag.server {
    background: #dbeafe;
    color: #1e40af;
}

.tag.type-tag.client {
    background: #dcfce7;
    color: #166534;
}

.tag.type-tag.tool {
    background: #fef3c7;
    color: #92400e;
}

.tag.type-tag.tutorial {
    background: #fce7f3;
    color: #9d174d;
}

.tag.hot-tag {
    background: #fee2e2;
    color: #dc2626;
}

/* ========== 详情内容布局 ========== */
.detail-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 30px;
    margin-top: 30px;
}

/* ========== 左侧主内容 ========== */
.detail-main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* 卡片通用样式 */
.info-card,
.description-card,
.instructions-card,
.screenshots-card,
.comments-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* 信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    font-size: 13px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* 描述内容 */
.description-content,
.instructions-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 15px;
}

.description-content p,
.instructions-content p {
    margin-bottom: 12px;
}

.instructions-content ol,
.instructions-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.instructions-content li {
    margin-bottom: 8px;
}

/* 截图网格 */
.screenshots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.screenshot-item {
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    aspect-ratio: 16/10;
}

.screenshot-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.screenshot-item:hover img {
    transform: scale(1.05);
}

/* 评论列表 */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment-item {
    padding: 16px;
    background: #f8fafc;
    border-radius: var(--radius-md);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.comment-content {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

/* ========== 右侧边栏 ========== */
.detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.sidebar-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* 下载卡片 */
.download-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.download-info > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-info .label {
    font-size: 14px;
    color: var(--text-secondary);
}

.download-info .value {
    font-weight: 600;
    color: var(--text-primary);
}

.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-download:hover {
    background: var(--primary-hover);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.download-tip {
    text-align: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 相关资源 */
.related-list {
    list-style: none;
}

.related-list li {
    margin-bottom: 12px;
}

.related-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.related-list a:hover {
    background: #f8fafc;
}

.related-title {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-type {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    margin-left: 8px;
}

.related-type.server {
    background: #dbeafe;
    color: #1e40af;
}

.related-type.client {
    background: #dcfce7;
    color: #166534;
}

.related-type.tool {
    background: #fef3c7;
    color: #92400e;
}

.related-type.tutorial {
    background: #fce7f3;
    color: #9d174d;
}

/* 标签云 */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-link {
    padding: 6px 12px;
    background: #f1f5f9;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.tag-link:hover {
    background: var(--primary-color);
    color: white;
}

/* ========== 分类头部 ========== */
.category-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 0 30px;
    color: white;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.category-icon {
    font-size: 48px;
}

.category-text h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.category-text p {
    font-size: 16px;
    color: rgba(255,255,255,0.8);
}

/* ========== 分类内容布局 ========== */
.category-content {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-section {
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.sidebar-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.category-list,
.filter-list {
    list-style: none;
}

.category-list li,
.filter-list li {
    margin-bottom: 8px;
}

.category-list a,
.filter-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: var(--transition);
}

.category-list a:hover,
.filter-list a:hover,
.category-list li.active a {
    background: #f1f5f9;
    color: var(--primary-color);
}

.category-list li.active a {
    background: #eff6ff;
    font-weight: 500;
}

.cat-icon {
    font-size: 18px;
}

/* 资源列表头部 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

/* ========== 响应式设计 ========== */
@media (max-width: 1024px) {
    .detail-content {
        grid-template-columns: 1fr;
    }
    
    .detail-sidebar {
        order: -1;
    }
    
    .category-content {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .detail-title {
        font-size: 24px;
    }
    
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .screenshots-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-info {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .detail-title {
        font-size: 20px;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .screenshots-grid {
        grid-template-columns: 1fr;
    }
    
    .list-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
}
