/* 夜间主题 + H5：对齐对方站观感，数据仍用本站 */
:root {
    --app-bg: #0b0b0b;
    --app-bg-elevated: #141414;
    --app-nav: #181818;
    --app-surface: #1a1216;
    --app-accent: #ff2374;
    --app-accent-soft: #f77aa5;
    --app-hot: rgba(1, 132, 127, 0.6);
    --app-tab-muted: #7a7f99;
    --app-text: #f6f7f8;
    --app-text-dim: #b4b6c5;
    --app-hairline: rgba(255, 35, 116, 0.18);
}

html,
body.theme-dark.dark-mode,
body.theme-dark {
    background: var(--app-bg) !important;
    color: var(--app-text);
}

body.theme-dark #wrap,
body.theme-dark #body,
body.theme-dark #footer,
body.theme-dark #foot-menu {
    background: var(--app-bg) !important;
}

body.theme-dark #navbar.navbar,
body.theme-dark .navbar-sidebar.nav-fixed {
    background: linear-gradient(180deg, #2a0a16 0%, #0b0b0b 100%) !important;
    border-bottom: 1px solid var(--app-hairline);
    box-shadow: none;
}

body.theme-dark #navbar .navbar-brand img,
body.theme-dark .navbar-sidebar-item.logo img {
    filter: drop-shadow(0 0 8px rgba(255, 35, 116, 0.35));
}

body.theme-dark #navbar .nav-link,
body.theme-dark #navbar .navbar-nav a {
    color: var(--app-text-dim) !important;
}

body.theme-dark #navbar .nav-link:hover,
body.theme-dark #navbar .nav-item.active .nav-link {
    color: var(--app-accent) !important;
}

body.theme-dark #masthead.align-center {
    background:
        radial-gradient(120% 80% at 80% 0%, rgba(255, 35, 116, 0.28) 0%, transparent 55%),
        radial-gradient(80% 60% at 20% 0%, rgba(247, 122, 165, 0.16) 0%, transparent 50%),
        repeating-linear-gradient(
            0deg,
            transparent 0,
            transparent 11px,
            rgba(255, 35, 116, 0.06) 11px,
            rgba(255, 35, 116, 0.06) 12px
        ),
        repeating-linear-gradient(
            90deg,
            transparent 0,
            transparent 11px,
            rgba(255, 35, 116, 0.06) 11px,
            rgba(255, 35, 116, 0.06) 12px
        ),
        #0b0b0b;
}

body.theme-dark #masthead .blog-title {
    color: var(--app-text);
    font-weight: 600;
    letter-spacing: 0.02em;
}

body.theme-dark #masthead .blog-description {
    color: var(--app-tab-muted);
}

body.theme-dark.card #index article .post-card,
body.theme-dark.card #archive article .post-card {
    position: relative;
    background-color: var(--app-bg-elevated);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

body.theme-dark.card #index article .post-card-mask,
body.theme-dark.card #archive article .post-card-mask {
    background: rgba(0, 0, 0, 0.3);
}

/* HOT 角标：对方站青绿斜条 */
body.theme-dark .wraps {
    background: var(--app-hot) !important;
    border-color: rgba(255, 255, 255, 0.72) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35), 0 1.3125rem 0.3125rem -1.125rem rgba(0, 0, 0, 0.6);
}

body.theme-dark .page-nav .page-navigator li.active a,
body.theme-dark .page-nav .page-navigator li a:hover,
body.theme-dark #submitBtn,
body.theme-dark .login_dialog .btn,
body.theme-dark .warning-container .confirm {
    background: var(--app-accent) !important;
    border-color: var(--app-accent) !important;
    color: #fff !important;
}

body.theme-dark .page-nav .page-navigator li a,
body.theme-dark .page-jump input {
    background: var(--app-bg-elevated);
    border: 1px solid var(--app-hairline);
    color: var(--app-text);
}

body.theme-dark .swiper-pagination-bullet-active {
    background-color: var(--app-accent) !important;
}

body.theme-dark .login_dialog .login_modal {
    background: #12080c;
    border: 1px solid var(--app-hairline);
}

body.theme-dark .search-results .result-item {
    background: var(--app-bg-elevated);
    border: 1px solid var(--app-hairline);
    border-radius: 10px;
}

body.theme-dark .search-results .result-item h3 {
    color: var(--app-text);
}

body.theme-dark .footer-desc,
body.theme-dark #footer,
body.theme-dark #footer a,
body.theme-dark h3.footer-link a {
    color: var(--app-tab-muted) !important;
    border-color: #1e1e22 !important;
}

body.theme-dark .foot-menu a {
    color: var(--app-text-dim) !important;
}

body.theme-dark .foot-menu a:hover,
body.theme-dark .foot-menu a:active,
body.theme-dark .foot-menu a.is-active {
    color: var(--app-accent) !important;
}

/* 侧滑导航暗色 */
body.theme-dark #site-navigation.sidebar,
body.theme-dark #nav {
    background: var(--app-nav) !important;
}

body.theme-dark #nav .menu a,
body.theme-dark #nav .menu-item a,
body.theme-dark #nav .nav-link,
body.theme-dark #nav .dropdown-item a {
    color: var(--app-text) !important;
}

body.theme-dark #nav .search-box #search,
body.theme-dark #nav .search-box .search {
    background: #222 !important;
    color: var(--app-text-dim) !important;
    border-radius: 999px;
}

body.theme-dark #nav-toolbar .side-toolbar-list .text {
    color: var(--app-text-dim);
}

body.theme-dark #post .post-title {
    color: var(--app-text);
}

body.theme-dark #post .post-meta,
body.theme-dark #post .post-meta a,
body.theme-dark #post .post-meta time {
    color: var(--app-tab-muted) !important;
}

body.theme-dark #post .post-content {
    color: #e8e8ee;
}

body.theme-dark #post .line {
    border-color: #2a2a30 !important;
    background: #2a2a30 !important;
}

body.no-banner #masthead,
body.search-page #masthead {
    display: none !important;
}

body.theme-dark.use-navbar.no-banner #wrap,
body.theme-dark.search-page #wrap {
    padding-top: calc(3.25rem + env(safe-area-inset-top));
}

@media (min-width: 768px) {
    body.theme-dark.use-navbar.no-banner #wrap,
    body.theme-dark.search-page #wrap {
        padding-top: 4.5rem;
    }
}

body.theme-dark .addbox > div {
    background: #1c1a1b !important;
}

/* ========== H5 / 手机（对齐对方 max-width:767） ========== */
@media (max-width: 767.98px) {
    body.theme-dark,
    body.theme-dark #wrap,
    body.theme-dark #body {
        background: #0b0b0b !important;
    }

    body.theme-dark.card #body {
        padding-top: 0;
    }

    body.theme-dark.card .container {
        max-width: 710px;
        background-color: #0b0b0b;
    }

    /* 顶部：手机用侧栏顶条，PC 顶栏隐藏 */
    body.mobile #navbar.navbar,
    body.phone #navbar.navbar {
        display: none !important;
    }

    body.theme-dark .navbar-sidebar.nav-fixed,
    body.use-navbar .navbar-sidebar.nav-fixed {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1100;
        height: 3.25rem;
        padding: 0 0.75rem;
        padding-top: env(safe-area-inset-top);
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        background: var(--app-nav) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: none;
    }

    body.theme-dark .navbar-sidebar-item {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        color: var(--app-text);
        font-size: 0.875rem;
    }

    body.theme-dark .navbar-sidebar-item.logo img {
        max-height: 1.75rem;
        width: auto;
    }

    body.theme-dark .navbar-sidebar-item.black img,
    body.theme-dark .navbar-sidebar-item .search img,
    body.theme-dark .navbar-sidebar-item .avatar_btn,
    body.theme-dark .navbar-sidebar-item .avatar_btn_user {
        width: 1.35rem;
        height: 1.35rem;
        object-fit: contain;
    }

    body.theme-dark .navbar-sidebar-item.btns {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    /* 给固定顶栏留空 */
    body.mobile #wrap,
    body.phone #wrap {
        padding-top: calc(3.25rem + env(safe-area-inset-top));
    }

    body.mobile #masthead,
    body.phone #masthead {
        min-height: 12.5rem !important;
        height: auto !important;
    }

    body.mobile #masthead .blog-title,
    body.phone #masthead .blog-title {
        font-size: 1.25rem !important;
        line-height: 1.4;
        padding: 0 1rem;
    }

    body.mobile #masthead .blog-description,
    body.phone #masthead .blog-description {
        font-size: 0.85rem !important;
        padding: 0 1rem 1rem;
        opacity: 0.85;
    }

    /* 列表：对方站 padding 4rem 3rem 3.5rem */
    body.card.mobile #index,
    body.card.phone #index,
    body.card.mobile #archive,
    body.card.phone #archive,
    body.card #index,
    body.card #archive {
        padding: 4rem 3rem 3.5rem !important;
    }

    body.card.mobile #index article,
    body.card.phone #index article,
    body.card.mobile #archive article,
    body.card.phone #archive article,
    body.card #index article,
    body.card #archive article {
        padding: 0.9375rem 0 1.25rem !important;
    }

    body.theme-dark.card #index article .post-card,
    body.theme-dark.card #archive article .post-card {
        border-radius: 0.625rem;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    }

    body.card #index article .post-card-mask,
    body.card #archive article .post-card-mask {
        height: 12.5rem !important;
        background-color: rgba(0, 0, 0, 0.3) !important;
        background-image: none !important;
    }

    body.card #index article .advert-card {
        height: 12.5rem !important;
    }

    body.card #index article .post-card-container,
    body.card #archive article .post-card-container {
        padding: 1rem !important;
        vertical-align: middle;
        text-align: center;
    }

    body.card #index article .post-card-title,
    body.card #archive article .post-card-title {
        font-size: 1.1625rem !important;
        line-height: 1.45;
        text-align: center;
        margin-bottom: 0.5rem;
        position: relative;
    }

    body.card #index article .post-card-info,
    body.card #archive article .post-card-info {
        font-size: 0.8125rem !important;
        text-align: center;
        opacity: 0.9;
    }

    /* HOT 斜条尺寸对齐对方 H5 */
    body .wrap {
        top: 0 !important;
        left: 0 !important;
        opacity: 0.6;
        pointer-events: none;
    }

    body .wraps {
        width: 10rem !important;
        height: 1.75rem !important;
        line-height: 1.625rem !important;
        top: 1.125rem !important;
        right: -3.25rem !important;
        font-size: 0.875rem !important;
        font-weight: 400;
    }

    /* 底栏四入口：固定贴底 */
    body.mobile #foot-menu,
    body.phone #foot-menu {
        position: relative;
        padding-bottom: calc(3.75rem + env(safe-area-inset-bottom));
    }

    body.mobile #foot-menu .foot-menu,
    body.phone #foot-menu .foot-menu {
        display: flex !important;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        margin: 0;
        padding: 0.45rem 0 calc(0.45rem + env(safe-area-inset-bottom));
        background: rgba(11, 11, 11, 0.96);
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    body.mobile #foot-menu .line-container,
    body.phone #foot-menu .line-container {
        margin: 1.25rem 0;
    }

    body.mobile #foot-menu .foot-menu img,
    body.phone #foot-menu .foot-menu img {
        max-width: 1.5rem;
    }

    body.mobile #foot-menu .foot-menu span,
    body.phone #foot-menu .foot-menu span {
        font-size: 0.72rem;
        margin-top: 0.2rem;
    }

    body.mobile .page-nav,
    body.phone .page-nav {
        padding-bottom: 1rem;
    }

    body.mobile .page-navigator,
    body.phone .page-navigator {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.25rem;
        margin-top: 2rem;
    }

    /* 添加到主屏幕条：抬到底栏上方 */
    body.mobile .addbox,
    body.phone .addbox {
        bottom: calc(3.6rem + env(safe-area-inset-bottom)) !important;
    }

    /* 侧栏抽屉 */
    body.theme-dark #site-navigation.sidebar {
        background: var(--app-nav) !important;
    }

    body.mobile #nav .author {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    body.mobile #nav .menu {
        margin-top: 1.25rem;
    }

    /* 详情页 */
    body.mobile #post article,
    body.phone #post article {
        margin-top: 0.5rem;
        padding-bottom: 2rem;
    }

    body.mobile #post .post-title,
    body.phone #post .post-title {
        font-size: 1.25rem !important;
        line-height: 1.45;
        padding: 0 0.25rem;
    }

    body.mobile #post .post-meta,
    body.phone #post .post-meta {
        font-size: 0.8rem;
        flex-wrap: wrap;
    }

    body.mobile #post .post-content,
    body.phone #post .post-content {
        font-size: 1rem;
        line-height: 1.7;
        word-break: break-word;
    }

    body.mobile #post .post-content img,
    body.phone #post .post-content img {
        max-width: 100%;
        height: auto;
        border-radius: 0.35rem;
    }
}

@media (max-width: 390px) {
    .page-jump input {
        max-width: 3rem;
    }
}

@media (max-width: 336px) {
    body.card #index article .post-card-mask,
    body.card #archive article .post-card-mask {
        height: 10.5rem !important;
    }

    body.card #index article .advert-card {
        height: 10.5rem !important;
    }

    body.card #index article .post-card-title,
    body.card #archive article .post-card-title {
        font-size: 1.05rem !important;
    }

    .page-navigator {
        margin-top: 1.5rem;
    }
}

@media (min-width: 768px) {
    body.desktop .navbar-sidebar.nav-fixed {
        display: none !important;
    }

    body.desktop #foot-menu .foot-menu {
        position: static;
    }
}
