/*
Theme Name: zhaiqi
Theme URI: https://example.com/zhaiqi
Author: 宅七Hs
Author URI: https://example.com
Description: 一款清新简约的WordPress个人博客主题，支持侧边栏自定义、顶部栏设置和卡片式文章展示。
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: zhaiqi
Tags: blog, custom-background, custom-menu, custom-logo, theme-options, one-column, two-columns, right-sidebar

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.
*/

/* ==================== Reset & Base ==================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

/* ==================== 全屏开场动画 ==================== */
.zhaiqi-preloader {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    background: #0a0f15;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.zhaiqi-preloader.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: none !important;
}

.zhaiqi-preloader-inner {
    position: relative;
    z-index: 1; /* 浮在背景画布之上 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
}

/* 萤火虫光线粒子背景画布 */
.zhaiqi-preloader-firefly {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* 旋转环 + 中心光点（必须作为定位上下文） */
.zhaiqi-preloader-ring {
    position: relative;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: #4ECDC4;
    border-right-color: #5B7C99;
    animation: preloaderSpin 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 50px rgba(78, 205, 196, 0.5), 0 0 100px rgba(78, 205, 196, 0.2), inset 0 0 30px rgba(78, 205, 196, 0.1);
    flex-shrink: 0;
}

/* 中心光点（基于 ring 居中） */
.zhaiqi-preloader-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 26px;
    height: 26px;
    margin: -13px 0 0 -13px;
    background: #4ECDC4;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(78, 205, 196, 1), 0 0 60px rgba(78, 205, 196, 0.6), 0 0 90px rgba(78, 205, 196, 0.3);
    animation: preloaderPulse 1.2s ease-in-out infinite;
}

/* 文字区 */
.zhaiqi-preloader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    animation: preloaderTextIn 0.6s ease-out forwards;
}

.zhaiqi-preloader-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.08em;
    text-shadow: 0 0 30px rgba(78, 205, 196, 0.5);
}

.zhaiqi-preloader-subtitle {
    font-size: 0.75rem;
    color: rgba(78, 205, 196, 0.7);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: preloaderDots 1.5s steps(4, end) infinite;
}

/* ── 关键帧 ── */
@keyframes preloaderSpin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes preloaderPulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.6); opacity: 0.5; }
}

@keyframes preloaderTextIn {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes preloaderDots {
    0%   { content: 'Loading'; }
    25%  { content: 'Loading.'; }
    50%  { content: 'Loading..'; }
    75%  { content: 'Loading...'; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .zhaiqi-preloader-ring { width: 60px; height: 60px; }
    .zhaiqi-preloader-dot  { width: 10px; height: 10px; margin: -5px 0 0 -5px; }
    .zhaiqi-preloader-title { font-size: 1.2rem; }
}

/* ==================== SVG 动画通用容器 ==================== */
.zhaiqi-preloader-svg-wrap {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
}

/* ── 霓虹描边字 SVG ── */
.zhaiqi-preloader-text-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.zhaiqi-preloader-drawtext-svg {
    width: min(520px, 92vw);
    height: auto;
    aspect-ratio: 500 / 110;
    filter: drop-shadow(0 0 20px rgba(78, 205, 196, 0.6)) drop-shadow(0 0 40px rgba(78, 205, 196, 0.3));
}

.zhaiqi-draw-text {
    stroke-dasharray: 900;
    stroke-dashoffset: 900;
    animation: drawText 3s ease-in-out forwards;
}

@keyframes drawText {
    0%   { stroke-dashoffset: 900; fill: transparent; opacity: 0; }
    10%  { opacity: 1; }
    75%  { stroke-dashoffset: 0; fill: transparent; }
    100% { stroke-dashoffset: 0; fill: rgba(78, 205, 196, 0.18); }
}

/* 加载文字 */
.zhaiqi-preloader-subtitle {
    font-size: 0.9rem;
    color: rgba(78, 205, 196, 0.85);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    text-shadow: 0 0 15px rgba(78, 205, 196, 0.5);
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    opacity: 0.8;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    padding-left: 1.5em;
}

/* ==================== Layout ==================== */
.zhaiqi-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ==================== Sidebar ==================== */
.zhaiqi-sidebar {
    width: 260px;
    background-color: #4ECDC4;
    color: white;
    padding: 30px 20px;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zhaiqi-sidebar-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    flex-shrink: 0; /* 侧栏内容超高时防止圆形 logo 被纵向压塌 */
}

.zhaiqi-sidebar-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zhaiqi-sidebar-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: center;
    color: white;
    flex-shrink: 0;
}

/* Sidebar search form (desktop: full width between title and menu) */
.zhaiqi-mobile-search-form {
    display: flex;
    width: 100%;
    margin-bottom: 20px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.zhaiqi-mobile-search-input {
    flex: 1;
    min-width: 0;
    padding: 10px 12px;
    background: transparent;
    border: none;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.zhaiqi-mobile-search-input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.zhaiqi-mobile-search-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: none;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.zhaiqi-mobile-search-submit:hover {
    background-color: rgba(255, 255, 255, 0.35);
}

.zhaiqi-sidebar-menu {
    list-style: none;
    padding: 0;
    width: 100%;
}

.zhaiqi-sidebar-menu li {
    margin-bottom: 2px;
}

.zhaiqi-sidebar-menu a,
.zhaiqi-sidebar-menu span.no-link {
    display: block;
    padding: 8px 16px;
    border-radius: 8px;
    color: white;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.zhaiqi-sidebar-menu a {
    cursor: pointer;
}

.zhaiqi-sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: translateX(4px);
}

/* Non-clickable menu items (name only, no link) */
.zhaiqi-sidebar-menu span.no-link {
    cursor: default;
    opacity: 0.85;
}

.zhaiqi-sidebar-menu li.active > a,
.zhaiqi-sidebar-menu li.active > span.no-link,
.zhaiqi-sidebar-menu a.current {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* ==================== 留言按钮（侧边栏/抽屉底部） ==================== */
.zhaiqi-guestbook-btn {
    margin-top: 10px;
    align-self: stretch; /* flex 居中容器里拉满宽度 */
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.zhaiqi-guestbook-btn:hover {
    background-color: rgba(255, 255, 255, 0.28);
    opacity: 1;
    transform: translateX(4px);
}

/* 侧栏底部留白：菜单较长时按钮可滚动到音乐播放器上方 */
.zhaiqi-sidebar {
    padding-bottom: 140px;
}

/* 移动端抽屉里的留言按钮（抽屉内容不吸底，用固定间距） */
.zhaiqi-guestbook-btn-drawer {
    margin-top: 16px;
}

/* 小工具按钮（样式与留言按钮一致，位于其上方） */
.zhaiqi-tools-btn {
    margin-top: 10px;
    align-self: stretch;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 0.95rem;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.zhaiqi-tools-btn:hover {
    background-color: rgba(255, 255, 255, 0.28);
    opacity: 1;
    transform: translateX(4px);
}

.zhaiqi-tools-btn-drawer {
    margin-top: 16px;
}

/* ==================== 工具箱聚合页 ==================== */
.zhaiqi-tools-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 16px;
    margin-top: 8px;
}

@media (max-width: 1400px) {
    .zhaiqi-tools-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1000px) {
    .zhaiqi-tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .zhaiqi-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.zhaiqi-tool-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 18px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.zhaiqi-tool-card:hover {
    transform: translateY(-3px);
    border-color: rgba(78, 205, 196, 0.6);
    box-shadow: 0 8px 24px rgba(78, 205, 196, 0.18);
    opacity: 1;
}

.zhaiqi-tool-card-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #ffffff;
    background: linear-gradient(135deg, #4ECDC4 0%, #7B9EC9 100%);
}

.zhaiqi-tool-card-body {
    flex: 1;
    min-width: 0;
}

.zhaiqi-tool-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.zhaiqi-tool-card-desc {
    font-size: 12.5px;
    color: #999;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zhaiqi-tool-card-tag {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 11px;
    color: #4ECDC4;
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.35);
    border-radius: 999px;
    padding: 2px 8px;
}

.zhaiqi-tools-note {
    margin-top: 18px;
    font-size: 12.5px;
    color: #aaa;
    text-align: center;
}

@media (max-width: 480px) {
    .zhaiqi-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 内嵌工具视图（工具箱页内打开工具） ==================== */
/* hidden 属性会被 display:grid/block 等作者样式覆盖，需显式补刀 */
.zhaiqi-tool-viewer[hidden],
.zhaiqi-tools-grid[hidden] {
    display: none;
}

.zhaiqi-tool-viewer-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.zhaiqi-tool-viewer-back {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid rgba(78, 205, 196, 0.45);
    background: rgba(78, 205, 196, 0.12);
    color: #4ECDC4;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.zhaiqi-tool-viewer-back:hover {
    background: rgba(78, 205, 196, 0.25);
}

.zhaiqi-tool-viewer-name {
    font-size: 13px;
    color: #999;
}

.zhaiqi-tool-viewer-frame {
    display: block;
    width: 100%;
    min-height: 480px;
    border: none;
    border-radius: 12px;
    background: #0f1115;
}

/* 工具打开时：介绍卡隐藏（JS 控制），工具视图 flex 撑满至底部栏之上 */
.zhaiqi-content.tools-viewer-open {
    display: flex;
    flex-direction: column;
}

.zhaiqi-content.tools-viewer-open .zhaiqi-tool-viewer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.zhaiqi-content.tools-viewer-open .zhaiqi-tool-viewer-frame {
    flex: 1;
    min-height: 480px;
}

/* ==================== Mobile Menu (shown above topbar on small screens) ==================== */
.zhaiqi-mobile-menu {
    display: none;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    padding: 0 16px;
    -webkit-overflow-scrolling: touch;
    /* 细滚动条：Webkit（Chrome/Safari/Edge/微信） */
    scrollbar-width: thin;
    scrollbar-color: rgba(78, 205, 196, 0.4) transparent;
    /* 移动端媒体查询中 display: flex + align-items: center + gap */
}

/* 菜单列表区域单独可滚动 */
.zhaiqi-mobile-menu .zhaiqi-mobile-menu-list-wrapper {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
}

/* Webkit 滚动条样式（在 wrapper 上） */
.zhaiqi-mobile-menu-list-wrapper::-webkit-scrollbar {
    height: 4px;
}

.zhaiqi-mobile-menu-list-wrapper::-webkit-scrollbar-track {
    background: transparent;
}

.zhaiqi-mobile-menu-list-wrapper::-webkit-scrollbar-thumb {
    background-color: rgba(78, 205, 196, 0.4);
    border-radius: 2px;
}

.zhaiqi-mobile-menu-list-wrapper::-webkit-scrollbar-thumb:hover {
    background-color: rgba(78, 205, 196, 0.65);
}

/* 左右边缘渐变提示：有可滚动内容时显示 */
.zhaiqi-mobile-menu-list-wrapper {
    position: relative;
}

.zhaiqi-mobile-menu-list-wrapper::before,
.zhaiqi-mobile-menu-list-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    z-index: 1;
    opacity: var(--edge-left, 0);
    transition: opacity 0.3s ease;
}

.zhaiqi-mobile-menu-list-wrapper::before {
    left: 0;
    background: linear-gradient(to right, #fff, transparent);
}

.zhaiqi-mobile-menu-list-wrapper::after {
    right: 0;
    opacity: var(--edge-right, 0);
    background: linear-gradient(to left, #fff, transparent);
}

.zhaiqi-mobile-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 8px;
    white-space: nowrap;
}

.zhaiqi-mobile-menu-list li {
    flex-shrink: 0;
}

.zhaiqi-mobile-menu-list a,
.zhaiqi-mobile-menu-list span.no-link {
    display: block;
    padding: 12px 8px;
    color: #333;
    font-size: 0.9rem;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.zhaiqi-mobile-menu-list a:hover {
    color: #4ECDC4;
    opacity: 1;
}

.zhaiqi-mobile-menu-list li.active > a,
.zhaiqi-mobile-menu-list li.active > span.no-link,
.zhaiqi-mobile-menu-list a.current {
    color: #4ECDC4;
    border-bottom-color: #4ECDC4;
    font-weight: 600;
}

/* ==================== 汉堡按钮 ==================== */
.zhaiqi-hamburger {
    display: none; /* 仅移动端显示 */
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 10;
}

.zhaiqi-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background-color: #333;
    border-radius: 1px;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
    position: absolute;
    left: 8px;
}

.zhaiqi-hamburger span:nth-child(1) { top: 10px; }
.zhaiqi-hamburger span:nth-child(2) { top: 17px; }
.zhaiqi-hamburger span:nth-child(3) { top: 24px; }

/* 展开态：三线变 X */
.zhaiqi-hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg);
    top: 17px;
}
.zhaiqi-hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.zhaiqi-hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg);
    top: 17px;
}

/* ==================== 移动端抽屉（侧边栏导航） ==================== */

/* 遮罩层 */
.zhaiqi-mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zhaiqi-mobile-drawer-overlay.is-visible {
    display: block;
    opacity: 1;
}

/* 抽屉面板（桌面侧边栏同款青绿主题） */
.zhaiqi-mobile-drawer {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    max-width: 72vw;
    background-color: #4ECDC4;
    color: white;
    z-index: 999;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
}

.zhaiqi-mobile-drawer.is-visible {
    display: block;
    transform: translateX(0);
}

/* 关闭按钮 */
.zhaiqi-drawer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 5;
}

.zhaiqi-drawer-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* 抽屉内容：居中布局，与桌面侧边栏一致 */
.zhaiqi-mobile-drawer-inner {
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.zhaiqi-mobile-drawer-logo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 10px;
}

.zhaiqi-mobile-drawer-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zhaiqi-mobile-drawer-logo span {
    font-size: 2rem;
    color: #fff;
    font-weight: 700;
}

.zhaiqi-mobile-drawer-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: white;
    margin: 0 0 14px;
    text-align: center;
}

/* 抽屉内导航：复用桌面侧边栏菜单样式（白字圆角胶囊） */
.zhaiqi-drawer-nav {
    width: 100%;
}

.zhaiqi-drawer-nav .zhaiqi-sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.zhaiqi-drawer-nav .zhaiqi-sidebar-menu li {
    margin-bottom: 2px;
}

.zhaiqi-drawer-nav .zhaiqi-sidebar-menu a,
.zhaiqi-drawer-nav .zhaiqi-sidebar-menu span.no-link {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: white;
    font-size: 0.95rem;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.zhaiqi-drawer-nav .zhaiqi-sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.2);
    opacity: 1;
    transform: translateX(4px);
}

.zhaiqi-drawer-nav .zhaiqi-sidebar-menu span.no-link {
    opacity: 0.85;
}

.zhaiqi-drawer-nav .zhaiqi-sidebar-menu li.active > a,
.zhaiqi-drawer-nav .zhaiqi-sidebar-menu li.active > span.no-link,
.zhaiqi-drawer-nav .zhaiqi-sidebar-menu a.current {
    background-color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* ==================== Main Content Area ==================== */
.zhaiqi-main-wrapper {
    margin-left: 260px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==================== Top Bar / Header ==================== */
.zhaiqi-topbar {
    background-color: #5B7C99;
    color: white;
    padding-top: var(--zhaiqi-topbar-padding-top, 60px);
    padding-bottom: var(--zhaiqi-topbar-padding-bottom, 60px);
    padding-left: 40px;
    padding-right: 40px;
    text-align: left;
    position: relative;
}

/* Topbar text alignment variants */
.topbar-align-center .zhaiqi-topbar-title {
    text-align: center;
}

.topbar-align-right .zhaiqi-topbar-title {
    text-align: right;
}

.zhaiqi-topbar-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.zhaiqi-topbar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(91, 124, 153, var(--zhaiqi-topbar-overlay-opacity, 0));
    z-index: 1;
    /* 滚动视差：遮罩以 0.1 倍速度上移（最慢） */
    transform: translateY(calc(var(--scroll-y, 0px) * -0.05));
    transition: transform 0.15s linear;
}

.zhaiqi-topbar-content {
    position: relative;
    z-index: 2;
}

.zhaiqi-topbar-title {
    font-size: var(--zhaiqi-topbar-font-size, 20px);
    color: white;
    margin: 0;
    font-weight: 500;
    /* 滚动视差：标题以 0.4 倍速度上移 */
    transform: translateY(calc(var(--scroll-y, 0px) * -0.2));
    transition: transform 0.15s linear;
}

/* Visit counter: top-right corner of topbar */
.zhaiqi-visit-count {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 12px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.zhaiqi-visit-count-num {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .zhaiqi-visit-count {
        position: fixed;
        top: 6px;
        right: 8px;
        z-index: 999;
        padding: 2px 6px;
        font-size: 9px;
        gap: 3px;
    }

    /* 隐藏"历史访问"文字，只留眼睛图标+数字，减少占位宽度 */
    .zhaiqi-visit-count-label {
        display: none;
    }
}

/* ==================== Topbar Background Animations ==================== */

/* 1. 动态渐变 —— 缓慢流动的多色渐变（用 CSS 变量让用户能改颜色） */
.topbar-anim-gradient .zhaiqi-topbar {
    background: linear-gradient(
        135deg,
        var(--zhaiqi-topbar-anim-c1, #5B7C99) 0%,
        var(--zhaiqi-topbar-anim-c2, #4ECDC4) 25%,
        var(--zhaiqi-topbar-anim-c3, #7B9EC9) 50%,
        var(--zhaiqi-topbar-anim-c1, #5B7C99) 75%,
        var(--zhaiqi-topbar-anim-c2, #4ECDC4) 100%
    );
    background-size: 400% 400%;
    animation: topbarGradientFlow 12s ease infinite;
}

@keyframes topbarGradientFlow {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 2. 漂浮粒子 —— 多色小圆点缓缓上升（不覆盖背景色，仅加粒子层） */
.topbar-anim-particles .zhaiqi-topbar {
    overflow: hidden;
}

.topbar-anim-particles .zhaiqi-topbar::before,
.topbar-anim-particles .zhaiqi-topbar::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 200%;
    top: 0;
    left: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.18) 2px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.12) 1.5px, transparent 1.5px),
        radial-gradient(circle, rgba(78,205,196,0.25) 2px, transparent 2px),
        radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1px);
    background-size: 120px 120px, 80px 80px, 60px 60px, 40px 40px;
    background-position: 0 0, 30px 60px, 15px 30px, 50px 20px;
    z-index: 0;
}

.topbar-anim-particles .zhaiqi-topbar::before {
    animation: particleRise1 25s linear infinite;
    opacity: 0.8;
}

.topbar-anim-particles .zhaiqi-topbar::after {
    animation: particleRise2 35s linear infinite;
    opacity: 0.5;
    background-size: 90px 90px, 70px 70px, 50px 50px, 30px 30px;
    background-position: 40px 40px, 10px 80px, 60px 20px, 20px 50px;
}

@keyframes particleRise1 {
    0%   { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

@keyframes particleRise2 {
    0%   { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-50%) translateX(-15px); }
}

/* 3. 流光条 —— 一道光从左滑到右，循环出现 */
.topbar-anim-sweep .zhaiqi-topbar {
    overflow: hidden;
}

.topbar-anim-sweep .zhaiqi-topbar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        100deg,
        transparent 0%,
        rgba(255,255,255,0) 35%,
        rgba(255,255,255,0.18) 50%,
        rgba(255,255,255,0) 65%,
        transparent 100%
    );
    animation: topbarSweep 4s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes topbarSweep {
    0%   { left: -100%; }
    100% { left: 150%; }
}

/* 4. 发光泡沫 —— 几团发光球随机位置慢慢漂动 */
.topbar-anim-bubbles .zhaiqi-topbar {
    overflow: hidden;
}

.topbar-anim-bubbles .zhaiqi-topbar::before,
.topbar-anim-bubbles .zhaiqi-topbar::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.topbar-anim-bubbles .zhaiqi-topbar::before {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow:
        0 0 10px rgba(255, 255, 255, 0.6),
        40px -10px 0 -2px rgba(255, 255, 255, 0.4),
        90px 20px  0 -3px rgba(78, 205, 196, 0.4),
        150px -25px 0 -2px rgba(255, 255, 255, 0.35),
        200px 15px  0 -2px rgba(78, 205, 196, 0.38),
        260px -5px  0 -1px rgba(255, 255, 255, 0.3),
        320px 30px  0 -3px rgba(78, 205, 196, 0.35);
    top: 30%;
    left: 15%;
    animation: bubbleFloat1 7s ease-in-out infinite;
}

.topbar-anim-bubbles .zhaiqi-topbar::after {
    width: 7px;
    height: 7px;
    background: rgba(78, 205, 196, 0.5);
    box-shadow:
        0 0 8px rgba(78, 205, 196, 0.5),
        -60px -35px 0 -2px rgba(255, 255, 255, 0.35),
        -120px 10px 0 -2px rgba(78, 205, 196, 0.35),
        -180px -20px 0 -1px rgba(255, 255, 255, 0.3),
        -240px 25px 0 -3px rgba(78, 205, 196, 0.32),
        -300px -30px 0 -2px rgba(255, 255, 255, 0.28),
        -360px 15px 0 -1px rgba(78, 205, 196, 0.3);
    top: 60%;
    left: 70%;
    animation: bubbleFloat2 9s ease-in-out infinite;
}

@keyframes bubbleFloat1 {
    0%, 100% { transform: translate(0, 0); opacity: 0.4; }
    25%      { transform: translate(40px, -15px); opacity: 0.9; }
    50%      { transform: translate(120px, 5px); opacity: 0.6; }
    75%      { transform: translate(60px, -10px); opacity: 0.9; }
}

@keyframes bubbleFloat2 {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    33%      { transform: translate(-50px, -20px); opacity: 0.9; }
    66%      { transform: translate(-100px, 10px); opacity: 0.6; }
}

/* 5. 星光闪烁 —— 散布的小星点交错忽明忽暗 */
.topbar-anim-stars .zhaiqi-topbar {
    overflow: hidden;
}

.topbar-anim-stars .zhaiqi-topbar::before,
.topbar-anim-stars .zhaiqi-topbar::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
        radial-gradient(3px 3px at 10% 15%,   rgba(255,255,255,0.9), transparent),
        radial-gradient(2px 2px at 25% 55%,   rgba(255,255,255,0.75), transparent),
        radial-gradient(4px 4px at 40% 30%,   rgba(255,255,255,0.85), transparent),
        radial-gradient(2px 2px at 55% 65%,   rgba(255,255,255,0.7), transparent),
        radial-gradient(3px 3px at 70% 12%,   rgba(255,255,255,0.9), transparent),
        radial-gradient(2px 2px at 85% 45%,   rgba(255,255,255,0.8), transparent),
        radial-gradient(3px 3px at 15% 75%,   rgba(255,255,255,0.65), transparent),
        radial-gradient(4px 4px at 60% 40%,   rgba(255,255,255,0.85), transparent),
        radial-gradient(2px 2px at 35% 8%,    rgba(255,255,255,0.7), transparent),
        radial-gradient(3px 3px at 80% 70%,   rgba(255,255,255,0.6), transparent),
        radial-gradient(2px 2px at 5% 50%,    rgba(255,255,255,0.78), transparent),
        radial-gradient(4px 4px at 50% 22%,   rgba(255,255,255,0.88), transparent),
        radial-gradient(2px 2px at 90% 88%,   rgba(255,255,255,0.65), transparent),
        radial-gradient(3px 3px at 22% 42%,   rgba(255,255,255,0.72), transparent),
        radial-gradient(2px 2px at 72% 58%,   rgba(255,255,255,0.8), transparent),
        radial-gradient(3px 3px at 45% 85%,   rgba(255,255,255,0.68), transparent);
    background-size: 100% 100%;
    animation: starTwinkle 2.5s ease-in-out infinite;
}

.topbar-anim-stars .zhaiqi-topbar::after {
    animation-delay: 1.2s;
    animation-duration: 3s;
    background-image:
        radial-gradient(4px 4px at 8% 35%,    rgba(78,205,196,0.85), transparent),
        radial-gradient(2px 2px at 22% 72%,   rgba(78,205,196,0.7), transparent),
        radial-gradient(3px 3px at 48% 18%,   rgba(78,205,196,0.8), transparent),
        radial-gradient(4px 4px at 68% 62%,   rgba(78,205,196,0.78), transparent),
        radial-gradient(2px 2px at 78% 28%,   rgba(78,205,196,0.65), transparent),
        radial-gradient(3px 3px at 32% 52%,   rgba(78,205,196,0.72), transparent),
        radial-gradient(2px 2px at 55% 78%,   rgba(78,205,196,0.6), transparent),
        radial-gradient(4px 4px at 92% 15%,   rgba(78,205,196,0.82), transparent),
        radial-gradient(2px 2px at 12% 60%,   rgba(78,205,196,0.7), transparent),
        radial-gradient(3px 3px at 75% 8%,    rgba(78,205,196,0.8), transparent),
        radial-gradient(2px 2px at 38% 88%,   rgba(78,205,196,0.68), transparent),
        radial-gradient(4px 4px at 18% 25%,   rgba(78,205,196,0.85), transparent),
        radial-gradient(3px 3px at 58% 48%,   rgba(78,205,196,0.75), transparent),
        radial-gradient(2px 2px at 85% 75%,   rgba(78,205,196,0.65), transparent),
        radial-gradient(4px 4px at 42% 5%,    rgba(78,205,196,0.82), transparent),
        radial-gradient(2px 2px at 65% 38%,   rgba(78,205,196,0.72), transparent);
}

@keyframes starTwinkle {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 1; }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .topbar-anim-sweep .zhaiqi-topbar::after { width: 80%; }
    .topbar-anim-bubbles .zhaiqi-topbar::before,
    .topbar-anim-bubbles .zhaiqi-topbar::after { width: 8px; height: 8px; }
}

/* ==================== Content Area ==================== */
.zhaiqi-content {
    flex: 1;
    padding: var(--zhaiqi-card-top-gap, 32px) 40px 40px;
    /* Let the content area fill the available width (sidebar 260px + flex: 1).
       Width is bound by .zhaiqi-single / .page max-width for readable article pages. */
}

/* 短页面时内容区撑满剩余高度，底部栏贴视口底部。
   flex:1 在 .zhaiqi-content 上，但它外层还有 Barba 的 [data-barba="wrapper"]，
   包裹层必须加入 flex 拉伸链，否则底部栏会悬空。 */
.zhaiqi-main-wrapper > [data-barba="wrapper"] {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ==================== Post Cards ==================== */
.zhaiqi-posts-grid {
    display: grid;
    /* Desktop: 5 cards per row */
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

/* Tablet: 3 columns */
@media (max-width: 1200px) {
    .zhaiqi-posts-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* 邻近卡片辉光强度变量（注册后可通过 transition 平滑过渡） */
@property --nglow {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

.zhaiqi-post-card {
    background-color: #ffffff;
    border-radius: var(--zhaiqi-card-border-radius, 12px);
    overflow: hidden;
    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.08),
        0 0 calc(var(--nglow, 0) * 30px) rgba(var(--zhaiqi-nglow-rgb, 78, 205, 196), calc(var(--nglow, 0) * 0.5));
    transition: transform 0.2s ease, box-shadow 0.25s ease, --nglow 0.3s ease;
}

.zhaiqi-post-card:hover {
    transform: translateY(-4px);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 0 calc(var(--nglow, 0) * 30px) rgba(var(--zhaiqi-nglow-rgb, 78, 205, 196), calc(var(--nglow, 0) * 0.5));
}

/* Card gradient background */
.zhaiqi-post-card {
    background: linear-gradient(
        to bottom,
        var(--zhaiqi-card-grad-top, #4ECDC4),
        var(--zhaiqi-card-grad-bottom, #4ECDC4)
    );
}

/* White content wrapper inside card */
.zhaiqi-post-card-inner {
    background-color: white;
    margin: 12px;
    border-radius: 8px;
    overflow: hidden;
}

.zhaiqi-post-card-image {
    width: 100%;
    aspect-ratio: var(--zhaiqi-card-img-ratio, 2 / 3);
    object-fit: cover;
}

.zhaiqi-post-card-image-placeholder {
    width: 100%;
    aspect-ratio: var(--zhaiqi-card-img-ratio, 2 / 3);
    background: linear-gradient(
        135deg,
        var(--zhaiqi-card-grad-top, #4ECDC4),
        var(--zhaiqi-card-grad-bottom, #4ECDC4)
    );
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
}

/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 2/3) {
    .zhaiqi-post-card-image-wrapper {
        position: relative;
        width: 100%;
        padding-top: calc(100% * var(--zhaiqi-card-img-ratio-fallback, 1.5));
        overflow: hidden;
    }
    .zhaiqi-post-card-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
}

.zhaiqi-post-card-body {
    padding: 16px;
}

.zhaiqi-post-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zhaiqi-post-card-excerpt {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.zhaiqi-post-card-meta {
    padding: 10px 16px;
    font-size: 0.75rem;
    color: #999;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
}

/* ==================== Single Post / Page ==================== */
.zhaiqi-single {
    background-color: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    /* 文章页宽度放开，更舒服的左图右文排版 */
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

/* 文章导航 + 评论区：与文章卡片同款（背景色/透明度由自定义器统一控制） */
.zhaiqi-single-nav,
#comments {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.zhaiqi-single-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding: 16px 32px;
}

#comments {
    padding: 28px 32px;
}

.zhaiqi-single-title {
    font-size: 2rem;
    margin-bottom: 16px;
    color: #333;
}

.zhaiqi-single-meta {
    font-size: 0.875rem;
    color: #999;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

/* ── 文章页：左图右文布局 ── */
.zhaiqi-single-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.zhaiqi-single-featured {
    flex-shrink: 0;
    width: 38%;
    max-width: 420px;
}

.zhaiqi-single-featured img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

.zhaiqi-single-main {
    flex: 1;
    min-width: 0;
}

/* 移动端：上图下文 */
@media (max-width: 768px) {
    .zhaiqi-single-layout {
        flex-direction: column;
    }
    .zhaiqi-single-featured {
        width: 100%;
        max-width: 100%;
    }
}

.zhaiqi-single-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
    /* 长链接/长英文串不断行会把正文容器撑出卡片，强制任意位置可断行 */
    word-break: break-word;
    overflow-wrap: anywhere;
}

.zhaiqi-single-content p {
    margin-bottom: 16px;
}

.zhaiqi-single-content h2,
.zhaiqi-single-content h3,
.zhaiqi-single-content h4 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: #333;
}

.zhaiqi-single-content img {
    border-radius: 8px;
    margin: 16px 0;
}

/* ==================== Footer ==================== */
.zhaiqi-footer {
    background-color: white;
    padding: 24px 40px;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    border-top: 1px solid #f0f0f0;
}

/* ==================== Pagination ==================== */
.zhaiqi-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.zhaiqi-pagination a,
.zhaiqi-pagination span {
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    background-color: white;
    color: #333;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.zhaiqi-pagination a:hover {
    background-color: #4ECDC4;
    color: white;
    opacity: 1;
}

.zhaiqi-pagination .current {
    background-color: #4ECDC4;
    color: white;
}

/* ==================== Search Form ==================== */
.zhaiqi-search-form {
    display: flex;
    margin-bottom: 20px;
}

.zhaiqi-search-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px 0 0 8px;
    font-size: 0.9rem;
    outline: none;
}

.zhaiqi-search-submit {
    padding: 10px 16px;
    border: none;
    background-color: #4ECDC4;
    color: white;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.zhaiqi-search-submit:hover {
    background-color: #3DBCB3;
}

/* ==================== Mobile Responsive ==================== */
@media (max-width: 768px) {
    .zhaiqi-wrapper {
        flex-direction: column;
    }

    .zhaiqi-sidebar {
        position: relative;
        width: 100%;
        padding: 16px 20px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
    }

    .zhaiqi-sidebar-logo {
        width: 50px;
        height: 50px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .zhaiqi-sidebar-title {
        font-size: 1.2rem;
        margin-bottom: 0;
        text-align: left;
    }

    .zhaiqi-mobile-search-form {
        display: flex;
        align-items: center;
        margin-left: auto;
        margin-right: 56px; /* 给右上角 fixed 的访问计数器（仅图标+数字）让位 */
        margin-bottom: 0;
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 20px;
        padding: 4px 4px 4px 12px;
        flex: 1;
        max-width: 160px;
        overflow: visible;
    }

    .zhaiqi-mobile-search-input {
        flex: 1;
        min-width: 0;
        padding: 0;
        background: transparent;
        border: none;
        color: white;
        font-size: 0.85rem;
        outline: none;
    }

    .zhaiqi-mobile-search-input::placeholder {
        color: rgba(255, 255, 255, 0.75);
    }

    .zhaiqi-mobile-search-submit {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 28px;
        height: 28px;
        padding: 0;
        border: none;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.25);
        color: white;
        cursor: pointer;
        flex-shrink: 0;
        transition: background-color 0.2s ease;
    }

    .zhaiqi-mobile-search-submit:hover {
        background-color: rgba(255, 255, 255, 0.4);
    }

    .zhaiqi-sidebar-menu {
        display: none; /* Moved to horizontal menu above topbar */
    }

    .zhaiqi-mobile-menu {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .zhaiqi-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* 抽屉在移动端可显示 */
    .zhaiqi-mobile-drawer.is-visible,
    .zhaiqi-mobile-drawer-overlay.is-visible {
        display: block;
    }

    .zhaiqi-main-wrapper {
        margin-left: 0;
    }

    .zhaiqi-topbar {
        padding-top: 16px;
        padding-bottom: 16px;
        padding-left: 20px;
        padding-right: 20px;
    }

    .zhaiqi-topbar-title {
        font-size: 1.25rem;
    }

    .zhaiqi-content {
        padding: 16px;
    }

    /* 移动端顶栏不显示留言按钮（抽屉内有同款） */
    .zhaiqi-sidebar .zhaiqi-guestbook-btn {
        display: none;
    }

    /* 移动端顶栏不显示小工具按钮（抽屉内有同款） */
    .zhaiqi-sidebar .zhaiqi-tools-btn {
        display: none;
    }

    /* Mobile card grid: two columns like Bilibili app feed */
    .zhaiqi-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Switch card images to portrait 3:4 on mobile */
    .zhaiqi-post-card-image,
    .zhaiqi-post-card-image-placeholder {
        aspect-ratio: 3 / 4;
    }

    .zhaiqi-post-card-inner {
        margin: 3px;
        border-radius: calc(var(--zhaiqi-card-border-radius, 12px) - 3px);
    }

    .zhaiqi-post-card-body {
        padding: 10px;
    }

    .zhaiqi-post-card-title {
        font-size: 0.875rem;
        margin-bottom: 4px;
        -webkit-line-clamp: 2;
    }

    .zhaiqi-post-card-excerpt {
        display: none;
    }

    .zhaiqi-post-card-meta {
        padding: 6px 10px;
        font-size: 0.65rem;
    }

    .zhaiqi-single {
        padding: 24px;
    }

    .zhaiqi-footer {
        padding: 16px;
    }
}

/* ==================== WordPress Admin Compatibility ==================== */
.wp-block {
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.alignleft {
    float: left;
    margin-right: 1.5em;
}

.alignright {
    float: right;
    margin-left: 1.5em;
}

/* ==================== Screen Reader Only ==================== */
.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ==================== APlayer Music Player ==================== */
/* 外部固定容器：控制位置和宽度 */
#zhaiqi-music-player-wrapper {
    position: fixed;
    left: 20px;
    bottom: 20px;
    right: auto;
    width: 220px;
    max-width: 220px;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    overflow: visible;
}

#zhaiqi-music-player-wrapper .aplayer {
    margin: 0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

/* 播放/暂停按钮始终居中在封面上 */
#zhaiqi-music-player-wrapper .aplayer .aplayer-pic .aplayer-pause {
    width: 26px !important;
    height: 26px !important;
    bottom: 50% !important;
    right: 50% !important;
    margin: 0 -15px -15px 0 !important;
    border: 2px solid #fff !important;
    border-radius: 50% !important;
}

#zhaiqi-music-player-wrapper .aplayer .aplayer-pic .aplayer-pause svg {
    position: absolute;
    top: 3px !important;
    left: 4px !important;
    height: 20px !important;
    width: 20px !important;
}

/* APlayer 主题适配（主题色 #4ECDC4 青绿色） */
.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {
    background-color: #4ECDC4 !important;
}

.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded {
    background-color: rgba(78, 205, 196, 0.3) !important;
}

.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon path {
    fill: #4ECDC4 !important;
}

.aplayer .aplayer-info .aplayer-music {
    border-bottom: 1px solid rgba(78, 205, 196, 0.2);
}

/* 播放列表项高亮 */
.aplayer .aplayer-list li:hover {
    background-color: rgba(78, 205, 196, 0.08) !important;
}

.aplayer .aplayer-list li.aplayer-list-light {
    background-color: rgba(78, 205, 196, 0.12) !important;
}

.aplayer .aplayer-list li.aplayer-list-light .aplayer-list-title {
    color: #4ECDC4 !important;
}

/* 移动端：圆形播放按钮固定在右下角（!important 覆盖 music-player.js 的内联 left/right） */
@media (max-width: 768px) {
    #zhaiqi-music-player-wrapper {
        left: auto !important;
        right: 14px !important;
        bottom: 14px;
        width: 52px;
        max-width: 52px;
        border-radius: 50%;
    }

    #zhaiqi-music-player-wrapper .aplayer {
        border-radius: 50%;
    }

        /* 移动端：只留下播放按钮 */
    /* 隐藏除了播放按钮之外的一切 */
    #zhaiqi-music-player-wrapper .aplayer-music,
    #zhaiqi-music-player-wrapper .aplayer-bar-wrap,
    #zhaiqi-music-player-wrapper .aplayer-time,
    #zhaiqi-music-player-wrapper .aplayer-icon-back,
    #zhaiqi-music-player-wrapper .aplayer-icon-forward,
    #zhaiqi-music-player-wrapper .aplayer-icon-mode,
    #zhaiqi-music-player-wrapper .aplayer-icon-menu,
    #zhaiqi-music-player-wrapper .aplayer-icons {
        display: none !important;
    }

    /* 封面缩到只露出按钮 */
    #zhaiqi-music-player-wrapper .aplayer-pic {
        width: 52px !important;
        height: 52px !important;
        margin: 0 auto !important;
        background: #4ECDC4 !important;
        border-radius: 50% !important;
        box-shadow: 0 4px 14px rgba(78, 205, 196, 0.45) !important;
        border: none !important;
        overflow: hidden !important;
    }

    /* 隐藏封面图片 */
    #zhaiqi-music-player-wrapper .aplayer-pic img {
        display: none !important;
    }

    /* 播放按钮居中在封面缩小的圆圈内 */
    #zhaiqi-music-player-wrapper .aplayer-button {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
        width: 28px !important;
        height: 28px !important;
    }

    #zhaiqi-music-player-wrapper .aplayer-button svg,
    #zhaiqi-music-player-wrapper .aplayer-button path {
        fill: #ffffff !important;
    }

    /* 去掉白色背景和边框 */
    #zhaiqi-music-player-wrapper,
    #zhaiqi-music-player-wrapper .aplayer,
    #zhaiqi-music-player-wrapper .aplayer-info,
    #zhaiqi-music-player-wrapper .aplayer-controller,
    #zhaiqi-music-player-wrapper .aplayer-body {
        background: transparent !important;
        background-color: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* 播放器压缩到 52px */
    #zhaiqi-music-player-wrapper .aplayer {
        min-height: 0 !important;
        height: 52px !important;
    }

    /* info 栏彻底清空 */
    #zhaiqi-music-player-wrapper .aplayer-info {
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    .aplayer .aplayer-info .aplayer-music .aplayer-title {
        font-size: 12px;
    }

    .aplayer .aplayer-info .aplayer-music .aplayer-author {
        font-size: 11px;
    }
}/* ==================== 淡入滑上（IntersectionObserver） ==================== */
.zhaiqi-fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.zhaiqi-fade-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 交互开关：关闭时直接显示 */
.no-fade-in-up .zhaiqi-fade-up {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* ==================== 卡片 3D 视差悬停 ==================== */
.zhaiqi-card-3d {
    transition: transform 0.15s ease-out;
    transform-style: preserve-3d;
}

.zhaiqi-card-3d .zhaiqi-post-card-inner {
    transition: box-shadow 0.3s ease;
}

.zhaiqi-card-3d:hover .zhaiqi-post-card-inner {
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

/* 关闭时正常行为 */
.no-card-3d .zhaiqi-card-3d {
    transition: none !important;
    transform: none !important;
}

/* ==================== 弹窗公告 ==================== */
.zhaiqi-announcement-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.zhaiqi-announcement-overlay.is-visible {
    opacity: 1;
    visibility: visible;
}

.zhaiqi-announcement-modal {
    background: #fff;
    color: #333;
    border-radius: 16px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.zhaiqi-announcement-overlay.is-visible .zhaiqi-announcement-modal {
    transform: scale(1) translateY(0);
}

.zhaiqi-announcement-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    transition: background 0.2s, color 0.2s;
}

.zhaiqi-announcement-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #333;
}

.zhaiqi-announcement-title {
    margin: 0 0 16px;
    font-size: 1.4rem;
    font-weight: 700;
    color: #222;
    padding-right: 32px;
}

.zhaiqi-announcement-title.is-center {
    text-align: center;
    padding-right: 0;
}

.zhaiqi-announcement-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #444;
}

.zhaiqi-announcement-content p {
    margin: 0 0 12px;
}

.zhaiqi-announcement-content p:last-child {
    margin-bottom: 0;
}

/* ==================== 点击涟漪 + 鼠标花粉 ==================== */
.zhaiqi-interact-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999998;
}

/* 开关关闭 */
.no-custom-cursor .zhaiqi-interact-canvas {
    display: none !important;
}

/* ==================== 404 页面 ==================== */
.zhaiqi-404 {
    text-align: center;
    padding: 70px 24px 60px;
}

/* 大标题：强调色 → 蓝灰 渐变文字 */
.zhaiqi-404-code {
    font-size: clamp(64px, 14vw, 120px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--zhaiqi-404-accent, #4ECDC4), #5B7C99);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 14px;
}

.zhaiqi-404-heading {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px;
}

.zhaiqi-404-message {
    font-size: 1rem;
    color: #888;
    margin: 0 0 30px;
}

/* 返回按钮 */
.zhaiqi-404-button {
    display: inline-block;
    padding: 12px 32px;
    background: var(--zhaiqi-404-accent, #4ECDC4);
    color: #fff;
    border-radius: 999px;
    font-size: 1rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--zhaiqi-404-accent, #4ECDC4) 35%, transparent);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.zhaiqi-404-button:hover {
    transform: translateY(-2px);
    opacity: 0.92;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--zhaiqi-404-accent, #4ECDC4) 45%, transparent);
}

/* 搜索框 */
.zhaiqi-404-search {
    margin-top: 36px;
    display: flex;
    justify-content: center;
}

/* 移动端 */
@media (max-width: 768px) {
    .zhaiqi-404 { padding: 48px 16px 40px; }
    .zhaiqi-404-heading { font-size: 1.25rem; }
}

/* ==================== 整站网页背景（萤火虫动画画布） ==================== */
#zhaiqi-site-bg-firefly {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1; /* 在 body 背景之上、所有内容之下 */
    pointer-events: none;
}

/* ==================== 开场动画：进度圆环 ==================== */
.zhaiqi-preloader-ring.is-progress {
    border: none;
    animation: none;
    box-shadow: 0 0 50px rgba(78, 205, 196, 0.5), 0 0 100px rgba(78, 205, 196, 0.2), inset 0 0 30px rgba(78, 205, 196, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.zhaiqi-preloader-progress-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg); /* 从正上方开始 */
}

.zhaiqi-progress-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.12);
    stroke-width: 5;
}

.zhaiqi-progress-bar {
    fill: none;
    stroke: url(#zhaiqi-draw-grad);
    stroke: #4ECDC4;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 282.74; /* 2π×45 */
    stroke-dashoffset: 282.74;
}

.zhaiqi-preloader-percent {
    position: relative;
    z-index: 1;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4ECDC4;
    text-shadow: 0 0 20px rgba(78, 205, 196, 0.8);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .zhaiqi-preloader-percent { font-size: 1.1rem; }
}

/* ==================== 开场动画：手写字（描边→填充） ==================== */
.zhaiqi-preloader.is-handwrite .zhaiqi-draw-text {
    stroke-dasharray: 700;
    stroke-dashoffset: 700;
}

/* ==================== Barba 过渡期间锁定导航点击 ==================== */
html.zhaiqi-transitioning a {
    pointer-events: none;
}

/* 音乐播放器在过渡期间保持可用 */
html.zhaiqi-transitioning #zhaiqi-music-player-wrapper a,
html.zhaiqi-transitioning #zhaiqi-music-player-wrapper .aplayer {
    pointer-events: auto;
}
