/* ===== 详情页面专用样式 ===== */

/* 错误页面 */
.error-page {
    width: 100%;
    max-width: 500px;
    margin: 100px auto;
    text-align: center;
    background: var(--white);
    padding: 60px 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.error-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: #fff1f0;
    color: #ff4d4f;
    font-size: 40px;
    font-weight: bold;
    line-height: 80px;
    border-radius: 50%;
}

.error-page h2 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 20px;
}

.back-home {
    display: inline-block;
    padding: 10px 30px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius);
    transition: background 0.3s;
}

.back-home:hover {
    background: #40a9ff;
}

/* 主容器 */
.detail-container {
    display: flex;
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
    gap: 20px;
}

/* 左侧折叠导航 */
.detail-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: relative;
    transition: width 0.3s;
}

.detail-sidebar.collapsed {
    width: 30px;
}

.sidebar-toggle {
    position: absolute;
    top: 50%;
    right: -15px;
    transform: translateY(-50%);
    width: 30px;
    height: 60px;
    background: var(--white);
    border-radius: 0 var(--radius) var(--radius) 0;
    box-shadow: var(--shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.toggle-icon {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s;
}

.detail-sidebar.collapsed .toggle-icon {
    transform: rotate(180deg);
}

.sidebar-content {
    background: var(--white);
    border-radius: var(--radius);
    padding: 15px;
    box-shadow: var(--shadow);
    transition: opacity 0.3s;
}

.detail-sidebar.collapsed .sidebar-content {
    opacity: 0;
    pointer-events: none;
}

.sidebar-section {
    margin-bottom: 20px;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* 分类列表 */
.category-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.category-item {
    display: block;
    padding: 8px 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    border-radius: var(--radius);
    transition: all 0.3s;
}

.category-item:hover {
    background: #f5f5f5;
    color: var(--primary-color);
}

.category-item.active {
    background: var(--primary-color);
    color: var(--white);
}

/* 同类网站 */
.related-sites {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

.related-site-item {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-radius: var(--radius);
    transition: background 0.3s;
}

.related-site-item:hover {
    background: #f5f5f5;
}

.related-site-item img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    margin-right: 8px;
    object-fit: contain;
}

.related-site-item span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 右侧主内容 */
.detail-main {
    flex: 1;
    min-width: 0;
}

/* 网站详情卡片 */
.site-detail {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.detail-header {
    display: flex;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--border-color);
    gap: 20px;
}

.site-logo-large {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.site-logo-large img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
}

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

.site-name {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
}

.site-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    border-radius: 20px;
}

.category-tag {
    background: #e6f7ff;
    color: var(--primary-color);
}

.country-tag {
    background: #fff7e6;
    color: #fa8c16;
}

.scene-tag {
    background: #f6ffed;
    color: #52c41a;
}

.site-action {
    flex-shrink: 0;
}

.visit-btn {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: var(--white);
    font-size: 1rem;
    border-radius: var(--radius);
    transition: background 0.3s;
}

.visit-btn:hover {
    background: #40a9ff;
}

/* 详情主体 */
.detail-body {
    padding: 25px;
}

.detail-section {
    margin-bottom: 25px;
}

.detail-section:last-child {
    margin-bottom: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
}

.site-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 信息网格 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.info-item {
    display: flex;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: var(--radius);
}

.info-label {
    font-size: 0.85rem;
    color: var(--text-light);
    width: 80px;
    flex-shrink: 0;
}

.info-value {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-color);
    word-break: break-all;
}

.info-value a {
    color: var(--primary-color);
}

.info-value a:hover {
    text-decoration: underline;
}

/* 推荐网站 */
.recommended-section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 25px;
}

.recommended-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.recommended-card {
    display: flex;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: all 0.3s;
}

.recommended-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.2);
    transform: translateY(-2px);
}

.rec-logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-right: 12px;
}

.rec-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

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

.rec-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rec-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 响应式 */
@media (max-width: 1024px) {
    .detail-sidebar {
        width: 220px;
    }

    .related-sites {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .detail-container {
        flex-direction: column;
    }

    .detail-sidebar {
        width: 100%;
        order: 2;
    }

    .detail-sidebar.collapsed {
        width: 100%;
        height: 40px;
    }

    .sidebar-toggle {
        right: auto;
        left: 50%;
        top: -15px;
        transform: translateX(-50%);
        width: 60px;
        height: 30px;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .detail-sidebar.collapsed .toggle-icon {
        transform: rotate(-90deg);
    }

    .sidebar-content {
        display: none;
    }

    .detail-sidebar.collapsed .sidebar-content {
        display: none;
    }

    .detail-main {
        order: 1;
    }

    .detail-header {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .site-logo-large {
        width: 64px;
        height: 64px;
    }

    .site-name {
        font-size: 1.2rem;
    }

    .site-tags {
        justify-content: center;
    }

    .visit-btn {
        width: 100%;
        text-align: center;
    }

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

    .recommended-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .recommended-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .rec-logo {
        margin-right: 0;
        margin-bottom: 8px;
    }
}

@media (max-width: 480px) {
    .detail-body {
        padding: 15px;
    }

    .recommended-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .recommended-card {
        padding: 12px;
    }

    .rec-logo {
        width: 40px;
        height: 40px;
    }
}