/*
Theme Name: Ashlord PIX (WordPress 复刻版)
Theme URI: https://ashlord.com/
Author: Antigravity (Ashlord PIX Replica)
Author URI: https://ashlord.com/
Description: 1:1 深度复刻 https://ashlord.com/ (PIX 轻社交朋友圈风格主题 · 基佬紫/暗黑双模)。完整包含：瞬间/片刻(Moments)朋友圈时间流（支持九宫格灯箱、内嵌文章卡片、话题筛选、前台弹窗发动态、内联展开评论、生成二维码分享海报）、文章归档卡片流、文章详情页（含AI摘要框、自动悬浮目录TOC、代码模糊解锁、点赞打赏）、友链页（含顶部申请说明卡片与友链墙）、底部Meting网易云/自定义同步歌词音乐播放器、以及Ashlord同款页脚组件（Komari服务器实时状态条、运行时间计时器、访客IP与运营商识别、萌ICP备徽章、外链安全跳转）。
Version: 1.4.6
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: ashlord-pix
*/

:root {
    --toc-color: #58a5c3;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* Ashlord.com 专属九宫格/四宫格自适应图片布局 */
.img_list .list_inner {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row;
    align-content: center;
}

.img_list span {
    padding: 3px;
    position: relative;
    width: 25%;
    margin: 3px;
    cursor: zoom-in;
    display: block;
}

.img_list span:nth-child(1):nth-last-child(4),
.img_list span:nth-child(3):nth-last-child(2),
.img_list span:nth-child(4):nth-last-child(1) {
    width: 25%;
}

.img_list span:nth-child(2):nth-last-child(3) {
    margin-right: 30%;
}

.img_list span img {
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.img_list span:hover img {
    transform: scale(1.02);
}

.img_list .list_inner span:before {
    content: "";
    display: block;
    padding-top: 100%;
}

.img_list span:nth-last-child(1):first-child {
    width: 60%;
}

.img_list span:nth-last-child(1):first-child:before {
    padding: 0;
}

.img_list span:nth-last-child(1):first-child img {
    position: relative;
    max-height: 360px;
    width: auto;
    max-width: 100%;
    height: auto;
}

@media only screen and (max-width: 540px) {
    .img_list span {
        width: 30%;
        margin: 2px;
    }
    .img_list span:nth-child(1):nth-last-child(4),
    .img_list span:nth-child(3):nth-last-child(2),
    .img_list span:nth-child(4):nth-last-child(1) {
        width: 30%;
    }
}

/* Ashlord Fancybox 图片灯箱全屏居中修复 */
.fancybox-slide--image { padding: 0 !important; overflow: hidden !important; }
.fancybox-slide--image::before { display: none !important; }
.fancybox-slide--image .fancybox-content {
    position: fixed !important; left: 0 !important; right: 0 !important;
    top: 44px !important; bottom: 44px !important; width: auto !important; height: auto !important;
    max-width: none !important; max-height: none !important; padding: 0 !important; margin: 0 !important;
    background: transparent !important; overflow: visible !important; transform: none !important;
}
.fancybox-slide--image .fancybox-image {
    position: absolute !important; left: 0 !important; top: 0 !important;
    width: 100% !important; height: 100% !important; max-width: none !important; max-height: none !important;
    object-fit: contain !important; object-position: center center !important;
}
.fancybox-slide--image .fancybox-image-wrap { display: block !important; width: 100% !important; height: 100% !important; }

/* AI 文章摘要卡片 (复刻 summaraidGPT 视觉) */
.ashlord-ai-summary {
    background: linear-gradient(135deg, rgba(72, 50, 255, 0.06), rgba(129, 107, 255, 0.12));
    border: 1px solid rgba(72, 50, 255, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 18px 0 26px;
    position: relative;
}
.dark .ashlord-ai-summary {
    background: linear-gradient(135deg, rgba(43, 72, 255, 0.12), rgba(22, 24, 41, 0.9));
    border-color: rgba(119, 134, 231, 0.25);
}
.ashlord-ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--pix-theme, #3b3eff);
}
.dark .ashlord-ai-summary-header {
    color: #8c9eff;
}
.ashlord-ai-summary-header .ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.ashlord-ai-summary-header .ai-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 99px;
    background: rgba(59, 62, 255, 0.12);
    color: var(--pix-theme, #3b3eff);
}
.dark .ashlord-ai-summary-header .ai-tag {
    background: rgba(119, 134, 231, 0.2);
    color: #c7caff;
}
.ashlord-ai-summary-body {
    font-size: 14px;
    line-height: 1.75;
    color: #44507b;
    background: rgba(255, 255, 255, 0.75);
    padding: 12px 15px;
    border-radius: 8px;
}
.dark .ashlord-ai-summary-body {
    background: rgba(17, 19, 36, 0.65);
    color: #c5cae9;
}

/* 代码块高斯模糊悬停解锁效果 (复刻 ashLord pre:has(code) 特性，鼠标悬浮或点击自动清晰) */
.ashlord-code-blur .single-content pre {
    filter: blur(8px);
    padding: 1rem !important;
    transition: filter 0.3s ease;
    cursor: pointer;
    border-radius: 8px;
    background: #1e2036;
    color: #e5e8ff;
    overflow-x: auto;
}
.ashlord-code-blur .single-content pre:hover,
.ashlord-code-blur .single-content pre.unlocked {
    filter: blur(0) !important;
}
.single-content pre {
    padding: 1rem !important;
    border-radius: 8px;
    background: #f4f5ff;
    overflow-x: auto;
    position: relative;
}
.dark .single-content pre {
    background: #111324;
    color: #e5e8ff;
    border: 1px solid #1e2036;
}

/* 表格横向滚动容器 (复刻 .halo-table-wrapper) */
.halo-table-wrapper,
.single-content .wp-block-table {
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    max-width: 100%;
    margin: 16px 0;
}
.single-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.single-content table td,
.single-content table th {
    padding: 10px 12px;
    border: 1px solid #e6e8f5;
}
.dark .single-content table td,
.dark .single-content table th {
    border-color: #282a40;
}
.single-content table tr:first-child td,
.single-content table th {
    background: rgba(59, 62, 255, 0.05);
    font-weight: 600;
}

/* 友链申请说明框 (#links_apply_box) */
#links_apply_box {
    background: var(--light-bg-color, #f6f7ff);
    border: 1px solid rgba(59, 62, 255, 0.12);
    border-radius: 12px;
    padding: 22px 24px;
    margin: 0 auto 26px;
}
.dark #links_apply_box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    color: #dedede;
}
#links_apply_box h4 { margin: 14px 0 8px; font-size: 16px; font-weight: 600; color: inherit; }
#links_apply_box p { margin: 4px 0; line-height: 1.7; font-size: 14px; }
#links_apply_box code {
    background: rgba(127, 127, 127, 0.16);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    color: inherit;
}
#links_apply_box .apply_title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    color: var(--pix-theme, #3b3eff);
}
.dark #links_apply_box .apply_title {
    color: #8c9eff;
}

/* 全站搜索弹窗美化 (复刻 Halo SearchWidget) */
#ashlord_search_modal .uk-modal-dialog {
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    background: #fff;
}
.dark #ashlord_search_modal .uk-modal-dialog {
    background: #161829;
    color: #dedede;
    border: 1px solid #292c45;
}
.ashlord-search-input-wrap {
    display: flex;
    align-items: center;
    background: #f6f7ff;
    border: 2px solid #e0e3ff;
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 16px;
}
.dark .ashlord-search-input-wrap {
    background: #111324;
    border-color: #292c45;
}
.ashlord-search-input-wrap:focus-within {
    border-color: var(--pix-theme, #3b3eff);
}
.ashlord-search-input-wrap i {
    font-size: 20px;
    color: #9498cd;
    margin-right: 10px;
}
.ashlord-search-input-wrap input {
    border: none;
    background: transparent;
    width: 100%;
    font-size: 15px;
    outline: none;
    color: inherit;
}
.ashlord-search-results {
    max-height: 380px;
    overflow-y: auto;
}
.ashlord-search-hit {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    background: #f6f7ff;
    margin-bottom: 8px;
    transition: all .15s ease;
    text-decoration: none !important;
}
.dark .ashlord-search-hit {
    background: #292c45;
}
.ashlord-search-hit:hover {
    background: var(--pix-theme, #3b3eff);
    color: #fff !important;
}
.ashlord-search-hit h4 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 600;
    color: inherit;
}
.ashlord-search-hit p {
    margin: 0;
    font-size: 12px;
    opacity: 0.8;
    color: inherit;
}

/* 顶部 Toast 消息提示 (coco-msg 风格) */
.ashlord-toast-stage {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}
.ashlord-toast {
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    background: #f3ffe8;
    color: #4ebb23;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px #d9f8bb;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: ashlordToastIn 0.25s ease-out;
}
.ashlord-toast.info {
    background: #e7fdfc;
    color: #0fafad;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px #c0faf9;
}
.ashlord-toast.error {
    background: #fff7f7;
    color: #f34b51;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08), 0 0 0 1px #ffe3e3;
}
@keyframes ashlordToastIn {
    from { opacity: 0; transform: translateY(-16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 底部同步歌词浮动条 */
.ashlord-lrc-bar {
    position: fixed;
    bottom: 76px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 990;
    background: rgba(22, 24, 41, 0.78);
    color: #fff;
    padding: 5px 18px;
    border-radius: 999px;
    font-size: 13px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    transition: opacity 0.3s ease, bottom 0.3s ease;
    white-space: nowrap;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ashlord-lrc-bar.hide {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    display: none !important;
}

/* 唱片旋转动画 */
@keyframes discRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.bg_music.playing i,
.player_mod.playing .m_cover img {
    animation: discRotate 8s linear infinite;
    display: inline-block;
}

/* 悬浮目录树 (listree-box) */
.listree-box {
    position: fixed;
    top: 120px;
    right: max(20px, calc((100vw - 860px) / 2 - 220px));
    width: 200px;
    max-height: 60vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 7px 20px 1px rgba(215, 206, 255, 0.25);
    z-index: 90;
    font-size: 13px;
}
.dark .listree-box {
    background: rgba(22, 24, 41, 0.9);
    border: 1px solid #1e2036;
    box-shadow: none;
    color: #dedede;
}
.listree-box h3.listree-titles {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--pix-theme, #3b3eff);
    display: flex;
    align-items: center;
    gap: 6px;
}
.dark .listree-box h3.listree-titles {
    color: #8c9eff;
}
#listree-ol {
    list-style: none;
    padding: 0;
    margin: 0;
}
#listree-ol li {
    margin-bottom: 6px;
    line-height: 1.4;
}
#listree-ol li.toc-h3 {
    padding-left: 12px;
    font-size: 12px;
}
#listree-ol li a {
    color: #44507b;
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.dark #listree-ol li a {
    color: #a5a9c3;
}
#listree-ol li a:hover,
#listree-ol li a.active {
    color: var(--pix-theme, #3b3eff);
    font-weight: 600;
}
@media screen and (max-width: 1280px) {
    .listree-box {
        display: none !important;
    }
}

/* 右上角用户按钮下拉菜单（集成后台管理与登出） */
.user_menu_box.uk-dropdown {
    min-width: 140px;
    padding: 8px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(59, 62, 255, 0.12);
    border: 1px solid rgba(59, 62, 255, 0.1);
}
.dark .user_menu_box.uk-dropdown {
    background: rgba(34, 36, 48, 0.96);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.user_menu_inner {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.user_menu_inner a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    color: #44507b !important;
    text-decoration: none !important;
    transition: all 0.18s ease;
    white-space: nowrap;
}
.dark .user_menu_inner a {
    color: #d2d6ef !important;
}
.user_menu_inner a i {
    font-size: 15px;
    color: var(--pix-theme, #3b3eff);
}
.dark .user_menu_inner a i {
    color: #8c9eff;
}
.user_menu_inner a:hover {
    background: #eef0ff;
    color: var(--pix-theme, #3b3eff) !important;
}
.dark .user_menu_inner a:hover {
    background: rgba(140, 158, 255, 0.14);
    color: #fff !important;
}

/* 底部固定 BGM 音乐播放器定位与展开/收起动画修复 */
.footer_nav {
    pointer-events: none;
}
.footer_nav .footer_menu,
.footer_nav .footer_nav_box {
    pointer-events: auto;
}
.footer_nav_box {
    top: auto !important;
    bottom: 100% !important;
    left: 0;
    right: 0;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    box-shadow: 0 -4px 20px rgba(59, 62, 255, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    transform: translateY(0);
    opacity: 1;
    z-index: 899 !important;
}
.dark .footer_nav_box {
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.35);
}
.footer_nav_box.player_closed {
    transform: translateY(110%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}
.footer_nav_box.backend_disabled {
    display: none !important;
}
a.bg_music,
a.bg_lrc,
.t_dark a {
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
a.bg_music.disabled,
a.bg_lrc.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* 右下角悬浮工具栏 (.go_top_box / .footer_tool) 与移动端适配（解决移动端按钮被推出屏幕外及层级遮挡无法点击关闭的问题） */
.go_top_box {
    z-index: 950 !important;
    pointer-events: none;
}
.go_top_box .footer_tool,
.go_top_box a.go_top {
    pointer-events: auto;
}
.footer_tool a.bg_music,
.footer_tool a.bg_lrc,
.footer_tool .t_dark a {
    padding: 7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    background: #c4d0e6 !important;
    border-radius: 8px !important;
    width: 30px !important;
    height: 30px !important;
    margin-left: 0 !important;
    box-sizing: border-box !important;
}
.dark .footer_tool a.bg_music,
.dark .footer_tool a.bg_lrc,
.dark .footer_tool .t_dark a {
    background: #292c45 !important;
}
.footer_tool a.bg_music i,
.footer_tool a.bg_lrc i,
.footer_tool .t_dark a i {
    font-size: 16px !important;
    color: var(--icon-color, #5f6387) !important;
}
.dark .footer_tool a.bg_music i,
.dark .footer_tool a.bg_lrc i,
.dark .footer_tool .t_dark a i {
    color: var(--light-color, #dedede) !important;
}
.footer_tool a.bg_music.active,
.footer_tool a.bg_lrc.active {
    background: var(--pix-theme, #3b3eff) !important;
}
.footer_tool a.bg_music.active i,
.footer_tool a.bg_lrc.active i {
    color: #fff !important;
}

/* 移动端底栏 (.footer_menu) 内置音乐与歌词开关按钮样式 */
.footer_menu .inner a.bg_music,
.footer_menu .inner a.bg_lrc {
    background: transparent !important;
    padding: 4px 8px !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    border-radius: 6px !important;
}
.footer_menu .inner a.bg_music i,
.footer_menu .inner a.bg_lrc i {
    font-size: 18px !important;
    color: #181818 !important;
    margin-bottom: 0 !important;
}
.dark .footer_menu .inner a.bg_music i,
.dark .footer_menu .inner a.bg_lrc i {
    color: var(--light-color, #dedede) !important;
}
.footer_menu .inner a.bg_music.active i,
.footer_menu .inner a.bg_lrc.active i {
    color: var(--pix-theme, #3b3eff) !important;
}

@media only screen and (max-width: 780px) {
    .footer_tool {
        right: 12px !important;
        bottom: 118px !important;
        z-index: 955 !important;
    }
    a.go_top {
        right: 12px !important;
    }
}
@media only screen and (max-width: 540px) {
    .ashlord-lrc-bar {
        bottom: 96px;
    }
}
.player_mod .m_tt {
    align-items: baseline;
    gap: 6px;
}
.player_mod .m_info h2 {
    max-width: 180px;
}
.pl_btn a {
    cursor: pointer;
}

/* 修复歌单播放列表被 .footer_nav_box ul 横向排布挤压的问题，并展示歌曲封面图与信息 */
.footer_nav_box .musci_list_box {
    padding: 8px !important;
    height: auto !important;
    max-height: 260px !important;
    overflow-y: auto !important;
    border-radius: 10px !important;
}
.footer_nav_box ul.posts_mu_list {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start !important;
    align-items: stretch !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-height: 240px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 7px 10px !important;
    margin: 2px 0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    gap: 10px !important;
    font-size: 13px !important;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item .mu-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item .mu-item-index {
    font-size: 12px;
    opacity: 0.65;
    min-width: 18px;
    text-align: right;
    flex-shrink: 0;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item .mu-item-cover {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    border-radius: 5px !important;
    object-fit: cover !important;
    flex-shrink: 0;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item .mu-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: inherit !important;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item .mu-item-artist {
    opacity: 0.75;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 32%;
    flex-shrink: 0;
    color: inherit !important;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item:hover,
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item.active {
    background: var(--pix-theme, #3b3eff) !important;
    color: #fff !important;
}
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item:hover *,
.footer_nav_box ul.posts_mu_list li.ashlord-mu-item.active * {
    color: #fff !important;
}
