
:root {
    --font-base: 'Manrope', 'Segoe UI', sans-serif;
    --brand-red: #dd0031;
    --brand-white: #ffffff;
    --brand-blue: #1976d2;
    --bg: #ffffff;
    --surface: #ffffff;
    --text: #092047;
    --muted: #1e5aa8;
    --line: #c8dcff;
    --accent: #dd0031;
    --accent-dark: #b3002a;
    --blue-soft: #eef5ff;
    --blue-strong: #0d47a1;
    --red-soft: #fff0f4;
    --shadow-sm: 0 8px 24px rgba(25, 118, 210, 0.12);
    --shadow-md: 0 18px 40px rgba(13, 71, 161, 0.2);
}

html[data-theme='dark'] {
    --bg: #04142f;
    --surface: #071a3d;
    --text: #f8fbff;
    --muted: #9bc3ff;
    --line: #1b4f97;
    --accent: #dd0031;
    --accent-dark: #ff5c7d;
    --blue-soft: #0a275c;
    --blue-strong: #7ab5ff;
    --red-soft: #2d0f20;
    --shadow-sm: 0 8px 24px rgba(0, 10, 30, 0.35);
    --shadow-md: 0 18px 40px rgba(0, 10, 30, 0.46);
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-base);
    background: radial-gradient(circle at 18% -10%, #eef5ff 0%, var(--bg) 45%, #fff5f8 100%);
    color: var(--text);
    font-size: clamp(0.94rem, 0.9rem + 0.18vw, 1rem);
    line-height: 1.6;
    overflow-x: hidden;
}

body > :not(.ai-bubbles) {
    position: relative;
    z-index: 1;
}

.ai-bubbles {
    position: fixed;
    inset: -14vh -8vw 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    transform: translate3d(0, calc(var(--bubble-scroll, 0px) * -0.35), 0);
    will-change: transform;
}

.ai-bubbles__item {
    position: absolute;
    bottom: -22vh;
    border-radius: 50%;
    border: 1px solid rgba(25, 118, 210, 0.22);
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.2) 40%, rgba(25, 118, 210, 0.2) 100%);
    box-shadow:
        inset 0 0 20px rgba(255, 255, 255, 0.3),
        0 12px 30px rgba(13, 71, 161, 0.14);
    opacity: 0;
    animation: bubbleFloat var(--dur, 22s) linear infinite;
    animation-delay: var(--delay, 0s);
    will-change: transform, opacity;
}

html[data-theme='dark'] .ai-bubbles__item {
    border-color: rgba(122, 181, 255, 0.26);
    background:
        radial-gradient(circle at 30% 28%, rgba(207, 228, 255, 0.34), rgba(122, 181, 255, 0.1) 44%, rgba(4, 20, 47, 0.4) 100%);
    box-shadow:
        inset 0 0 22px rgba(155, 195, 255, 0.14),
        0 14px 34px rgba(0, 10, 30, 0.3);
}

@keyframes bubbleFloat {
    0% {
        opacity: 0;
        transform: translate3d(0, 0, 0) scale(var(--scale, 1));
    }
    10% {
        opacity: 0.46;
    }
    78% {
        opacity: 0.36;
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--drift-x, 0px), -145vh, 0) scale(calc(var(--scale, 1) * 1.08));
    }
}

img,
iframe {
    max-width: 100%;
}

.container {
    position: relative;
}

html[data-theme='dark'] body {
    background: radial-gradient(circle at 18% -10%, #0d2f6a 0%, var(--bg) 46%, #160716 100%);
}

.tag-pill {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    transition: all 0.25s ease;
}

/* Navbar */
.navbar {
    box-shadow: 0 1px 0 rgba(25, 118, 210, 0.12);
    background: rgba(255, 255, 255, 0.96) !important;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(25, 118, 210, 0.18);
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.navbar-toggler {
    border-color: rgba(25, 118, 210, 0.2);
    border-radius: 12px;
    padding: 0.35rem 0.55rem;
}

.navbar-toggler:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(25, 118, 210, 0.15);
}

html[data-theme='dark'] .navbar {
    background: rgba(5, 20, 47, 0.94) !important;
    border-bottom-color: rgba(122, 181, 255, 0.25);
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--accent);
    background: var(--red-soft);
    border: 1px solid #ff9ab1;
    border-radius: 8px;
    min-width: 34px;
    height: 28px;
    line-height: 1;
}

html[data-theme='dark'] .brand-mark {
    background: #2e1020;
    border-color: #b13c5e;
    color: #ff8daa;
}

html[data-theme='dark'] .brand-name {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: #ffffff;
    text-shadow: none;
    animation: none;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: 0.01em;
    color: var(--text) !important;
    font-size: 1.02rem;
    text-transform: none;
}

.brand-name {
    font-weight: 800;
    color: var(--brand-blue);
    background: linear-gradient(110deg, var(--brand-red) 0%, var(--brand-red) 38%, var(--brand-white) 50%, var(--brand-blue) 62%, var(--brand-blue) 100%);
    background-size: 220% 220%;
    animation: brandShift 6s ease-in-out infinite;
    text-shadow: 0 0 0.35px rgba(0, 0, 0, 0.45);
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .brand-name {
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
    }
}

@keyframes brandShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce) {
    .brand-name {
        animation: none;
    }

    .ai-bubbles,
    .ai-bubbles__item {
        animation: none !important;
        transform: none !important;
    }

    .ai-bubbles__item {
        opacity: 0.2;
    }
}

.nav-link {
    color: var(--muted) !important;
    font-weight: 700;
    font-size: 0.93rem;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
}

.nav-link:hover {
    color: var(--accent) !important;
}

.nav-cta {
    border-radius: 999px;
    background: var(--accent);
    color: #ffffff;
    border: 1px solid var(--accent);
    font-weight: 700;
    padding: 0.45rem 0.95rem;
    margin-top: 0.2rem;
}

.nav-cta:hover {
    background: var(--accent-dark);
    color: #ffffff;
    text-decoration: none;
}

.theme-toggle {
    border-radius: 999px;
    border: 1px solid #b9d3ff;
    color: var(--text);
    background: rgba(238, 245, 255, 0.92);
    font-weight: 700;
    padding: 0.42rem 0.9rem;
}

.theme-toggle:hover {
    border-color: #7aaeff;
    color: var(--text);
    background: #eef5ff;
}

html[data-theme='dark'] .theme-toggle {
    border-color: #2f66b7;
    background: #0a275c;
    color: #f8fbff;
}

html[data-theme='dark'] .theme-toggle:hover {
    background: #113678;
    border-color: #7ab5ff;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #ffffff 0%, #eef5ff 62%, #fff2f6 100%);
    padding: 78px 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 46px;
}

html[data-theme='dark'] .hero {
    background: linear-gradient(135deg, #071a3d 0%, #0c2c63 100%);
}

.hero-home {
    position: relative;
    background-image: radial-gradient(circle at 88% 16%, rgba(221, 0, 49, 0.2) 0%, rgba(221, 0, 49, 0) 44%), radial-gradient(circle at 10% 82%, rgba(25, 118, 210, 0.24) 0%, rgba(25, 118, 210, 0) 48%), linear-gradient(138deg, #eaf2ff 0%, #dbe9ff 44%, #ffdbe6 100%);
    background-size: cover;
    background-position: center;
    color: #0f2f67;
}

.hero-home::after {
    content: '';
    position: absolute;
    inset: auto -10% -58px auto;
    width: 360px;
    height: 130px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(25, 118, 210, 0.18), rgba(221, 0, 49, 0.16));
    transform: rotate(-8deg);
    pointer-events: none;
}

.hero-home .lead,
.hero-home h1 {
    color: #0f2f67;
}

.hero-home .hero-badge {
    background: rgba(255, 255, 255, 0.72);
    color: #0d3272;
    border: 1px solid rgba(28, 96, 187, 0.35);
}

.hero-home-inner {
    min-height: 360px;
    row-gap: 24px;
}

.hero-copy {
    max-width: 680px;
}

.hero-copy h1,
.hero-copy .lead {
    overflow-wrap: anywhere;
}

@supports (text-wrap: balance) {
    .hero-copy h1,
    .hero-copy .lead {
        text-wrap: balance;
        overflow-wrap: normal;
    }
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.hero-highlights {
    color: #193f7e;
    font-size: 0.9rem;
    font-size: clamp(0.84rem, 0.8rem + 0.2vw, 0.92rem);
}

html[data-theme='dark'] .hero-home .hero-highlights,
html[data-theme='dark'] .hero-home .hero-highlights li {
    color: #ffffff !important;
}

.hero-highlights li + li {
    margin-top: 7px;
}

.hero-panel {
    background: linear-gradient(155deg, rgba(238, 246, 255, 0.92) 0%, rgba(255, 235, 242, 0.92) 100%);
    border: 1px solid rgba(45, 116, 211, 0.28);
    border-radius: 18px;
    padding: 22px;
    box-shadow: 0 16px 34px rgba(21, 62, 123, 0.16);
}

.hero-panel-kicker {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    font-size: 0.74rem;
    color: #2c5ca4;
}

.hero-panel-title {
    color: #a8113c;
    font-size: 1.22rem;
    font-size: clamp(1.12rem, 1.02rem + 0.5vw, 1.3rem);
    font-weight: 800;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.hero-stat-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(28, 96, 187, 0.2);
    border-radius: 12px;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
}

.hero-stat-value {
    color: #143f82;
    font-size: 1rem;
    font-size: clamp(0.98rem, 0.9rem + 0.35vw, 1.08rem);
    font-weight: 800;
    line-height: 1.15;
}

.hero-stat-label {
    color: #3a5f97;
    font-size: 0.74rem;
    font-size: clamp(0.7rem, 0.66rem + 0.22vw, 0.78rem);
    margin-top: 4px;
}

.hero h1 {
    font-weight: 800;
    font-size: 2.2rem;
    font-size: clamp(2rem, 1.75rem + 1.2vw, 2.45rem);
    max-width: 760px;
    margin: 0 auto;
}

.hero .lead {
    color: var(--muted);
    font-size: 1.04rem;
    font-size: clamp(1rem, 0.95rem + 0.35vw, 1.12rem);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-badge {
    background: var(--red-soft);
    color: var(--accent);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
}

.btn-primary {
    background-color: var(--accent);
    border-color: var(--accent);
    border-radius: 999px;
}

.btn-primary:hover {
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.btn-outline-primary {
    border-radius: 999px;
    border-color: #9ec5ff;
    color: var(--blue-strong);
}

.btn-outline-primary:hover {
    background: #eef5ff;
    border-color: #5ea0ff;
    color: var(--blue-strong);
}

/* Section title */
.section-title {
    font-size: 1.28rem;
    font-size: clamp(1.2rem, 1.08rem + 0.45vw, 1.34rem);
    font-weight: 800;
}

/* Cards */
.card-blog {
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    background: var(--surface);
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.card-blog::after {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.95rem;
    opacity: 0.7;
    -webkit-filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.18));
}

.card-blog:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-blog:focus,
.card-blog:focus-visible {
    outline: 3px solid #1d73d2;
    outline-offset: 2px;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-blog img {
    height: 170px;
    object-fit: cover;
}

.card-blog .card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}

.card-title {
    font-size: 1rem;
    font-size: clamp(0.98rem, 0.92rem + 0.3vw, 1.04rem);
    font-weight: 800;
    min-height: 54px;
    line-height: 1.35;
}

.card-text {
    font-size: 0.86rem;
    font-size: clamp(0.84rem, 0.8rem + 0.22vw, 0.9rem);
    color: var(--muted);
}

.tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag::before {
    content: '🤖 ';
}

.card-blog-horizontal img {
    height: 210px;
}

.home-section {
    border-bottom: 1px solid rgba(25, 118, 210, 0.14);
    padding-bottom: 12px;
}

.main-layout {
    row-gap: 24px;
}

.content-column {
    min-width: 0;
}

.home-section:last-child {
    border-bottom: 0;
}

/* Sidebar */
.sidebar-widget {
    background: var(--surface);
    padding: 20px;
    border-radius: 14px;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.sidebar-column {
    min-width: 0;
}

.widget-title {
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    color: var(--text);
}

.widget-title::before {
    display: inline-block;
    margin-right: 6px;
}

.sidebar-widget.widget-author .widget-title::before {
    content: '👤';
}

.sidebar-widget.widget-search .widget-title::before {
    content: '🔎';
}

.sidebar-widget.widget-tags .widget-title::before {
    content: '🏷️';
}

.sidebar-widget.widget-social .widget-title::before {
    content: '🌍';
}

.sidebar-widget.widget-related .widget-title::before {
    content: '🧩';
}

.sidebar-widget p,
.sidebar-widget li,
.sidebar-widget a {
    overflow-wrap: anywhere;
}

.author-img {
    width: 82px;
    height: 82px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid #d2e5ff;
}

.list-cat {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.92rem;
}

.list-cat li + li {
    margin-top: 8px;
}

.list-cat a {
    color: var(--muted);
    text-decoration: none;
    display: block;
}

.list-cat a::before {
    content: '👉 ';
}

.list-cat a:hover {
    color: var(--accent);
    transform: translateX(2px);
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-pill {
    display: inline-flex;
    align-items: center;
    background: var(--red-soft);
    color: var(--accent-dark);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.78rem;
    text-decoration: none;
    font-weight: 700;
}

.tag-pill:hover {
    background: #ffd9e4;
    text-decoration: none;
    color: var(--accent-dark);
}

/* Footer */
footer {
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 34px 0;
    margin-top: 52px;
}

/* Light entrance animation */
.reveal {
    opacity: 0;
    transform: translateY(8px);
    animation: revealUp 0.5s ease forwards;
}

.reveal:nth-child(2) { animation-delay: 0.08s; }
.reveal:nth-child(3) { animation-delay: 0.14s; }

@keyframes revealUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 991.98px) {
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    .navbar {
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    .navbar-collapse {
        margin-top: 0.7rem;
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: 12px;
        padding: 0.75rem;
        box-shadow: var(--shadow-sm);
    }

    .navbar-brand {
        max-width: calc(100% - 64px);
    }

    .nav-link {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .navbar .navbar-nav {
        width: 100%;
    }

    .navbar .nav-item {
        width: 100%;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .theme-toggle,
    .nav-cta {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .nav-cta {
        margin-top: 0.6rem;
        display: inline-flex;
    }

    .hero {
        padding: 60px 0;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .card-blog-horizontal img {
        height: 180px;
    }

    .hero-home-inner {
        min-height: 0;
    }

    .hero-panel {
        max-width: 540px;
        margin: 0 auto;
    }

    .sidebar-column {
        margin-top: 4px;
    }

    .sidebar-widget:last-child {
        margin-bottom: 0;
    }

    .article-title {
        font-size: 2rem;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.97rem;
    }

    .hero {
        text-align: left !important;
        padding: 48px 0;
    }

    .hero h1 {
        font-size: 1.65rem;
        margin-left: 0;
    }

    .hero .lead {
        margin-left: 0;
    }

    .section-title-wrap {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 8px;
    }

    .section-title-wrap > * {
        width: 100%;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .btn {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 10px;
    }

    .hero-panel {
        padding: 18px;
        border-radius: 14px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .hero-stat-card {
        flex-direction: row;
        align-items: baseline;
        justify-content: space-between;
    }

    .hero-stat-label {
        text-align: right;
        margin-top: 0;
        margin-left: 10px;
    }

    .article-header {
        padding: 28px 0;
    }

    .breadcrumb {
        flex-wrap: wrap;
        row-gap: 4px;
    }

    .content-area,
    .detail-comment-box,
    .filter-panel,
    .sidebar-widget,
    .empty-state {
        border-radius: 12px;
    }

    .filter-panel .row > [class*='col-'] {
        margin-bottom: 12px;
    }

    .filter-panel .row > [class*='col-']:last-child {
        margin-bottom: 0;
    }

    .sidebar-widget {
        padding: 16px;
    }

    .related-slider-section .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }

    .related-slider-section .d-flex a {
        align-self: flex-start;
    }
}

/* Detail page */
.article-header {
    padding: 40px 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    margin-bottom: 36px;
}

.breadcrumb {
    background: linear-gradient(135deg, rgba(238, 245, 255, 0.92), rgba(255, 240, 244, 0.86));
    border: 1px solid rgba(25, 118, 210, 0.18);
    border-radius: 999px;
    padding: 8px 14px;
    margin-bottom: 0;
    font-size: 0.85rem;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.breadcrumb a {
    color: var(--muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--accent-dark);
}

html[data-theme='dark'] .breadcrumb {
    background: linear-gradient(135deg, rgba(10, 39, 92, 0.95), rgba(59, 17, 37, 0.72));
    border-color: rgba(122, 181, 255, 0.32);
}

.breadcrumb-item.active {
    color: var(--accent-dark);
}

.article-title {
    font-weight: 800;
    font-size: 2rem;
    font-size: clamp(1.85rem, 1.6rem + 1vw, 2.2rem);
    color: var(--text);
    max-width: 860px;
}

.meta-info {
    color: var(--muted);
    font-size: 0.86rem;
    font-size: clamp(0.82rem, 0.78rem + 0.2vw, 0.9rem);
}

.content-area {
    background: var(--surface);
    padding: 34px;
    border-radius: 14px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.content-area > *:last-child {
    margin-bottom: 0;
}

.featured-image {
    border-radius: 12px;
    margin-bottom: 30px;
    width: 100%;
    height: auto;
}

.content-area h3 {
    font-size: 1.35rem;
}

.content-area pre {
    background: #0f1b2d;
    color: #d8e8ff;
    padding: 20px;
    border-radius: 10px;
    font-family: 'Fira Code', monospace;
    font-size: 0.87rem;
    overflow-x: auto;
    margin: 30px 0;
}

.content-area pre code {
    white-space: pre;
    word-break: normal;
}

.content-area code {
    color: #9cc8ff;
}

.video-container {
    margin: 36px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.detail-content-column,
.detail-sidebar-column {
    min-width: 0;
}

.detail-comment-box {
    border: 1px solid var(--line);
}

.long-article {
    max-width: 100%;
}

.article-section + .article-section {
    margin-top: 2rem;
}

.article-section-title {
    font-size: 1.3rem;
    font-size: clamp(1.22rem, 1.12rem + 0.52vw, 1.42rem);
    font-weight: 800;
    margin-bottom: 0.8rem;
}

.article-toc {
    border: 1px solid rgba(25, 118, 210, 0.25);
    background: linear-gradient(145deg, #f5f9ff, #fff7fa);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin: 1.2rem 0 1.6rem;
}

.article-toc-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.6rem;
    font-weight: 800;
}

.article-toc-list {
    padding-left: 1.1rem;
}

.article-toc a {
    color: var(--blue-strong);
    text-decoration: none;
    font-weight: 600;
}

.article-toc a:hover {
    text-decoration: underline;
}

.article-callout {
    margin-top: 1rem;
    border-left: 4px solid #1d73d2;
    background: #edf5ff;
    border-radius: 8px;
    padding: 0.8rem 0.9rem;
    color: #173f79;
}

.article-note {
    margin-top: 1.2rem;
    border: 1px solid rgba(221, 0, 49, 0.25);
    background: #fff4f7;
    border-radius: 10px;
    padding: 0.9rem 1rem;
}

.article-note-title {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 0.6rem;
    color: #8a0f37;
}

.article-checklist {
    margin-bottom: 0;
    padding-left: 0;
    list-style: none;
}

.article-checklist li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.45rem;
}

.article-checklist li::before {
    content: '✓';
    position: absolute;
    left: 0;
    top: 0;
    color: #0c8a47;
    font-weight: 800;
}

html[data-theme='dark'] .article-toc {
    background: linear-gradient(145deg, #0b295f, #321225);
    border-color: #2f66b7;
}

html[data-theme='dark'] .article-toc a {
    color: #b8d7ff;
}

html[data-theme='dark'] .article-callout {
    background: #0b2e67;
    border-left-color: #7ab5ff;
    color: #d7e9ff;
}

html[data-theme='dark'] .article-note {
    background: #3a1125;
    border-color: #b13c5e;
}

html[data-theme='dark'] .article-note-title {
    color: #ffc3d3;
}

/* Categories page */
.categories-header {
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 86% 18%, rgba(221, 0, 49, 0.12) 0%, rgba(221, 0, 49, 0) 40%),
        radial-gradient(circle at 12% 82%, rgba(25, 118, 210, 0.16) 0%, rgba(25, 118, 210, 0) 46%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(238, 245, 255, 0.95));
    border-bottom: 1px solid rgba(25, 118, 210, 0.2);
}

.categories-header::after {
    content: '';
    position: absolute;
    inset: auto -12% -42px auto;
    width: 320px;
    height: 110px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(25, 118, 210, 0.1), rgba(221, 0, 49, 0.08));
    transform: rotate(-8deg);
    pointer-events: none;
}

.categories-header .meta-info {
    max-width: 760px;
}

html[data-theme='dark'] .categories-header {
    background:
        radial-gradient(circle at 86% 18%, rgba(221, 0, 49, 0.22) 0%, rgba(221, 0, 49, 0) 42%),
        radial-gradient(circle at 12% 82%, rgba(122, 181, 255, 0.24) 0%, rgba(122, 181, 255, 0) 48%),
        linear-gradient(135deg, rgba(7, 26, 61, 0.95), rgba(10, 39, 92, 0.92));
    border-bottom-color: rgba(122, 181, 255, 0.35);
}

.filter-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 22px;
    box-shadow: var(--shadow-sm);
}

.filter-panel label {
    letter-spacing: 0.01em;
}

.filter-panel label[for='searchInput']::before {
    content: '🧠 ';
}

.filter-panel label[for='categoryFilter']::before {
    content: '🗂️ ';
}

.filter-panel label[for='themeFilter']::before {
    content: '🎯 ';
}

.input-group-text {
    background: var(--surface);
    border-color: #bfd6ff;
    color: var(--muted);
}

.filter-panel .form-control,
.filter-panel .custom-select {
    border-color: #bfd6ff;
    box-shadow: none;
}

.filter-panel .form-control:focus,
.filter-panel .custom-select:focus {
    border-color: #5ea0ff;
    box-shadow: 0 0 0 0.2rem rgba(221, 0, 49, 0.16);
}

#activeFilters {
    font-weight: 600;
}

#resultsCount::before {
    content: '📊 ';
}

#activeFilters::before {
    content: '⚙️ ';
}

#resetFilters {
    border-radius: 999px;
    font-weight: 700;
}

#resetFilters::before {
    content: '♻️ ';
}

.active-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 30px;
}

.active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #ff9ab1;
    background: var(--red-soft);
    color: #7f001d;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 700;
}

.active-filter-tag::before {
    content: '✨';
    line-height: 1;
}

.active-filter-tag span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.active-filter-tag button {
    border: none;
    background: transparent;
    color: #7f001d;
    font-weight: 800;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.active-filter-empty {
    color: var(--muted);
    font-size: 0.82rem;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-chip {
    border: 1px solid #bfd6ff;
    background: #ffffff;
    color: var(--muted);
    border-radius: 999px;
    padding: 0.42rem 0.95rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.filter-chip:hover {
    border-color: #5ea0ff;
    color: var(--blue-strong);
}

.filter-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
}

.empty-state {
    text-align: center;
    background: var(--surface);
    border: 1px dashed #91baff;
    border-radius: 14px;
    padding: 34px 16px;
}

.empty-state h3 {
    font-size: 1.2rem;
    font-weight: 800;
}

.empty-state p {
    margin-bottom: 0;
    color: var(--muted);
}

.related-slider-section {
    margin-top: 8px;
    margin-bottom: 28px;
}

.related-slider-section .section-title {
    max-width: 24rem;
}

.related-swiper {
    padding: 6px 2px 38px;
}

.related-slide-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    height: 100%;
}

html[data-theme='dark'] .input-group-text,
html[data-theme='dark'] .filter-panel .form-control,
html[data-theme='dark'] .filter-panel .custom-select,
html[data-theme='dark'] .detail-comment-box,
html[data-theme='dark'] .form-control,
html[data-theme='dark'] .custom-select {
    background: #0a275c;
    border-color: #2f66b7;
    color: var(--text);
}

html[data-theme='dark'] .active-filter-tag {
    background: #3b1125;
    border-color: #b13c5e;
    color: #ffe2ea;
}

html[data-theme='dark'] .active-filter-tag button {
    color: #ffd9e1;
}

html[data-theme='dark'] .form-control::placeholder {
    color: #9bc3ff;
}

html[data-theme='dark'] .text-muted {
    color: var(--muted) !important;
}

html[data-theme='dark'] .text-dark {
    color: var(--text) !important;
}

html[data-theme='dark'] .bg-light {
    background: #0a275c !important;
}

html[data-theme='dark'] .list-group-item,
html[data-theme='dark'] .list-cat a,
html[data-theme='dark'] a.text-decoration-none,
html[data-theme='dark'] .small,
html[data-theme='dark'] p,
html[data-theme='dark'] h1,
html[data-theme='dark'] h2,
html[data-theme='dark'] h3,
html[data-theme='dark'] h4,
html[data-theme='dark'] h5,
html[data-theme='dark'] h6 {
    color: var(--text);
}

html[data-theme='dark'] .meta-info,
html[data-theme='dark'] .card-text,
html[data-theme='dark'] .related-slide-body p,
html[data-theme='dark'] .empty-state p,
html[data-theme='dark'] .text-muted {
    color: var(--muted) !important;
}

html[data-theme='dark'] .related-swiper .swiper-button-next,
html[data-theme='dark'] .related-swiper .swiper-button-prev {
    background: #0a275c;
    border-color: #2f66b7;
}

html[data-theme='dark'] .related-swiper .swiper-pagination-bullet {
    background: #5a8fd6;
}

html[data-theme='dark'] .related-swiper .swiper-pagination-bullet-active {
    background: var(--accent);
}

.related-slide-image {
    width: 100%;
    height: 168px;
    object-fit: cover;
}

.related-slide-body {
    padding: 14px 16px 16px;
}

.related-slide-body h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-top: 8px;
    margin-bottom: 8px;
    color: var(--text);
}

.related-slide-body p {
    font-size: 0.87rem;
    margin-bottom: 0;
    color: var(--muted);
}

.related-swiper .swiper-button-next,
.related-swiper .swiper-button-prev {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid #bfd6ff;
    background: #fff;
    color: var(--accent-dark);
    box-shadow: 0 6px 18px rgba(25, 118, 210, 0.16);
}

.related-swiper .swiper-button-next::after,
.related-swiper .swiper-button-prev::after {
    font-size: 0.8rem;
    font-weight: 900;
}

.related-swiper .swiper-pagination-bullet {
    background: #a3c5ff;
    opacity: 1;
}

.related-swiper .swiper-pagination-bullet-active {
    background: var(--accent);
}

@media (max-width: 767.98px) {
    .article-title {
        font-size: 1.7rem;
    }

    .meta-info span {
        display: block;
        margin-left: 0 !important;
        margin-top: 6px;
    }

    .content-area {
        padding: 22px;
    }

    .content-area h3 {
        font-size: 1.2rem;
    }

    .filter-panel {
        padding: 18px;
    }

    .filter-panel .d-flex.justify-content-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 10px;
    }

    #resetFilters {
        width: 100%;
    }

    .related-slide-image {
        height: 150px;
    }

    .related-swiper .swiper-button-next,
    .related-swiper .swiper-button-prev {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .navbar-brand {
        font-size: 0.96rem;
    }

    .brand-name {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .brand-mark {
        min-width: 30px;
        height: 26px;
        font-size: 0.78rem;
    }

    .hero {
        margin-bottom: 30px;
    }

    .hero h1 {
        font-size: 1.48rem;
    }

    .hero .lead {
        font-size: 0.95rem;
    }

    .home-section {
        margin-bottom: 1.75rem !important;
    }

    .hero-panel-title {
        font-size: 1.1rem;
    }

    .hero-stat-card {
        gap: 10px;
    }

    .card-blog img,
    .card-blog-horizontal img {
        height: 160px;
    }

    .card-title {
        min-height: 0;
        font-size: 1rem;
    }

    .content-area {
        padding: 16px;
    }

    .content-area pre {
        padding: 14px;
        font-size: 0.79rem;
        margin-left: -2px;
        margin-right: -2px;
    }

    .filter-panel {
        padding: 14px;
    }

    .article-title {
        font-size: 1.48rem;
    }

    .related-swiper {
        padding-bottom: 30px;
    }
}
