/*
Theme Name: Sndow CMS Default Theme
Description: Sndow CMS 官方默认主题，内容优先、清爽稳定的通用站点样式。
Version: 1.2.0
Author: Sndow Team
*/

:root {
    --sd-primary: #6366f1;
    --sd-primary-dark: #4f46e5;
    --sd-primary-rgb: 99, 102, 241;
    --sd-accent: #6366f1;
    --sd-bg: #f3f4f6;
    --sd-surface: #ffffff;
    --sd-surface-muted: #f1f4f9;
    --sd-text-main: #172033;
    --sd-text-muted: #667085;
    --sd-border: #edf0f5;
    --sd-border-strong: #dbe2ea;
    --sd-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 1px 2px -1px rgba(0, 0, 0, 0.08);
    --sd-shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.09), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
    --sd-soft-shadow: 0 1px 2px rgba(15, 23, 42, 0.035), 0 8px 22px rgba(15, 23, 42, 0.035);
    --sd-soft-shadow-hover: 0 2px 5px rgba(15, 23, 42, 0.05), 0 12px 28px rgba(15, 23, 42, 0.055);
    --sd-radius: 12px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--sd-bg);
    color: var(--sd-text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 14px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a {
    color: var(--sd-primary);
    text-decoration: none;
    transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

a:hover {
    color: var(--sd-primary-dark);
}

img {
    max-width: 100%;
}

.container {
    max-width: 1180px;
}

.content-area {
    min-width: 0;
}

/* Header */
.navbar {
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1px solid var(--sd-border);
    padding: 0.55rem 0;
    box-shadow: none !important;
}

.navbar-brand {
    color: var(--sd-text-main) !important;
    font-size: 1rem;
    font-weight: 750;
    letter-spacing: 0;
}

.navbar-brand img {
    max-height: 28px;
}

.navbar-brand i {
    color: var(--sd-primary);
}

.navbar-toggler {
    color: var(--sd-text-main);
}

.navbar-nav {
    align-items: center;
}

.nav-link {
    color: var(--sd-text-muted) !important;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.34rem 0.58rem !important;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link.active,
.dropdown-item.active {
    color: var(--sd-primary) !important;
    background: rgba(var(--sd-primary-rgb), 0.08);
}

.dropdown-menu {
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius) !important;
    box-shadow: var(--sd-shadow-md);
    padding: 0.35rem;
}

.dropdown-item {
    color: var(--sd-text-main);
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.45rem 0.65rem;
}

.dropdown-item:hover {
    color: var(--sd-primary);
    background: rgba(var(--sd-primary-rgb), 0.08);
}

main.container {
    padding-top: 1.25rem !important;
    padding-bottom: 2rem !important;
}

/* Common blocks */
.sd-card,
.post-card,
.comment-form,
.empty-state,
.archive-header,
.author-bio-card,
.nav-card {
    background: var(--sd-surface) !important;
    border: 1px solid var(--sd-border) !important;
    border-radius: var(--sd-radius) !important;
    box-shadow: var(--sd-shadow-sm) !important;
}

.archive-header {
    padding: 0.9rem 1rem !important;
    margin-bottom: 1rem !important;
    border-left: 3px solid var(--sd-primary) !important;
}

.archive-header h4,
.section-title h3 {
    color: var(--sd-text-main);
    font-size: 1.05rem;
    font-weight: 750;
    margin-bottom: 0.25rem;
}

.section-title {
    background: var(--sd-surface);
    border: 1px solid var(--sd-border);
    border-left: 3px solid var(--sd-primary);
    border-radius: var(--sd-radius);
    padding: 0.9rem 1rem;
}

.breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-bottom: 0.9rem;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    font-size: 0.84rem;
}

.breadcrumb-item a {
    color: var(--sd-text-muted);
}

.breadcrumb-item.active {
    color: var(--sd-text-main);
    font-weight: 600;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\F285";
    font-family: "bootstrap-icons";
    color: #98a2b3;
    font-size: 0.62rem;
}

/* List cards */
.post-list-wrapper .row,
.category-wrapper .row,
.search-wrapper .row {
    --bs-gutter-y: 0.8rem;
}

.post-card {
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.post-card:hover {
    border-color: var(--sd-border-strong) !important;
    box-shadow: var(--sd-shadow-md) !important;
    transform: translateY(-1px);
}

.post-card .row {
    align-items: flex-start !important;
    min-height: 170px;
}

.post-card .col-md-4 {
    flex: 0 0 250px;
    width: 250px;
    padding: 1rem 0 1rem 1rem;
}

.post-card .col-md-4 a {
    display: block;
    height: 150px;
    min-height: 150px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--sd-surface-muted);
}

.post-card img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
    transition: transform 0.24s ease;
}

.post-card:hover img {
    transform: scale(1.025);
}

.post-card .card-body {
    padding: 1rem 1rem 1rem 1.05rem !important;
}

.post-card .card-title {
    font-size: 1.04rem;
    line-height: 1.45;
    margin-bottom: 0.55rem !important;
}

.post-card .card-title a {
    color: var(--sd-text-main) !important;
}

.post-card .card-title a:hover {
    color: var(--sd-primary) !important;
}

.post-card .card-text {
    color: var(--sd-text-muted) !important;
    font-size: 0.88rem !important;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    color: var(--sd-text-muted);
    font-size: 0.8rem;
}

.post-meta .badge {
    background: rgba(var(--sd-primary-rgb), 0.09) !important;
    color: var(--sd-primary) !important;
    border: 1px solid rgba(var(--sd-primary-rgb), 0.12);
    border-radius: 6px !important;
    padding: 0.24rem 0.45rem !important;
}

.post-info {
    color: var(--sd-text-muted) !important;
}

.btn {
    border-radius: 6px !important;
    font-weight: 700;
}

.btn-primary {
    --bs-btn-bg: var(--sd-primary);
    --bs-btn-border-color: var(--sd-primary);
    --bs-btn-hover-bg: var(--sd-primary-dark);
    --bs-btn-hover-border-color: var(--sd-primary-dark);
}

.btn-outline-primary {
    --bs-btn-color: var(--sd-primary);
    --bs-btn-border-color: rgba(var(--sd-primary-rgb), 0.3);
    --bs-btn-hover-bg: var(--sd-primary);
    --bs-btn-hover-border-color: var(--sd-primary);
}

/* Sidebar widgets */
.sidebar {
    position: sticky;
    top: 74px;
}

.sd-sidebar-widgets {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.sd-sidebar-widgets .sd-widget {
    background: var(--sd-surface);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    padding: 0.9rem;
    box-shadow: var(--sd-shadow-sm);
}

.sd-widget-title {
    color: var(--sd-text-main);
    font-size: 0.9rem;
    font-weight: 750;
    margin: 0 0 0.65rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--sd-border);
}

.sd-widget-title::after {
    display: none;
}

.sd-widget-text {
    color: var(--sd-text-muted);
    font-size: 0.88rem;
}

.sd-widget-posts,
.sd-widget-categories,
.sd-widget-menu,
.sd-widget-archive,
.sd-widget-comments,
.sd-widget-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sd-widget-links-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.sd-widget-links-inline span {
    display: inline-flex;
    min-width: 0;
}

.sd-widget-links-inline a {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    max-width: 100%;
    padding: 0.32rem 0.62rem;
    border: 1px solid rgba(var(--sd-primary-rgb), 0.16);
    border-radius: 7px;
    background: rgba(var(--sd-primary-rgb), 0.06);
    color: var(--sd-primary);
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.25;
    word-break: break-word;
}

.sd-widget-links-inline a:hover {
    border-color: rgba(var(--sd-primary-rgb), 0.34);
    background: rgba(var(--sd-primary-rgb), 0.11);
    color: var(--sd-primary);
}

.sd-widget-posts li,
.sd-widget-categories li,
.sd-widget-menu li,
.sd-widget-archive li,
.sd-widget-comments li,
.sd-widget-links li {
    margin: 0;
}

.sd-widget-posts li a,
.sd-widget-categories li a,
.sd-widget-menu li a,
.sd-widget-archive li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.7rem;
    padding: 0.42rem 0;
    color: var(--sd-text-main);
    border-bottom: 1px solid rgba(223, 229, 239, 0.8);
    font-size: 0.88rem;
    font-weight: 600;
}

.sd-widget-links li a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 36px;
    padding: 0.5rem 0.62rem;
    margin-bottom: 0.42rem;
    border: 1px solid var(--sd-border);
    border-radius: 8px;
    background: #fbfcfe;
    color: var(--sd-text-main);
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.35;
    word-break: break-word;
}

.sd-widget-links li a img,
.sd-widget-links-inline a img {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.sd-widget-posts li:last-child a,
.sd-widget-categories li:last-child > a,
.sd-widget-menu li:last-child > a,
.sd-widget-archive li:last-child a {
    border-bottom: 0;
}

.sd-widget-links li:last-child a {
    margin-bottom: 0;
}

.sd-widget-posts li a:hover,
.sd-widget-categories li a:hover,
.sd-widget-menu li a:hover,
.sd-widget-archive li a:hover {
    color: var(--sd-primary);
}

.sd-widget-links li a:hover {
    color: var(--sd-primary);
    border-color: rgba(var(--sd-primary-rgb), 0.28);
    background: rgba(var(--sd-primary-rgb), 0.06);
}

.sd-widget-categories .sub-menu,
.sd-widget-menu .sub-menu {
    display: none;
    list-style: none;
    padding-left: 0.85rem;
    margin: 0.2rem 0 0.35rem;
    border-left: 1px solid var(--sd-border);
}

.sd-widget-categories li.has-children > a,
.sd-widget-menu li.has-children > a {
    cursor: pointer;
    position: relative;
    padding-right: 1.4rem;
}

.sd-widget-categories li.has-children > a::after,
.sd-widget-menu li.has-children > a::after {
    content: "\F282";
    font-family: "bootstrap-icons";
    position: absolute;
    right: 0;
    color: #98a2b3;
    font-size: 0.68rem;
    transition: transform 0.18s ease;
}

.sd-widget-categories li.has-children.open > a::after,
.sd-widget-menu li.has-children.open > a::after {
    transform: rotate(180deg);
}

.sd-widget-categories li.has-children.open > .sub-menu,
.sd-widget-menu li.has-children.open > .sub-menu {
    display: block;
}

.sd-widget-count,
.sd-widget-post-date {
    color: #98a2b3;
    font-size: 0.78rem;
    font-weight: 500;
}

.sd-widget-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.sd-tag,
.tag-link {
    display: inline-flex;
    align-items: center;
    color: var(--sd-text-muted);
    background: var(--sd-surface-muted);
    border: 1px solid var(--sd-border);
    border-radius: 6px;
    padding: 0.22rem 0.45rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.sd-tag:hover,
.tag-link:hover {
    color: var(--sd-primary);
    border-color: rgba(var(--sd-primary-rgb), 0.3);
    background: rgba(var(--sd-primary-rgb), 0.08);
}

.sd-widget-search {
    position: relative;
}

.sd-widget-search-input {
    width: 100%;
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    padding: 0.5rem 2.35rem 0.5rem 0.65rem;
    color: var(--sd-text-main);
    outline: none;
}

.sd-widget-search-input:focus {
    border-color: rgba(var(--sd-primary-rgb), 0.55);
    box-shadow: 0 0 0 3px rgba(var(--sd-primary-rgb), 0.12);
}

.sd-widget-search-btn {
    position: absolute;
    top: 50%;
    right: 0.25rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: var(--sd-primary);
    padding: 0.45rem 0.65rem;
}

.sd-widget-comments {
    display: flex;
    flex-direction: column;
    gap: 0.62rem;
}

.sd-widget-comments li {
    display: flex;
    gap: 0.62rem;
    padding: 0.68rem;
    border: 1px solid var(--sd-border);
    border-radius: 8px;
    background: #fbfcfe;
    font-size: 0.88rem;
}

.sd-widget-comments li:hover {
    border-color: rgba(var(--sd-primary-rgb), 0.22);
    background: #fff;
}

.sd-widget-comments li:last-child {
    border-bottom: 1px solid var(--sd-border);
}

.sd-widget-comment-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--sd-surface-muted);
}

.sd-widget-comment-body {
    flex: 1;
    min-width: 0;
}

.sd-widget-comment-head {
    display: flex;
    flex-direction: column;
    gap: 0.16rem;
    margin-bottom: 0.28rem;
}

.sd-widget-comments .comment-author {
    color: var(--sd-primary);
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
}

.sd-widget-comment-head a {
    color: var(--sd-text-main);
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sd-widget-comment-head a:hover {
    color: var(--sd-primary);
}

.sd-widget-comments .comment-excerpt {
    display: -webkit-box;
    color: var(--sd-text-muted);
    font-size: 0.82rem;
    line-height: 1.55;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sd-widget-comment-date {
    display: inline-flex;
    align-items: center;
    margin-top: 0.34rem;
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.2;
}

.sd-widget-comment-date::before {
    content: "\F293";
    font-family: "bootstrap-icons";
    margin-right: 0.28rem;
    font-size: 0.72rem;
}

.sd-widget-banner,
.sd-widget-siteinfo-logo {
    border-radius: var(--sd-radius);
}

/* Article detail */
.post-header {
    text-align: left;
    margin-bottom: 1rem;
}

.post-header h1 {
    color: var(--sd-text-main);
    font-size: 1.55rem;
    font-weight: 760;
    line-height: 1.35;
    letter-spacing: 0;
}

.post-content {
    color: #2f3b52;
    background: var(--sd-surface);
    border: 1px solid var(--sd-border);
    border-radius: var(--sd-radius);
    box-shadow: var(--sd-shadow-sm);
    padding: 1.25rem;
    font-size: 0.95rem;
}

.post-content h2,
.post-content h3,
.post-content h4 {
    color: var(--sd-text-main);
    font-weight: 760;
    line-height: 1.35;
    margin-top: 1.5rem;
    margin-bottom: 0.65rem;
}

.post-content p {
    margin-bottom: 0.95rem;
}

.post-content img {
    display: block;
    height: auto;
    margin: 1rem auto;
    border-radius: var(--sd-radius);
}

.post-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1rem 0 1.15rem;
    overflow-x: auto;
    border-collapse: separate;
    border-spacing: 0;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.6;
}

.post-content thead {
    background: #f7f9fc;
}

.post-content th,
.post-content td {
    min-width: 120px;
    padding: 0.68rem 0.82rem;
    border-right: 1px solid var(--sd-border);
    border-bottom: 1px solid var(--sd-border);
    vertical-align: top;
}

.post-content th {
    color: var(--sd-text-main);
    font-weight: 720;
    white-space: nowrap;
}

.post-content tr th:first-child,
.post-content tr td:first-child {
    border-left: 1px solid var(--sd-border);
}

.post-content thead tr:first-child th {
    border-top: 1px solid var(--sd-border);
}

.post-content thead tr:first-child th:first-child {
    border-top-left-radius: 8px;
}

.post-content thead tr:first-child th:last-child {
    border-top-right-radius: 8px;
}

.post-content tbody tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}

.post-content tbody tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

.post-content tbody tr:nth-child(even) {
    background: #fbfcfe;
}

.post-content tbody tr:hover {
    background: #f8fafc;
}

.post-featured-image img,
.page-featured-image img {
    border-radius: var(--sd-radius) !important;
}

.author-bio-card {
    background: var(--sd-surface) !important;
}

.nav-card {
    color: var(--sd-text-main);
    transition: border-color 0.18s ease, transform 0.18s ease;
}

.nav-card:hover {
    color: var(--sd-primary);
    border-color: rgba(var(--sd-primary-rgb), 0.35) !important;
    transform: translateY(-1px);
}

.related-card img {
    transition: transform 0.28s ease;
}

.related-card:hover img {
    transform: scale(1.04);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Comments */
.comment-item {
    border: 1px solid var(--sd-border) !important;
    border-radius: var(--sd-radius);
    padding: 0.85rem;
    box-shadow: var(--sd-shadow-sm) !important;
}

.comment-avatar {
    border-radius: 50%;
}

.form-control {
    border-radius: 6px;
}

.form-control:focus {
    border-color: rgba(var(--sd-primary-rgb), 0.55) !important;
    box-shadow: 0 0 0 3px rgba(var(--sd-primary-rgb), 0.12) !important;
}

/* Pagination */
.pagination {
    gap: 0.45rem;
}

.page-link {
    color: var(--sd-text-muted);
    border: 1px solid var(--sd-border);
    border-radius: 6px !important;
    font-weight: 700;
    min-width: 34px;
    text-align: center;
}

.page-link:hover {
    color: var(--sd-primary);
    background: rgba(var(--sd-primary-rgb), 0.08);
    border-color: rgba(var(--sd-primary-rgb), 0.25);
}

.page-item.active .page-link {
    background: var(--sd-primary);
    border-color: var(--sd-primary);
}

/* Footer */
.footer-main {
    background: #101828;
    color: #aab4c4;
    padding: 1.6rem 0 1rem;
}

.footer-title {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 750;
    margin-bottom: 0.75rem;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.45rem;
}

.footer-links a,
.footer-links span {
    color: #aab4c4;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 1.4rem;
    padding-top: 1rem;
    font-size: 0.84rem;
}

/* Utilities */
.x-small {
    font-size: 0.76rem;
}

.transition-all {
    transition: all 0.2s ease;
}

.transition-transform {
    transition: transform 0.28s ease;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-opacity-100:hover {
    opacity: 1 !important;
}

.bg-primary-light {
    background: rgba(var(--sd-primary-rgb), 0.08) !important;
}

.hover-primary:hover {
    color: var(--sd-primary) !important;
}

@media (max-width: 991.98px) {
    .navbar-nav {
        align-items: stretch;
        padding-top: 0.75rem;
    }

    .sidebar {
        position: static;
        margin-top: 1.5rem;
    }

    .post-header h1 {
        font-size: 1.35rem;
    }

    .post-content {
        padding: 1rem;
    }
}

@media (max-width: 767.98px) {
    main.container {
        padding-top: 1rem !important;
    }

    .post-card .row,
    .post-card .col-md-4 a,
    .post-card img {
        min-height: 0;
    }

    .post-card .col-md-4 {
        width: 100%;
        flex: 0 0 auto;
        padding: 0.85rem 0.85rem 0;
    }

    .post-card .col-md-4 a {
        height: auto;
    }

    .post-card img {
        aspect-ratio: 16 / 9;
        width: 100%;
    }

    .archive-header,
    .section-title {
        padding: 0.8rem !important;
    }
}

/* Sndow visual refresh */
body {
    background:
        linear-gradient(180deg, rgba(64, 92, 245, 0.08) 0, rgba(64, 92, 245, 0) 170px),
        linear-gradient(90deg, rgba(16, 185, 129, 0.05) 0, rgba(16, 185, 129, 0) 24%),
        linear-gradient(180deg, #f6f8ff 0%, #eef3ff 42%, #f8fafc 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    opacity: 0.45;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.navbar {
    position: sticky;
    top: 0;
    z-index: 1030;
    width: min(calc(100% - 1rem), 1180px);
    margin: 0.75rem auto 0;
    border: 1px solid rgba(var(--sd-primary-rgb), 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(14px);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08) !important;
    overflow: hidden;
}

.navbar::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sd-primary), var(--sd-accent), #f59e0b);
}

.navbar .container {
    max-width: none;
    padding: 0.85rem 1rem;
}

.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
}

.navbar-brand span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
}

.navbar-brand img {
    max-height: 30px;
}

.nav-link {
    border: 1px solid transparent;
}

.nav-link:hover,
.nav-link.active,
.dropdown-item.active {
    border-color: rgba(var(--sd-primary-rgb), 0.12);
    box-shadow: inset 0 0 0 1px rgba(var(--sd-primary-rgb), 0.04);
}

main.container {
    max-width: 1180px;
    padding-top: 1rem !important;
}

.content-area {
    position: relative;
    padding-top: 0.1rem;
}

.post-list-wrapper,
.category-wrapper,
.search-wrapper,
.page-detail {
    position: relative;
}

.section-title,
.archive-header,
.page-header,
.post-header {
    border-radius: 8px;
}

.section-title {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--sd-primary);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.section-title h3::before {
    content: "";
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    margin-right: 0.5rem;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--sd-primary), var(--sd-accent));
    vertical-align: middle;
}

.archive-header {
    background: rgba(255, 255, 255, 0.78) !important;
    backdrop-filter: blur(10px);
    border-left: 4px solid var(--sd-primary) !important;
}

.archive-header h4 {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.archive-header h4::before {
    content: "";
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sd-primary), var(--sd-accent));
    display: inline-block;
}

.post-card {
    position: relative;
    border: 1px solid rgba(var(--sd-primary-rgb), 0.1) !important;
}

.post-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: linear-gradient(180deg, var(--sd-primary), var(--sd-accent));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.post-card:hover::before {
    opacity: 1;
}

.post-card .card-body {
    padding-top: 1.05rem !important;
    padding-bottom: 1.05rem !important;
}

.post-card .card-title {
    font-size: 1.08rem;
}

.post-card .card-text {
    font-size: 0.92rem !important;
}

.post-card .col-md-4 a {
    background: linear-gradient(180deg, rgba(var(--sd-primary-rgb), 0.08), rgba(255, 255, 255, 1));
    border: 1px solid rgba(var(--sd-primary-rgb), 0.08);
}

.post-content,
.comment-form,
.author-bio-card,
.nav-card,
.empty-state {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(10px);
}

.post-content {
    line-height: 1.85;
    font-size: 0.97rem;
}

.post-content blockquote {
    margin: 1rem 0;
    padding: 1rem 1.1rem;
    border-left: 4px solid var(--sd-accent);
    background: #f7fbff;
    border-radius: 0 8px 8px 0;
}

.post-content pre {
    padding: 1rem;
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    overflow: auto;
}

.post-content code {
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    background: rgba(var(--sd-primary-rgb), 0.08);
    color: var(--sd-primary-dark);
}

.sd-sidebar-widgets .sd-widget {
    position: relative;
    overflow: hidden;
}

.sd-sidebar-widgets .sd-widget::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--sd-primary), var(--sd-accent));
}

.sd-widget-title {
    position: relative;
    padding-left: 0.75rem;
}

.sd-widget-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.18rem;
    width: 0.4rem;
    height: 0.4rem;
    border-radius: 50%;
    background: var(--sd-primary);
}

.footer-main {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #0b1220 0%, #101828 100%);
}

.footer-main::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--sd-primary), var(--sd-accent), #f59e0b);
}

.footer-main .container {
    position: relative;
    z-index: 1;
}

.footer-brand {
    gap: 0.75rem;
}

.footer-brand i {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.footer-links a:hover {
    transform: translateX(2px);
}

.comment-item {
    background: rgba(255, 255, 255, 0.88) !important;
}

.page-link {
    background: rgba(255, 255, 255, 0.82);
}

/* Admin-aligned refinement */
body {
    background: #f3f4f6;
}

body::before {
    display: none;
}

.navbar {
    width: 100%;
    margin: 0;
    border: 0;
    border-bottom: 1px solid var(--sd-border);
    border-radius: 0;
    background: #ffffff !important;
    backdrop-filter: none;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

.navbar::before,
.footer-main::before {
    display: none;
}

.navbar .container {
    max-width: 1180px;
    padding: 0.72rem 0.75rem;
}

.navbar-brand {
    gap: 0.6rem;
    letter-spacing: 0;
}

.navbar-brand i {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #ffffff;
    background: var(--sd-primary);
    box-shadow: 0 4px 12px rgba(var(--sd-primary-rgb), 0.28);
}

.nav-link {
    border-radius: 8px;
    font-weight: 500;
}

.nav-link:hover {
    color: var(--sd-primary) !important;
    background: #f1f5f9;
    border-color: transparent;
    box-shadow: none;
}

.nav-link.active,
.dropdown-item.active {
    color: var(--sd-primary) !important;
    background: rgba(var(--sd-primary-rgb), 0.1);
    border-color: transparent;
    box-shadow: none;
    font-weight: 600;
}

.dropdown-menu {
    border-radius: 12px !important;
    box-shadow: var(--sd-shadow-md);
}

main.container {
    padding-top: 1.25rem !important;
}

.sd-card,
.post-card,
.comment-form,
.empty-state,
.archive-header,
.author-bio-card,
.nav-card,
.section-title,
.post-content,
.sd-sidebar-widgets .sd-widget {
    background: #ffffff !important;
    border: 1px solid transparent !important;
    border-radius: 12px !important;
    box-shadow: var(--sd-soft-shadow) !important;
    backdrop-filter: none;
}

.post-card:hover,
.sd-sidebar-widgets .sd-widget:hover,
.nav-card:hover {
    border-color: var(--sd-border-strong) !important;
    box-shadow: var(--sd-soft-shadow-hover) !important;
}

.archive-header,
.section-title {
    border-left: 4px solid var(--sd-primary) !important;
    padding: 1rem 1.1rem !important;
}

.archive-header h4::before,
.section-title h3::before {
    width: 0.42rem;
    height: 0.42rem;
    background: var(--sd-primary);
}

.post-card::before,
.sd-sidebar-widgets .sd-widget::before {
    display: none;
}

.post-card {
    overflow: hidden;
}

.post-card .col-md-4 a {
    border-radius: 10px;
    background: #f1f5f9;
    border: 1px solid var(--sd-border);
}

.post-card:hover {
    transform: translateY(-1px);
}

.post-meta .badge,
.sd-tag,
.tag-link {
    background: rgba(var(--sd-primary-rgb), 0.08) !important;
    color: var(--sd-primary) !important;
    border-color: rgba(var(--sd-primary-rgb), 0.14);
    border-radius: 8px !important;
}

.btn {
    border-radius: 8px !important;
}

.btn-outline-primary {
    background: #ffffff;
}

.post-content blockquote {
    border-left-color: var(--sd-primary);
    background: #f8fafc;
}

.post-content pre {
    background: #111827;
    border-radius: 10px;
}

.post-content code {
    background: #f1f5f9;
    color: #4f46e5;
}

.sd-widget-title {
    padding-left: 0;
    font-weight: 700;
}

.sd-widget-title::before {
    display: none;
}

.sd-widget-title::after {
    display: block;
    content: "";
    width: 28px;
    height: 2px;
    margin-top: 0.45rem;
    border-radius: 999px;
    background: var(--sd-primary);
}

.sd-widget-links li a,
.sd-widget-comments li {
    background: #f8fafc;
    border-radius: 10px;
}

.footer-main {
    background: #0f172a;
}

.footer-brand i {
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
}

.footer-links a:hover {
    transform: none;
}

.comment-item {
    background: #ffffff !important;
}

.page-link {
    background: #ffffff;
}

@media (max-width: 767.98px) {
    .navbar {
        border-radius: 0;
    }

    .navbar .container {
        padding: 0.65rem 0.75rem;
    }
}

.navbar {
    overflow: visible;
}

.navbar-collapse {
    overflow: visible;
}

.navbar-nav {
    flex-wrap: wrap;
}

.dropdown-menu {
    z-index: 1040;
}

.navbar-search {
    align-items: center;
    flex: 0 0 auto;
    width: min(100%, 260px);
}

.navbar-search-input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: 0;
}

.navbar-search-btn {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-inline: 0.7rem;
}

@media (max-width: 991.98px) {
    .navbar-search {
        width: 100%;
        max-width: 100%;
    }
}

/* Archive header refinement */
.archive-header,
.section-title {
    background: #ffffff !important;
    border: 1px solid var(--sd-border) !important;
    box-shadow: var(--sd-soft-shadow) !important;
    border-radius: var(--sd-radius) !important;
    padding: 0.9rem 1rem !important;
    margin-bottom: 1rem !important;
}

.archive-header h4,
.section-title h3 {
    display: block;
    margin: 0 0 0.2rem !important;
    padding: 0 !important;
    color: var(--sd-text-main);
    font-size: 1.02rem;
    font-weight: 750;
    line-height: 1.35;
}

.archive-header h4::before,
.section-title h3::before {
    display: none !important;
    content: none !important;
}

.archive-header p,
.section-title p {
    padding: 0 !important;
    margin: 0 !important;
    color: var(--sd-text-muted) !important;
}
