/* 站点详情页 - 复刻 aibase.com 样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #f5f7fa;
    padding-top: 90px;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
}

.detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* 面包屑导航 */
.breadcrumb {
    font-size: 14px;
    color: #666;
    margin-bottom: 24px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #1890ff;
}

.breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

/* 主内容区 - 左右布局 */
.main-content-wrapper {
    display: grid;
    grid-template-columns: 540px 1fr;
    gap: 40px;
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

/* 左侧预览区 */
.preview-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 110px;
    align-self: flex-start;
}

.preview-container {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 12px;
    overflow: hidden;
    background: #f5f7fa;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.preview-loading i {
    font-size: 40px;
    margin-bottom: 12px;
    color: #666;
}

.preview-loading p {
    font-size: 14px;
}

.site-screenshot {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center top;
}

.preview-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

.preview-error i {
    font-size: 48px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.preview-error p {
    font-size: 14px;
}

/* 预览底部 */
.view-count {
    font-size: 14px;
    color: #666;
}

/* 手机端元素默认隐藏 */
.mobile-info-wrapper {
    display: none;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #40a9ff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: #fff;
    color: #666;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    color: #1890ff;
    border-color: #1890ff;
}

/* 右侧信息区 */
.info-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
}

.info-actions {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    justify-content: flex-end;
}

.site-header-info {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
}

.site-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.site-badges {
    display: flex;
    gap: 8px;
}

.badge {
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-featured {
    background: #fff7e6;
    color: #fa8c16;
}

.site-summary {
    font-size: 15px;
    line-height: 1.8;
    color: #666;
}

/* 网站详细介绍卡片 */
.description-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    margin-bottom: 24px;
}

.description-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

/* 信息列表 */
.info-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.info-item {
    display: flex;
    gap: 12px;
}

.info-label {
    font-size: 14px;
    color: #999;
    min-width: 80px;
    flex-shrink: 0;
}

.info-value {
    font-size: 14px;
    color: #333;
}

.category-link {
    color: #1890ff;
    text-decoration: none;
}

/* 标题行 - 左右布局 */
.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
    gap: 20px;
}

.total-views {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    white-space: nowrap;
    color: #999;
}

.total-views-label {
    color: #999;
    font-weight: 400;
}

.total-views-count {
    color: #999;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 4px;
}

.total-views-count i {
    font-size: 16px;
    color: #999;
}

.category-link:hover {
    text-decoration: underline;
}

/* 标签区 */
.tags-section {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    padding: 6px 14px;
    background: #f0f5ff;
    color: #1890ff;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

.tag-item:hover {
    background: #e6f7ff;
}

/* 相关推荐 */
.related-section {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.related-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.related-card:hover {
    background: #f0f5ff;
    transform: translateY(-2px);
}

.related-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    object-fit: cover;
    background: #fff;
    border: 1px solid #e8eaed;
}

.related-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.related-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.related-desc {
    font-size: 13px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

/* 旋转动画 */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.mdi-spin {
    animation: spin 1s linear infinite;
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .detail-container {
        max-width: 100%;
        padding: 20px 16px 40px;
    }

    .main-content-wrapper {
        grid-template-columns: 480px 1fr;
        gap: 24px;
        padding: 24px;
    }

    .preview-section {
        top: 90px;
    }

    .preview-container {
        aspect-ratio: 16 / 10;
    }

    .related-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 手机端适配 */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .detail-container {
        padding: 16px 12px 40px;
    }

    .breadcrumb {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .main-content-wrapper {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 20px;
    }

    .preview-section {
        order: 2;
        position: static;
    }

    .info-section {
        order: 1;
    }

    .preview-container {
        aspect-ratio: 16 / 10;
    }

    /* 手机端隐藏右侧的按钮、分类和标签 */
    .info-actions,
    .info-list,
    .tags-section {
        display: none;
    }

    /* 手机端显示预览区的信息 */
    .mobile-info-wrapper {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        margin-top: 12px;
    }

    .mobile-tags-section {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .mobile-meta-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 13px;
    }

    .mobile-category-inline {
        display: flex;
        align-items: center;
        gap: 4px;
        color: #666;
    }

    .mobile-category-inline span {
        color: #999;
    }

    .mobile-action-btn {
        width: 100%;
        justify-content: center;
    }

    .site-title {
        font-size: 22px;
    }

    .section-title-row .total-views {
        display: none;
    }

    .site-summary {
        font-size: 14px;
    }

    .description-card {
        padding: 20px;
    }

    .description-content {
        font-size: 14px;
    }

    .info-item {
        flex-direction: column;
        gap: 8px;
    }

    .info-label {
        min-width: auto;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .related-card {
        padding: 12px;
    }

    .related-icon {
        width: 40px;
        height: 40px;
    }

    .related-name {
        font-size: 14px;
    }

    .related-desc {
        font-size: 12px;
    }
}

/* 小屏手机适配 */
@media (max-width: 375px) {
    .detail-container {
        padding: 12px 10px 30px;
    }

    .main-content-wrapper {
        padding: 16px;
        gap: 20px;
    }

    .site-title {
        font-size: 20px;
    }

    .preview-container {
        aspect-ratio: 4 / 3;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}