/* ===== Blog Detail Shared Styles ===== */

/* ===== Reading Progress ===== */
.reading-progress {
    position: fixed;
    top: 0; left: 0;
    height: 3px;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    z-index: 999;
    transition: width 0.1s linear;
}

/* ===== Detail Page Styles ===== */
.detail-page-hero {
    min-height: 22vh;
    background:
        radial-gradient(circle at 85% 10%, rgba(122,162,255,0.12) 0%, transparent 45%),
        linear-gradient(180deg, #ffffff 0%, var(--light-secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.detail-page-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light), var(--primary));
}
.detail-hero-content {
    position: relative;
    z-index: 1;
    padding: 116px 5% 44px;
    max-width: 820px;
}
.detail-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    font-size: 0.82rem;
    color: var(--text-light);
    margin-bottom: 18px;
}
.detail-breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.3s ease;
}
.detail-breadcrumb a:hover { color: var(--primary); }
.detail-breadcrumb .sep { opacity: 0.5; }
.detail-hero-content .detail-category {
    display: inline-block;
    padding: 5px 16px;
    background: linear-gradient(135deg, rgba(43,92,230, 0.1), rgba(122,162,255, 0.1));
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.detail-hero-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text-dark);
    margin-bottom: 22px;
    line-height: 1.35;
}
.detail-hero-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    font-size: 0.9rem;
    color: var(--text-light);
    flex-wrap: wrap;
}
.detail-hero-meta .author {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 500;
    color: var(--text-dark);
}
.detail-hero-meta .author .avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 600;
}
.detail-hero-meta .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--border-light); }

/* ===== Detail Content ===== */
.detail-content-section {
    padding: 44px 5% 60px;
    background: var(--light-bg);
}
.detail-content-container {
    max-width: 760px;
    margin: 0 auto;
}
.detail-cover {
    width: 100%;
    height: 480px;
    margin-bottom: 44px;
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border: 1px solid var(--border-light);
    border-radius: 20px;
    background: linear-gradient(135deg, #f7f9fd 0%, #eef3fb 50%, #f7f9fd 100%);
}
.detail-cover img,
.detail-cover video {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(21, 38, 72, 0.14);
}
@media (max-width: 768px) {
    .detail-cover {
        height: 320px;
        padding: 16px;
        margin-bottom: 32px;
    }
}
.detail-body {
    font-size: 1.08rem;
    color: var(--text-dark);
    line-height: 2;
}
.detail-body > p:first-of-type::first-letter {
    font-size: 3.2rem;
    font-weight: 700;
    float: left;
    line-height: 1;
    padding: 6px 12px 0 0;
    color: var(--primary);
}
.detail-body p {
    margin-bottom: 22px;
}
.detail-body h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 44px 0 18px;
    padding-left: 16px;
    border-left: 4px solid var(--primary);
    line-height: 1.4;
}
.detail-body h3 {
    font-size: 1.22rem;
    font-weight: 600;
    color: var(--text-dark);
    margin: 32px 0 14px;
}
.detail-body ul, .detail-body ol {
    margin: 16px 0 22px;
    padding-left: 24px;
}
.detail-body li {
    margin-bottom: 10px;
}
.detail-body a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.detail-body blockquote {
    margin: 28px 0;
    padding: 4px 0 4px 22px;
    border-left: 3px solid var(--primary-light);
    color: var(--text-light);
    font-style: italic;
    font-size: 1.02rem;
}
.detail-body .highlight-box {
    background: linear-gradient(135deg, rgba(43,92,230, 0.06), rgba(122,162,255, 0.06));
    border: 1px solid rgba(43,92,230, 0.16);
    border-radius: 14px;
    padding: 24px 28px;
    margin: 30px 0;
    line-height: 1.85;
    font-size: 1rem;
}
.detail-body .highlight-box strong {
    color: var(--primary-dark);
}
.detail-body img {
    max-width: 100%;
    border-radius: 14px;
    margin: 24px 0;
    box-shadow: var(--shadow-sm);
}

/* ===== Share Row ===== */
.detail-share {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 40px;
    padding-top: 28px;
    border-top: 1px solid var(--border-light);
}
.detail-share span {
    font-size: 0.9rem;
    color: var(--text-light);
}
.detail-share .share-btn {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: #fff;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.28s ease;
    text-decoration: none;
}
.detail-share .share-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

/* ===== Related ===== */
.related-section {
    padding: 64px 5% 84px;
    background: var(--light-secondary);
}
.related-container {
    max-width: 1140px;
    margin: 0 auto;
}
.related-container h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 30px;
    text-align: center;
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}
.related-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    text-decoration: none;
    color: inherit;
    transition: all 0.32s ease;
}
.related-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: rgba(43,92,230,0.3);
}
.related-card-thumb {
    width: 100%;
    height: 260px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    border-bottom: 1px solid var(--border-light);
    background: linear-gradient(135deg, #f7f9fd 0%, #eef3fb 50%, #f7f9fd 100%);
}
.related-card-thumb img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 22px rgba(21, 38, 72, 0.14);
    transition: transform 0.5s ease;
}
.related-card:hover .related-card-thumb img {
    transform: scale(1.04);
}
.related-card-thumb .cat-tag {
    position: absolute;
    top: 12px; left: 12px;
    background: rgba(255,255,255,0.92);
    color: var(--primary-dark);
    padding: 3px 11px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
}
.related-card-body {
    padding: 18px 18px 20px;
}
.related-card-body .related-date {
    font-size: 0.78rem;
    color: var(--text-light);
    margin-bottom: 8px;
}
.related-card-body h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}
.related-card:hover .related-card-body h4 {
    color: var(--primary-dark);
}

@media (max-width: 860px) {
    .related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .detail-hero-content h1 { font-size: 1.7rem; }
    .detail-hero-content { padding: 96px 5% 36px; }
    .detail-body { font-size: 1rem; }
    .related-grid { grid-template-columns: 1fr; }
    .related-card-thumb { height: 220px; padding: 12px; }
}

/* ===== 4G device article: taller mobile cover ===== */
@media (max-width: 768px) {
    .detail-cover--tall { height: 340px; }
}