:root {
    --accent: #0066cc;
    --accent-hover: #0052a3;
    --accent-light: #eaf3ff;
    --accent-soft: rgba(0, 102, 204, 0.08);
    --text-main: #16181d;
    --text-muted: #6b7280;
    --text-soft: #94a3b8;
    --bg-body: #f3f6fb;
    --card-bg: #ffffff;
    --card-dark: #0d1117;
    --border-color: #e6ebf2;
    --border-dark: rgba(255,255,255,0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-xs: 10px;
    --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 30px 80px rgba(2, 6, 23, 0.18);
    --shadow-hover: 0 22px 48px rgba(0, 102, 204, 0.14);
    --transition: all 0.28s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(180deg, #f7f9fd 0%, var(--bg-body) 100%);
    color: var(--text-main);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.65;
}

/* reading progress */
#reading-progress {
    position: fixed;
    inset: 0 auto auto 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #4f8cff);
    z-index: 10000;
    transition: width 0.1s ease;
}

/* layout */
.article-shell {
    max-width: 1280px;
    margin: 24px auto 42px;
    padding: 0 20px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    color: var(--text-muted);
    font-size: 14px;
    flex-wrap: wrap;
}

.breadcrumbs a {
    color: var(--accent);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

.article-hero {
    position: relative;
    min-height: 430px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: #000;
    margin-bottom: 28px;
}

.article-hero-media {
    position: absolute;
    inset: 0;
}

.article-hero-media img,
.article-hero-media .hero-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-fallback {
    background: linear-gradient(135deg, var(--accent), #764ba2);
}

.article-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(4, 9, 18, 0.92) 0%, rgba(4, 9, 18, 0.45) 42%, rgba(4, 9, 18, 0.08) 100%);
}

.article-hero-content {
    position: relative;
    z-index: 2;
    min-height: 430px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 34px;
    color: #fff;
}

.hero-title {
    max-width: 900px;
    font-size: clamp(1.85rem, 4vw, 3rem);
    line-height: 1.1;
    font-weight: 800;
    margin-bottom: 16px;
    text-shadow: 0 2px 14px rgba(0,0,0,0.28);
}

.hero-meta {
    display: flex;
    gap: 16px 20px;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.92);
    font-size: 14px;
}

.hero-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
}

.main-column {
    min-width: 0;
}

.sidebar-column {
    min-width: 0;
}

.content-card,
.sidebar-card {
    background: var(--card-bg);
    border: 1px solid rgba(230, 235, 242, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.content-card {
    padding: 30px;
}

.sidebar-card {
    padding: 22px;
}

.article-body-modern {
    font-size: 1.08rem;
    color: #2f3640;
}

.article-body-modern h2,
.article-body-modern h3,
.article-body-modern h4 {
    color: #111827;
    line-height: 1.28;
    margin: 1.8rem 0 1rem;
}

.article-body-modern ul,
.article-body-modern ol {
    padding-left: 1.35rem;
    margin-bottom: 1.3rem;
}

.article-body-modern blockquote {
    margin: 1.4rem 0;
    padding: 16px 18px;
    border-left: 4px solid var(--accent);
    background: var(--accent-soft);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.article-body-modern img,
.article-body-modern iframe,
.article-body-modern table {
    max-width: 100%;
}

.article-body-modern a {
    color: var(--accent);
}

.article-section {
    margin-top: 30px;
}

.section-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: 30px 0 22px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #111827;
}

.section-title i {
    color: var(--accent);
}

/* gallery */
.gallery-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.gallery-count {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 600;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
}

.gallery-item {
    position: relative;
    display: block;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #0e1117;
    aspect-ratio: 16 / 10;
    cursor: pointer;
    isolation: isolate;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 102, 204, 0.24);
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.62), rgba(0,0,0,0.10));
    z-index: 1;
    transition: var(--transition);
}

.gallery-item:hover::after {
    background: linear-gradient(to top, rgba(0,0,0,0.72), rgba(0,0,0,0.14));
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    color: #fff;
}

.gallery-item-label {
    max-width: calc(100% - 54px);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.16);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.gallery-item.video-card {
    appearance: none;
    padding: 0;
    text-align: left;
    font: inherit;
    background: #0e1117;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.gallery-item.video-card video {
    pointer-events: none;
}

/* sidebar */
.sidebar-stack {
    position: sticky;
    top: 20px;
    display: grid;
    gap: 18px;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.08rem;
    font-weight: 800;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.widget-title i {
    color: var(--accent);
}

.share-buttons {
    display: grid;
    gap: 10px;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 13px 14px;
    border: none;
    width: 100%;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-2px);
}

.share-btn.tg {
    background: #e5f6ff;
    color: #0088cc;
}

.share-btn.fb {
    background: #edf3ff;
    color: #1877f2;
}

.share-btn.copy {
    background: #f3f4f6;
    color: #374151;
}

.quick-info {
    display: grid;
    gap: 12px;
}

.quick-info-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    background: #f8fafc;
    border: 1px solid var(--border-color);
    font-size: 14px;
}

.quick-info-item span:first-child {
    color: var(--text-muted);
    font-weight: 600;
}

.quick-info-item span:last-child {
    color: var(--text-main);
    font-weight: 700;
    text-align: right;
}

.similar-news-grid {
    display: grid;
    gap: 14px;
}

.similar-news-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: inherit;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.similar-news-item:hover {
    background: #f7f9fc;
}

.similar-news-image {
    width: 78px;
    height: 78px;
    flex: 0 0 78px;
    border-radius: var(--radius-sm);
    object-fit: cover;
}

.similar-news-info h4 {
    color: var(--text-main);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 6px;
}

.similar-news-info span {
    color: var(--text-muted);
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.back-link-box {
    text-align: center;
}

.back-link-box a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 800;
}

.back-link-box a:hover {
    text-decoration: underline;
}

/* modal player */
.video-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(2, 6, 23, 0.84);
    backdrop-filter: blur(10px);
}

.video-modal.active {
    display: flex;
}

.video-modal-dialog {
    width: min(1120px, 100%);
    overflow: hidden;
    border-radius: 24px;
    background: var(--card-dark);
    border: 1px solid var(--border-dark);
    box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}

.video-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.video-modal-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.35;
}

.close-modal {
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

.close-modal:hover {
    background: var(--accent);
}

.video-modal-body {
    background: #000;
}

.video-modal-body video {
    width: 100%;
    display: block;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* plyr */
.plyr {
    --plyr-color-main: var(--accent);
    --plyr-video-control-color: #ffffff;
    --plyr-video-control-color-hover: #ffffff;
    --plyr-control-radius: 12px;
    --plyr-control-spacing: 10px;
    --plyr-menu-background: rgba(17, 24, 39, 0.98);
    --plyr-menu-color: #fff;
    --plyr-tooltip-background: rgba(17, 24, 39, 0.98);
    --plyr-tooltip-color: #fff;
    --plyr-range-thumb-height: 14px;
    --plyr-range-track-height: 6px;
}

.plyr--video {
    background: #000;
}

.plyr__control--overlaid {
    background: rgba(0, 102, 204, 0.92);
    box-shadow: 0 10px 30px rgba(0, 102, 204, 0.3);
}

.plyr__control--overlaid:hover {
    background: var(--accent-hover);
}

/* back to top */
.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #4f8cff);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 102, 204, 0.28);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 9999;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
}

/* animations */
.fade-in {
    animation: fadeIn 0.45s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* responsive */
@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-stack {
        position: static;
    }
}

@media (max-width: 768px) {
    .article-shell {
        padding: 0 14px;
        margin-top: 16px;
    }

    .article-hero {
        min-height: 320px;
        border-radius: var(--radius-lg);
    }

    .article-hero-content {
        min-height: 320px;
        padding: 22px 18px 18px;
    }

    .hero-title {
        font-size: 1.7rem;
    }

    .content-card,
    .sidebar-card {
        border-radius: var(--radius-lg);
    }

    .content-card {
        padding: 20px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .gallery-item {
        border-radius: 14px;
        aspect-ratio: 16 / 11;
    }

    .gallery-item-overlay {
        padding: 10px;
    }

    .gallery-item-label {
        max-width: calc(100% - 48px);
        font-size: 0.78rem;
        padding: 7px 10px;
    }

    .video-modal {
        padding: 10px;
    }

    .video-modal-dialog {
        border-radius: 18px;
    }
}

@media (max-width: 520px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-item {
        aspect-ratio: 16 / 9;
    }

    .gallery-item-label {
        font-size: 0.82rem;
    }

    .similar-news-image {
        width: 72px;
        height: 72px;
        flex-basis: 72px;
    }
}
