/*
 * Puock 主题视觉优化层
 * ------------------------------------------------------------
 * 只做外观覆盖，不修改主题原始样式文件，方便后续主题升级。
 * 加载顺序：libs.min.css -> style.min.css -> custom.css
 */

/* ========== 1. 全局设计变量与排版 ========== */
body {
    /* 主色：靛蓝，比默认亮蓝更沉稳，和橙色站点 Logo 也不冲突 */
    --pk-c-primary: #3b5bdb;
    --pk-c-primary-rgb: 59, 91, 219;
    --pk-c-font: #202733;
    --pk-c-sub: #78829a;
    --pk-bg-body: #f6f7f9;
    --pk-bg-card: #ffffff;
    --pk-bg-box: #ffffff;
    --pk-bg-grey: #f4f6f9;
    --pk-bg-box-content: #f7f8fa;
    --pk-c-border: #e9ecf2;
    --pk-g-box-radius: 14px;
    --pk-c-block-shadow: rgba(20, 32, 60, 0.05);
    --pk-g-list-img-hover: scale(1.06);

    --bs-primary-rgb: 59, 91, 219;
    --bs-body-color-rgb: 32, 39, 51;
    --bs-body-bg-rgb: 246, 247, 249;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
                 "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body.puock-dark {
    --pk-c-primary: #7c9cff;
    --pk-c-primary-rgb: 124, 156, 255;
    --pk-c-font: #e6e9ef;
    --pk-c-sub: #99a2b3;
    --pk-bg-body: #15181e;
    --pk-bg-card: #20252d;
    --pk-bg-box: #20252d;
    --pk-bg-grey: #191d23;
    --pk-bg-box-content: #1b1f26;
    --pk-c-border: #2e3540;
    --pk-c-block-shadow: rgba(0, 0, 0, 0.22);
    --bs-primary-rgb: 124, 156, 255;
    color-scheme: dark;
}

/* 深色主题下的深色配色变体 */
body.puock-dark.puock-dark-palette-blueblack {
    --pk-bg-body: #121a23;
    --pk-bg-card: #1d2833;
    --pk-bg-box: #1d2833;
    --pk-c-border: #2b3845;
}

::selection {
    background: rgba(var(--pk-c-primary-rgb), 0.22);
    color: var(--pk-c-font);
}

a,
button,
input,
textarea {
    -webkit-tap-highlight-color: transparent;
}

/* 细滚动条 */
::-webkit-scrollbar {
    width: 9px;
    height: 9px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(120, 130, 154, 0.35);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(120, 130, 154, 0.6);
    background-clip: padding-box;
}

/* ========== 2. 顶部导航 ========== */
#header,
#header-box {
    height: 68px;
}

#header {
    background-color: rgba(255, 255, 255, 0.86) !important;
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    backdrop-filter: saturate(180%) blur(18px);
    border-bottom: 1px solid rgba(20, 32, 60, 0.06);
    box-shadow: 0 4px 24px rgba(20, 32, 60, 0.04);
}

body.puock-dark #header {
    background-color: rgba(21, 24, 30, 0.86) !important;
    border-bottom-color: rgba(255, 255, 255, 0.07);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

#header #logo {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
}

#header #logo img {
    width: auto !important;
    max-height: 38px;
}

#header #logo .txt-logo {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

#menus {
    height: 68px;
}

#menus ul li {
    height: 68px;
    line-height: 68px;
}

#menus ul li a {
    font-size: 14.5px;
    font-weight: 500;
    padding: 0 0.8rem;
    color: var(--pk-c-font);
    opacity: 0.82;
}

#menus ul li:hover a,
#menus ul li.menu-current a {
    opacity: 1;
    color: var(--pk-c-primary);
}

#menus > ul > li:after {
    top: 63px;
    height: 3px;
    width: calc(100% - 1.6rem);
    left: 0.8rem;
    border-radius: 3px 3px 0 0;
}

#menus ul .sub-menu {
    top: 64px;
    border: 1px solid var(--pk-c-border);
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(20, 32, 60, 0.14);
    padding: 6px 0;
    overflow: hidden;
}

#menus ul .sub-menu li {
    min-height: 40px;
    line-height: 40px;
}

#menus ul .sub-menu li a {
    font-size: 14px;
}

#content,
#post,
#page {
    padding-top: 18px;
}

/* ========== 3. 通用卡片 ========== */
.p-block,
.widget {
    border: 1px solid var(--pk-c-border);
    border-radius: var(--pk-g-box-radius);
    box-shadow: 0 2px 14px var(--pk-c-block-shadow);
    padding: 20px;
    margin-bottom: 18px;
    transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}

.p-block:hover,
.widget:hover {
    box-shadow: 0 10px 30px rgba(20, 32, 60, 0.09);
    border-color: rgba(var(--pk-c-primary-rgb), 0.22);
}

body.puock-dark .p-block:hover,
body.puock-dark .widget:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 区块标题（侧栏、页脚通用） */
.pk-widget > div:first-child > span,
.widget > div:first-child > span,
#footer .row span {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.01em;
    border-bottom-width: 2px !important;
    padding-bottom: 8px !important;
}

.pk-widget > div:first-child > span i,
.widget > div:first-child > span i {
    color: var(--pk-c-primary);
}

/* ========== 4. 首页轮播 ========== */
#index-banners {
    margin-bottom: 18px;
}

#index-banners .swiper {
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(20, 32, 60, 0.12);
}

#index-banners .swiper-slide {
    position: relative;
}

#index-banners .swiper-slide::after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(to bottom, transparent, rgba(8, 14, 28, 0.62));
    pointer-events: none;
}

.swiper .swiper-wrapper .swiper-title {
    bottom: 0;
    z-index: 2;
    justify-content: center;
    padding: 40px 24px 20px;
    color: #fff;
}

.swiper .swiper-wrapper .swiper-title-text {
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

#index-banners .swiper-button-next,
#index-banners .swiper-button-prev {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: #202733;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

#index-banners .swiper:hover .swiper-button-next,
#index-banners .swiper:hover .swiper-button-prev {
    opacity: 1;
}

#index-banners .swiper-button-next:hover,
#index-banners .swiper-button-prev:hover {
    transform: scale(1.08);
}

#index-banners .swiper-button-next::after,
#index-banners .swiper-button-prev::after {
    font-size: 14px;
    font-weight: 700;
}

#index-banners .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
    width: 7px;
    height: 7px;
}

#index-banners .swiper-pagination-bullet-active {
    opacity: 1;
    width: 20px;
    border-radius: 6px;
    background: var(--pk-c-primary);
}

/* ========== 5. 文章列表 ========== */
#posts .post-item.post-item-list {
    padding: 18px 20px;
    align-items: center;
}

#posts .post-item .thumbnail {
    width: 186px;
    aspect-ratio: 16 / 10;
    margin: 0 20px 0 0;
    border-radius: 10px;
}

#posts .post-item:hover .thumbnail {
    box-shadow: 0 6px 18px rgba(20, 32, 60, 0.14);
}

#posts .post-item .post-info .info-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.55;
    letter-spacing: -0.01em;
}

#posts .post-item .post-info .info-title .a-link {
    color: var(--pk-c-font);
    transition: color 0.2s ease;
}

#posts .post-item:hover .post-info .info-title .a-link {
    color: var(--pk-c-primary);
}

#posts .post-item .post-info .info-meta {
    font-size: 14px;
    line-height: 1.8;
    color: var(--pk-c-sub) !important;
    margin-top: 8px;
    margin-bottom: 12px;
}

#posts .post-item .post-info .info-footer {
    color: var(--pk-c-sub);
    font-size: 12.5px;
}

#posts .post-item .title-l-c {
    top: 50%;
    left: 0;
    width: 3px;
    height: 0;
    border-radius: 0 4px 4px 0;
    box-shadow: none;
    background: var(--pk-c-primary);
    opacity: 0;
    transform: translateY(-50%);
    transition: height 0.25s ease, opacity 0.25s ease;
}

#posts .post-item:hover .title-l-c {
    height: 42px;
    opacity: 1;
}

/* 分类 / 状态标签改成圆润小胶囊 */
.badge {
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 500;
    padding: 0.34em 0.6em;
    letter-spacing: 0.02em;
}

/* 卡片式文章列表 */
#posts .post-item.post-item-card .post-item-block {
    padding: 14px;
}

#posts .post-item.post-item-card .thumbnail {
    border-radius: 10px;
}

#posts .post-item.post-item-card .post-info .info-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 52px;
}

/* 分页 */
.pagination,
.pagination a,
.pagination .page-numbers,
.pagination .post-page-numbers {
    text-align: center;
}

.pagination a,
.pagination .page-numbers,
.pagination .post-page-numbers {
    min-width: 36px;
    padding: 7px 12px;
    margin: 0 3px;
    border-radius: 9px;
    border: 1px solid var(--pk-c-border);
    background: var(--pk-bg-box);
    font-size: 13.5px;
    font-weight: 500;
    color: var(--pk-c-sub) !important;
}

.pagination a:hover,
.pagination .page-numbers:hover,
.pagination .post-page-numbers:hover {
    color: var(--pk-c-primary) !important;
    border-color: rgba(var(--pk-c-primary-rgb), 0.4);
}

.pagination .current,
.pagination .page-numbers.current {
    color: #fff !important;
    background: var(--pk-c-primary);
    border-color: var(--pk-c-primary);
    box-shadow: 0 4px 12px rgba(var(--pk-c-primary-rgb), 0.28);
}

/* ========== 6. 侧栏组件 ========== */
#sidebar .sidebar-main > * {
    scroll-margin-top: 86px;
}

/* 博主卡片 */
.widget-puock-author {
    overflow: hidden;
    border-radius: var(--pk-g-box-radius);
    border: 1px solid var(--pk-c-border);
    box-shadow: 0 2px 14px var(--pk-c-block-shadow);
    padding: 0;
}

.widget-puock-author .header {
    height: 124px;
    background-size: cover;
    background-position: center 45%;
}

.widget-puock-author .header::after {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 124px;
    background: linear-gradient(to bottom, rgba(12, 20, 40, 0.06), rgba(12, 20, 40, 0.22));
}

.widget-puock-author .header .avatar {
    width: 78px;
    height: 78px;
    top: 85px;
    left: 50%;
    margin-left: -39px;
    border: 4px solid var(--pk-bg-box);
    box-shadow: 0 6px 18px rgba(20, 32, 60, 0.18);
    object-fit: cover;
}

.widget-puock-author .content {
    padding: 48px 16px 18px;
}

.widget-puock-author .content .t-lg {
    font-size: 17px;
    font-weight: 600;
}

.widget-puock-author .content .mt10.t-sm {
    color: var(--pk-c-sub);
    line-height: 1.7;
}

.widget-puock-author .row.mt10 {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--pk-c-border);
}

.widget-puock-author .row.mt10 .c-sub {
    font-size: 11.5px;
}

/* 热门文章列表 */
.pk-widget .widget-common-media-post {
    padding: 10px 0;
    border-bottom: 1px dashed var(--pk-c-border);
}

.pk-widget .widget-common-media-post:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.pk-widget .widget-common-media-post .img {
    width: 82px;
    height: 60px;
    flex-basis: 82px;
    margin-right: 12px;
    border-radius: 8px;
}

.pk-widget .widget-common-media-post .info .info-title,
.pk-widget .widget-common-media-post .info h2 {
    font-size: 13.5px;
    line-height: 1.55;
    font-weight: 600;
}

.pk-widget .widget-common-media-post .description {
    font-size: 12px;
    line-height: 1.6;
    margin-top: 3px;
    color: var(--pk-c-sub) !important;
}

/* 一言 */
.widget-puock-hitokoto .t {
    font-size: 14px;
    line-height: 1.9;
    color: var(--pk-c-font);
}

.widget-puock-hitokoto .fb {
    margin-top: 12px;
    text-align: right;
    font-size: 12.5px;
    color: var(--pk-c-sub);
}

/* 读者墙 / 标签 */
.widget-puock-tag-cloud .badge {
    margin: 0 6px 8px 0;
}

/* 搜索框 */
.global-search-form .form-control,
.global-search-form .input-group {
    border-radius: 10px;
}

.global-search-form .form-control {
    background: var(--pk-bg-box-content);
    border-color: var(--pk-c-border);
    font-size: 14px;
    padding: 10px 14px;
}

/* ========== 7. 悬浮按钮 ========== */
#rb-float-actions {
    right: 18px;
    bottom: 60px;
}

#rb-float-actions .p-block {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--pk-c-border);
    background: var(--pk-bg-box);
    color: var(--pk-c-sub);
    box-shadow: 0 4px 16px rgba(20, 32, 60, 0.12);
    margin-bottom: 8px;
}

#rb-float-actions .p-block:hover {
    background: var(--pk-c-primary);
    border-color: var(--pk-c-primary);
    color: #fff;
    transform: translateY(-2px);
}

#rb-float-actions .p-block i {
    font-size: 13px;
}

/* ========== 8. 页脚 ========== */
#footer {
    background-color: var(--pk-bg-card);
    border-top: 1px solid var(--pk-c-border);
    padding: 42px 0 26px;
    margin-top: 30px;
}

#footer .row > div {
    margin-bottom: 18px;
}

#footer .row span {
    display: inline-block;
}

#footer .row span i {
    color: var(--pk-c-primary);
    margin-right: 4px;
}

#footer .mt20.t-md {
    margin-top: 18px !important;
    color: var(--pk-c-sub);
    font-size: 13.5px;
    line-height: 1.9;
}

#footer .info {
    margin-top: 28px;
    padding-top: 18px;
    border-top: 1px solid var(--pk-c-border);
    color: var(--pk-c-sub);
    font-size: 12.5px;
}

#footer .info a {
    color: var(--pk-c-sub);
}

#footer .info a:hover {
    color: var(--pk-c-primary);
}

/* ========== 9. 移动端微调 ========== */
@media (max-width: 991.98px) {
    #posts .post-item.post-item-list {
        padding: 14px;
    }

    #posts .post-item .thumbnail {
        width: 132px;
        margin-right: 14px;
    }

    #posts .post-item .post-info .info-title {
        font-size: 15.5px;
    }

    #posts .post-item .post-info .info-meta {
        font-size: 13px;
    }

    .p-block,
    .widget {
        padding: 16px;
    }

    #footer {
        padding: 32px 0 22px;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 14.5px;
    }

    #header #logo .txt-logo {
        font-size: 18px;
    }

    #index-banners .swiper {
        border-radius: 12px;
    }

    .swiper .swiper-wrapper .swiper-title-text {
        font-size: 15px;
    }

    #posts .post-item .thumbnail {
        width: 108px;
        margin-right: 12px;
    }

    #posts .post-item .post-info .info-title {
        font-size: 14.5px;
        line-height: 1.5;
    }

    #posts .post-item .post-info .info-meta {
        -webkit-line-clamp: 2;
    }
}
