/**
 * 海豚站 - RiPro 子主题自定义样式
 * 在此文件编写覆盖样式，无需修改父主题。
 */

/* 顶部标题栏白色背景高度 +12px（父主题默认 60px） */
.site-header .navbar {
    height: 72px;
}

/* 顶栏固定时占位同步增高，避免正文被遮挡 */
.site-header.navbar-sticky + .header-gap {
    height: 72px;
}

/* 详情页：顶栏始终固定、占位恒定，避免滚回顶部时 sticky 切换导致跳动 */
body.single .site-header {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 80;
    transform: none !important;
}

body.single .site-header.navbar-now {
    transform: none !important;
}

body.single .header-gap {
    height: 72px !important;
}

/* 内页主内容整体下移（文章详情 / 分类列表 / 标签云等，不含首页） */
body.single main,
body.archive main,
body.search main,
body.haitun-tags-page main {
    padding-top: 60px;
}

/*
 * 分类页：标题 + 筛选标签贴顶栏下方
 * 顶栏 absolute，用 header-gap 占位；黑色 archive-hero 上提盖住灰色间隔
 */
body.category main {
    padding-top: 0 !important;
}

body.category .header-gap,
body.category .site-header.navbar-sticky + .header-gap {
    height: 72px;
}

body.category .archive-hero {
    margin-top: -72px;
    padding-top: 72px;
}

/* 顶栏：Logo + 主导航菜单整体左移 150px（右侧登录/搜索等不动） */
@media (min-width: 992px) {
    .site-header .navbar > .logo-wrapper,
    .site-header .navbar > .sep,
    .site-header .navbar > .main-menu {
        transform: translateX(-100px);
    }
}

@media (max-width: 991.98px) {
    .site-header .navbar > .logo-wrapper {
        transform: translateX(-100px);
    }
}

/* 顶栏主导航：白天略加深加粗；暗色改为白色 */
.site-header .navbar .main-menu .nav-list > .menu-item > a {
    color: #3a3a42 !important;
    font-weight: 500;
}

.site-header .navbar .main-menu .nav-list > .menu-item > a:hover,
.site-header .navbar .main-menu .nav-list > .menu-item.current-menu-item > a {
    color: #242428 !important;
}

[data-bs-theme=dark] .site-header .navbar .main-menu .nav-list > .menu-item > a {
    color: #fff !important;
}

[data-bs-theme=dark] .site-header .navbar .main-menu .nav-list > .menu-item > a:hover,
[data-bs-theme=dark] .site-header .navbar .main-menu .nav-list > .menu-item.current-menu-item > a {
    color: #fff !important;
}

/* 首页高级搜索：高度不变；与最新推荐产品可视宽度一致（扣除 container gutter） */
.home-search-box .search-bg {
    position: relative;
    width: min(100%, calc(var(--haitun-home-wide-max) - var(--bs-gutter-x, 1.5rem)));
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-top: 40px; /* 原 60px × 2/3 */
    overflow: hidden;
    box-sizing: border-box;
}

.home-search-box .search-bg .search-warp {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    padding-top: 80px; /* 原 120px × 2/3 */
    padding-bottom: 80px;
    transform: translateY(-40px);
    margin-bottom: -40px; /* 抵消 transform 不占文档流的空隙 */
}

/* 铺满背景区域：保持不裁切，随宽度变化拉伸适配 */
.home-search-box .search-bg.haitun-search-bg-img .haitun-search-bg-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: fill;
    object-position: center center;
    z-index: 0;
    pointer-events: none;
}

/*
 * 搜索背景遮罩：
 * - 白天：仅后台开关开启时显示（约主题默认 1/5）
 * - 暗色：与开关无关，始终使用 RiPro 默认遮罩
 */
.home-search-box .search-bg .search-bg-overlay {
    display: none;
    z-index: 1;
    background: linear-gradient(
        0deg,
        rgba(25, 27, 38, 0.064),
        rgba(25, 27, 38, 0.144)
    );
}

.home-search-box .search-bg.haitun-has-overlay .search-bg-overlay {
    display: block;
}

[data-bs-theme=dark] .home-search-box .search-bg .search-bg-overlay {
    display: block !important;
    background: linear-gradient(
        10deg,
        rgba(25, 27, 38, 0.56),
        rgba(25, 27, 38, 0.75)
    );
}

@media (max-width: 991.98px) {
    .home-search-box .search-bg {
        width: min(100%, calc(100% - var(--bs-gutter-x, 1.5rem)));
        max-width: 100%;
    }

    .home-search-box .search-bg .search-warp {
        padding-top: calc(40px * 2 / 3);
        padding-bottom: calc(40px * 2 / 3);
    }
}

/* 首页搜索标题 / 描述：白天黑色；暗色（始终有遮罩）用白色便于阅读 */
.home-search-box .search-bg .search-title,
.home-search-box .search-bg .search-desc {
    color: #000;
}

[data-bs-theme=dark] .home-search-box .search-bg .search-title,
[data-bs-theme=dark] .home-search-box .search-bg .search-desc {
    color: #fff;
}

/* 搜索框下方热词标签：背景更深，字体更白 */
.home-search-box .search-bg .search-hots span,
.home-search-box .search-bg .search-hots a {
    color: rgba(255, 255, 255, 0.95);
}

.home-search-box .search-bg .search-hots a:hover {
    color: #fff;
}

.home-search-box .search-bg .search-hots span {
    background-color: rgba(0, 0, 0, 0.62);
}

/* 首页搜索输入框：边缘加深 */
.home-search-box .search-bg .search-form {
    width: 68%;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 9999px;
    overflow: hidden;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.22);
}

.home-search-box .search-bg .search-form:hover {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.32);
}

.search-bg .search-form .search-fields input,
.search-bg .search-form .search-select .form-select {
    padding-top: calc(0.5rem * 4 / 3);
    padding-bottom: calc(0.5rem * 4 / 3);
}

.search-bg .search-form .search-fields button {
    padding-left: calc(1rem * 2 / 3);
    padding-right: calc(1rem * 2 / 3);
}

/* 首页加宽区域：分类 BOX / 最新推荐 / 分类文章 / 热门文章(CMS) 容器宽度一致 */
:root {
    --haitun-home-wide-max: calc(1140px + 200px);
}

.home-cat-box section.container,
.home-last-post section.container,
.home-cat-post section.container,
.home-cms-post section.container {
    max-width: var(--haitun-home-wide-max);
}

/* 首页分类 BOX：高度 +1/3，box 间距加大 */
.home-cat-box .widget-catbox-item {
    height: calc(120px * 4 / 3);
}

.home-cat-box .widget-catbox .owl-item {
    padding-left: 12px;
    padding-right: 12px;
}

@media (min-width: 1400px) {
    :root {
        --haitun-home-wide-max: calc(1320px + 200px);
    }
}

@media (max-width: 991.98px) {
    .home-cat-box section.container,
    .home-last-post section.container,
    .home-cat-post section.container,
    .home-cms-post section.container {
        max-width: 100%;
    }

    .home-cat-box .widget-catbox-item {
        height: calc(75px * 4 / 3);
    }

    .home-cat-box .widget-catbox .owl-item {
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* 分类页加宽：左右各扩 100px（容器 max-width +200px） */
:root {
    --haitun-archive-wide-max: calc(1140px + 200px);
}

body.category .archive-hero .container,
body.category .filter-warp .container,
body.category main > section.container {
    max-width: var(--haitun-archive-wide-max);
}

@media (min-width: 1400px) {
    :root {
        --haitun-archive-wide-max: calc(1320px + 200px);
    }
}

@media (max-width: 991.98px) {
    body.category .archive-hero .container,
    body.category .filter-warp .container,
    body.category main > section.container {
        max-width: 100%;
    }
}

/* 隐藏钻石图标（VIP 徽章、立即续费、会员有效期等） */
.fa-gem {
    display: none !important;
}

/* 普通用户参考价：屏幕居中提示框 */
.haitun-center-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.haitun-center-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.haitun-center-modal__box {
    position: relative;
    z-index: 1;
    width: min(100%, 320px);
    padding: 1.75rem 1.5rem 1.5rem;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    text-align: center;
}

.haitun-center-modal__text {
    margin: 0 0 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #333;
}

.haitun-center-modal__btn {
    min-width: 120px;
    border-radius: 999px;
}

body.haitun-modal-open {
    overflow: hidden;
}

[data-bs-theme="dark"] .haitun-center-modal__box {
    background: #1f1f1f;
}

[data-bs-theme="dark"] .haitun-center-modal__text {
    color: #f0f0f0;
}

/* 保留：用户中心侧栏、顶部悬停菜单中的「我的会员」图标 */
.uc-menu-warp .fa-gem,
.action-hover-menu .hover-link .fa-gem {
    display: inline-block !important;
}

/* 普通用户：隐藏徽章（文字、图标、可点击样式） */
.badge.bg-secondary.text-secondary.bg-opacity-10,
a.badge.bg-secondary.text-secondary.bg-opacity-10 {
    display: none !important;
}

/* 用户中心 / 作者小工具：普通用户不显示仅含徽章的行 */
.card.text-center > p.mb-1:has(.badge.bg-secondary.text-secondary.bg-opacity-10),
.author-header small:has(.badge.bg-secondary.text-secondary.bg-opacity-10) {
    display: none !important;
}

/* 资源价格列表：隐藏「普通用户」行 */
.price-item.no,
.prices-info .price-item.no,
.prices-ul .price-item.no {
    display: none !important;
}

/* 评论发表按钮：橙色背景、高度 +1/3（覆盖父主题 #comments 与暗色模式） */
#comments .form-submit input[type="submit"] {
    background-color: #ed6d0b !important;
    color: #fff !important;
    border: none !important;
    padding-top: calc(0.25rem * 4 / 3) !important;
    padding-bottom: calc(0.25rem * 4 / 3) !important;
}

#comments .form-submit input[type="submit"]:hover,
#comments .form-submit input[type="submit"]:focus {
    background-color: #d9620a !important;
    color: #fff !important;
}

#comments .form-submit {
    margin-top: 5px;
}

#comments .comment-reply-title {
    font-size: 0.75rem;
    padding: 0.35rem 0.5rem;
}

#comments .comment-reply-title #cancel-comment-reply-link {
    font-size: 0.75rem;
}

/* 评论列表：用户名加黑加粗，时钟 + 时间在用户名右侧 */
#comments .comments-list .comment .comment-body .comment-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

#comments .comments-list .comment .comment-body .nickname {
    color: #191a1f;
    font-weight: 550;
    font-size: 1rem;
    margin-bottom: 0;
}

#comments .comments-list .comment .comment-body .nickname a {
    color: #191a1f;
    font-weight: 550;
    font-size: inherit;
}

#comments .comments-list .comment .comment-body .comment-time {
    color: #595d69;
    font-size: 0.8125rem;
    margin-bottom: 0;
    flex-shrink: 0;
    white-space: nowrap;
}

#comments .comments-list .comment .comment-body .comment-time .fa-clock {
    font-size: 0.8125rem;
}

/* 评论输入框：灰色外框 + 白色输入区 */
#comments .comment-form .comment-form-comment {
    background-color: #f0f1f3;
    padding: 0.75rem;
    border-radius: 0.375rem;
}

#comments .comment-form .comment-form-comment textarea {
    background-color: #fff !important;
    border: 1px solid #dfe0e5;
    border-radius: 0.25rem;
    width: 100%;
}

#comments .comment-form .comment-form-comment textarea:focus {
    background-color: #fff !important;
    border-color: #d0d4d9;
    box-shadow: none;
}

/* 详情页：主内容卡片左对齐 Logo（桌面端，变量由 custom.js 写入） */
@media (min-width: 992px) {
    body.single .container:has(.content-wrapper) {
        overflow-x: visible;
    }

    body.single .container:has(.content-wrapper) > .row {
        flex-wrap: nowrap;
    }

    body.single .content-wrapper.col-lg-9 {
        flex: 0 0 75%;
        max-width: 75%;
        width: 75%;
        min-width: 0;
    }

    body.single .content-wrapper > .card,
    body.single .content-wrapper > .entry-navigation,
    body.single .content-wrapper > .related-posts {
        margin-left: var(--haitun-product-offset-left, 0);
        width: var(--haitun-product-width, 100%);
        max-width: var(--haitun-product-width, 100%);
        box-sizing: border-box;
    }

    /* 详情页侧边栏：加宽约 48px，整体右移 30px（不影响主内容列 75% 宽度） */
    body.single .sidebar-wrapper.col-lg-3 {
        flex: 0 0 calc(25% + 48px);
        max-width: calc(25% + 48px);
        width: calc(25% + 48px);
        margin-left: 30px;
    }
}

/* 详情页：标题与正文介绍共用左右留白 */
body.single {
    --haitun-single-text-inset: 1.5rem;
}

/* 文章内页：标题与 meta 移至原 Tab 位置，隐藏顶部 article-header 与 hero 横幅 */
.single:has(.haitun-single-title) .article-header {
    display: none;
}

.single:has(.haitun-single-title) .archive-hero.post-hero {
    display: none !important;
}

.single .haitun-single-title {
    margin-top: 20px;
    margin-bottom: 4.5rem;
    padding-left: var(--haitun-single-text-inset);
    padding-right: var(--haitun-single-text-inset);
}

.single:has(.haitun-single-title) .single-post-body {
    margin-top: calc(1.5rem - 70px);
    padding-left: var(--haitun-single-text-inset);
    padding-right: var(--haitun-single-text-inset);
}

.single .single-post-pay-section,
.single .single-comments-section {
    padding-left: var(--haitun-single-text-inset);
    padding-right: var(--haitun-single-text-inset);
}

.single .haitun-single-title .post-title {
    font-size: 2.125rem;
    font-weight: 450;
    line-height: calc(1em + 18px);
    text-align: left;
    color: #454650;
}

.single .haitun-single-title .post-title .haitun-title-latin {
    word-spacing: -0.06em;
}

.single .haitun-single-meta {
    margin-top: 30px;
    font-size: 0.875rem;
    word-spacing: normal;
    letter-spacing: normal;
}

.single .haitun-single-meta a,
.single .haitun-single-meta span {
    color: #a1a1a8;
}

.single .haitun-single-meta > span + span {
    margin-left: 8px;
}

.single .haitun-single-meta .meta-fav,
.single .haitun-single-meta .meta-likes {
    display: inline-block !important;
}

@media (max-width: 767.98px) {
    body.single {
        --haitun-single-text-inset: 1rem;
    }

    .single .haitun-single-title .post-title {
        font-size: 1.6875rem;
    }

    .single .haitun-single-meta {
        font-size: 0.75rem;
    }
}

/* 详情图：产品图居中展示 */
.single .haitun-detail-image-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    width: 100%;
}

.single .haitun-detail-image-wrap .haitun-cat-path {
    align-self: flex-start;
    width: 100%;
    margin: 0 0 10px;
    max-width: 100%;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    color: #595d69;
}

.single .haitun-detail-image-wrap figure,
.single .haitun-detail-image-wrap > p:has(img) {
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.single .haitun-detail-image-wrap img {
    display: block;
    max-width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
}

.single .haitun-detail-image-wrap .haitun-cat-path a {
    color: #595d69;
    font-weight: 600;
    text-decoration: none;
}

.single .haitun-detail-image-wrap .haitun-cat-path a:hover {
    color: #191a1f;
    text-decoration: underline;
}

.single .haitun-detail-image-wrap .haitun-cat-sep {
    color: #a1a1a8;
}

/* 资源下载组件：隐藏侧边栏，仅在详情下方显示 */
.single .sidebar-wrapper .post-buy-widget {
    display: none !important;
}

.single-post-pay-section .ri-down-warp {
    position: static;
}

/* 免费资源（价格 0）：简化下载区 */
.single-post-pay-section .ri-down-warp.haitun-free-down {
    overflow: visible;
    background: transparent;
    margin: 0;
    padding: 0;
}

.single-post-pay-section .ri-down-warp.haitun-free-down .down-msg,
.single-post-pay-section .ri-down-warp.haitun-free-down .buy-title {
    display: none !important;
}

.single-post-pay-section .haitun-free-down-links {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-top: 20px;
}

.single-post-pay-section .haitun-free-down-link {
    text-align: center;
    margin-top: 0;
}

.single-post-pay-section {
    --haitun-action-btn-width: calc(200px * 4 / 3);
}

.single-post-pay-section .haitun-down-btn {
    display: inline-block;
    width: var(--haitun-action-btn-width) !important;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    font-weight: 600;
    font-size: 1.125rem;
    background-color: #59b54d !important;
    border-color: #59b54d !important;
    border-radius: 0;
    padding-top: calc(0.375rem * 2 * 4 / 3);
    padding-bottom: calc(0.375rem * 2 * 4 / 3);
}

.single-post-pay-section .haitun-down-btn:hover,
.single-post-pay-section .haitun-down-btn:focus {
    background-color: #4fa344 !important;
    border-color: #4fa344 !important;
    color: #fff !important;
}

/* 付费资源：双按钮购买区 */
.single-post-pay-section .ri-down-warp.haitun-paid-down {
    overflow: visible;
    background: transparent;
    margin: 0;
    padding: 0;
}

.single-post-pay-section .ri-down-warp.haitun-paid-down .down-msg {
    display: none !important;
}

.single-post-pay-section .ri-down-warp.haitun-vip-only-down .down-msg {
    display: none !important;
}

.single-post-pay-section .haitun-paid-buy {
    background-color: transparent !important;
    margin: 0 !important;
    padding: 0;
}

.single-post-pay-section .haitun-paid-buy-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: calc(1rem + 10px);
    margin-top: 20px;
    text-align: center;
}

.single-post-pay-section .ri-down-warp.haitun-paid-down .down-buy-info > .d-grid {
    margin-top: calc(1rem + 10px) !important;
}

.single-post-pay-section .haitun-free-down-pwd {
    color: #333 !important;
    font-size: 1rem;
    letter-spacing: 0.05em;
    margin-top: 1.25rem !important;
}

/* 查看预览按钮：与上方下载按钮同宽并居中 */
.single-post-pay-section .down-buy-info .haitun-preview-btn {
    display: inline-block;
    width: var(--haitun-action-btn-width) !important;
    max-width: 100%;
    justify-self: center;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    background-color: rgba(89, 93, 105, 0.26);
    border-color: transparent;
}

.single-post-pay-section .down-buy-info .haitun-preview-btn:hover,
.single-post-pay-section .down-buy-info .haitun-preview-btn:active {
    color: #fff;
    background-color: #595d69;
    border-color: #595d69;
}

/* 详情页免责声明：金色文字 + 浅灰背景 */
.single .entry-copyright {
    color: #c6a300;
    background-color: #f7f8f9;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    font-size: 1rem;
    line-height: 1.75;
    letter-spacing: 0.08em;
}

.single .entry-copyright a {
    color: #c6a300;
}

/* 详情页底部：收藏、点赞按钮样式与分享按钮统一（btn-info-soft） */
.single .entry-social .post-fav-btn.btn-success-soft,
.single .entry-social .post-like-btn.btn-danger-soft {
    color: #4f9ef8;
    background-color: rgba(79, 158, 248, 0.1);
    border-color: transparent;
}

.single .entry-social .post-fav-btn.btn-success-soft:hover,
.single .entry-social .post-fav-btn.btn-success-soft:active,
.single .entry-social .post-like-btn.btn-danger-soft:hover,
.single .entry-social .post-like-btn.btn-danger-soft:active {
    color: #fff;
    background-color: #4f9ef8;
    border-color: #4f9ef8;
}

.single .entry-social .post-fav-btn.btn-success-soft:focus,
.single .entry-social .post-like-btn.btn-danger-soft:focus {
    color: #4f9ef8;
    background-color: rgba(79, 158, 248, 0.1);
    border-color: transparent;
}

/* 详情页侧边栏标签云：统一字号，浅灰圆角背景 */
body.single .sidebar-wrapper .tagcloud a {
    display: inline-block;
    font-size: 11pt !important;
    line-height: 1.4;
    color: #191a1f !important;
    font-weight: 500;
    background-color: #f0f1f3;
    border-radius: 9999px;
    padding: 0.35rem 0.75rem;
    margin: 0 0.35rem 0.5rem 0;
    text-decoration: none !important;
}

body.single .sidebar-wrapper .tagcloud a:hover {
    background-color: #dfe0e5;
    color: #191a1f !important;
}

/* 底部 LOGO：仅放大底部，不影响顶栏 */
.site-footer .logo-wrapper img.logo {
    height: 63px;
    width: auto;
    max-height: none;
}

/* 底部 LOGO 下方站点介绍文案（如：把时间还给生活，把创意交给我们） */
.site-footer .col-md-4 > p.small.mb-0 {
    font-size: 1rem;
    color: #191a1f;
    letter-spacing: 0.06em;
    line-height: 1.6;
}

[data-bs-theme=dark] .site-footer .col-md-4 > p.small.mb-0 {
    color: #fff;
}
