/**
 * WeBlog · 微信风格 Typecho 主题 - 基础层
 * 设计变量 / 重置 / 通用组件（PC 与移动端共用）
 * Author: 云奚小屋  Core: OneBlog V3.7.2
 */
:root {
    --wx-green: #07C160;
    --wx-green-dark: #06AD56;
    --wx-link: #576B95;
    --wx-bubble: #95EC69;
    --wx-rail: #2E2E2E;
    --wx-list: #E7E6E4;
    --wx-list-hover: #DEDDDB;
    --wx-list-active: #C9C8C6;
    --wx-content: #F5F5F5;
    --wx-card: #FFFFFF;
    --wx-border: #E3E3E3;
    --wx-text: #191919;
    --wx-text-2: #7F7F7F;
    --wx-text-3: #B2B2B2;
    --wx-bar: #EDEDED;
    --wx-like: #F7F7F7;
    --wx-hover: #ECECEC;
    --wx-tabbar: #F7F7F7;
    --wx-tab-off: #7F7F7F;
    --wx-tab-on: #07C160;
    --wx-radius: 6px;
    --wx-shadow: 0 2px 12px rgba(0, 0, 0, .08);
    --wx-font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

html.night {
    --wx-green: #3EB575;
    --wx-green-dark: #2FA268;
    --wx-link: #7D90BA;
    --wx-bubble: #4E8C63;
    --wx-rail: #1C1C1C;
    --wx-list: #232323;
    --wx-list-hover: #2B2B2B;
    --wx-list-active: #333333;
    --wx-content: #151515;
    --wx-card: #1F1F1F;
    --wx-border: #2E2E2E;
    --wx-text: #E5E5E5;
    --wx-text-2: #9A9A9A;
    --wx-text-3: #6E6E6E;
    --wx-bar: #1C1C1C;
    --wx-like: #262626;
    --wx-hover: #2A2A2A;
    --wx-tabbar: #1C1C1C;
    --wx-tab-off: #7A7A7A;
    --wx-tab-on: #3EB575;
    --wx-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--wx-content);
    color: var(--wx-text);
    font-family: var(--wx-font);
    font-size: 15px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--wx-link);
    text-decoration: none;
}

img {
    max-width: 100%;
    border: 0;
    vertical-align: middle;
}

h1, h2, h3, h4, h5, h6, p, ul, ol, li, figure {
    margin: 0;
    padding: 0;
}

ul, ol {
    list-style: none;
}

input, textarea, button {
    font-family: inherit;
    font-size: inherit;
    outline: none;
}

::selection {
    background: var(--wx-green);
    color: #fff;
}

.m {
    display: none;
}

.pc {
    display: block;
}

/* 等待加载动画 */
#global-loading {
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--wx-content);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity .3s;
}

.progress-loader {
    width: 160px;
    height: 3px;
    border-radius: 7px;
    background: var(--wx-border);
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    overflow: hidden;
}

.progress-loader .progress {
    width: 8%;
    height: 3px;
    border-radius: 7px;
    background: var(--wx-green);
}

/* 懒加载占位 */
.lazy-load {
    background-color: var(--wx-border);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 通用卡片 / 空状态 */
.wx-card {
    background: var(--wx-card);
    border-radius: var(--wx-radius);
    box-shadow: var(--wx-shadow);
}

.wx-empty {
    padding: 60px 20px;
    text-align: center;
    color: var(--wx-text-3);
}

.wx-empty img {
    width: 120px;
    opacity: .7;
    margin-bottom: 12px;
}

/* 加载更多 */
.wx-load {
    text-align: center;
    padding: 18px 0;
    color: var(--wx-text-3);
    font-size: 13px;
}

.wx-load .next {
    display: inline-block;
    padding: 6px 18px;
    border-radius: 14px;
    background: var(--wx-card);
    color: var(--wx-text-2);
    cursor: pointer;
    transition: .2s;
}

.wx-load .next:hover {
    background: var(--wx-green);
    color: #fff;
}

/* 标签胶囊 */
.wx-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.wx-tags a {
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--wx-like);
    color: var(--wx-text-2);
    font-size: 12px;
}

.wx-tags a:hover {
    background: var(--wx-green);
    color: #fff;
}

/* 正文排版 */
.wx-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--wx-text);
    word-break: break-word;
}

.wx-content p {
    margin: 0 0 16px;
}

.wx-content h2,
.wx-content h3,
.wx-content h4 {
    margin: 24px 0 12px;
    font-weight: 600;
}

.wx-content h2 {
    font-size: 20px;
}

.wx-content h3 {
    font-size: 18px;
}

.wx-content blockquote {
    margin: 16px 0;
    padding: 10px 14px;
    border-left: 3px solid var(--wx-green);
    background: var(--wx-like);
    color: var(--wx-text-2);
}

.wx-content pre {
    margin: 16px 0;
    padding: 14px;
    border-radius: var(--wx-radius);
    background: #222;
    overflow-x: auto;
}

.wx-content pre code {
    color: #f8f8f2;
    font-size: 13px;
}

.wx-content code {
    padding: 2px 5px;
    border-radius: 3px;
    background: var(--wx-like);
    font-size: 13px;
}

.wx-content table {
    width: 100%;
    margin: 16px 0;
    border-collapse: collapse;
}

.wx-content table th,
.wx-content table td {
    padding: 8px 10px;
    border: 1px solid var(--wx-border);
}

.wx-content hr {
    margin: 24px 0;
    border: 0;
    border-top: 1px solid var(--wx-border);
}

.wx-content ul,
.wx-content ol {
    padding-left: 22px;
    margin: 0 0 16px;
}

.wx-content ul {
    list-style: disc;
}

.wx-content ol {
    list-style: decimal;
}

/* 返回顶部 */
#gototop {
    position: fixed;
    right: 26px;
    bottom: 30px;
    width: 42px;
    height: 42px;
    line-height: 42px;
    text-align: center;
    border-radius: 50%;
    background: var(--wx-card);
    color: var(--wx-text-2);
    box-shadow: var(--wx-shadow);
    cursor: pointer;
    z-index: 60;
    transition: .25s;
}

#gototop:hover {
    background: var(--wx-green);
    color: #fff;
    transform: translateY(-3px);
}

#gototop.hidden {
    display: none;
}

/* 搜索浮层 */
.wx-search-layer {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .45);
    backdrop-filter: blur(2px);
}

.wx-search-layer.active {
    display: flex;
}

.wx-search-layer .wx-search-box {
    width: min(520px, 88vw);
    background: var(--wx-card);
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, .2);
    padding: 22px 22px 18px;
}

.wx-search-layer form {
    display: flex;
    gap: 8px;
}

.wx-search-layer input {
    flex: 1;
    height: 40px;
    padding: 0 14px;
    border: 1px solid var(--wx-border);
    border-radius: 6px;
    background: var(--wx-content);
    color: var(--wx-text);
}

.wx-search-layer button {
    height: 40px;
    padding: 0 18px;
    border: 0;
    border-radius: 6px;
    background: var(--wx-green);
    color: #fff;
    cursor: pointer;
}

.wx-search-layer .close {
    margin-top: 14px;
    text-align: right;
    font-size: 13px;
    color: var(--wx-text-3);
    cursor: pointer;
}

/* 加载中 */
#loading-spinner {
    text-align: center;
    font-size: 13px;
    color: var(--wx-text-3);
    padding: 10px 0;
}

#loading-spinner .spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-right: 6px;
    border: 2px solid var(--wx-border);
    border-top-color: var(--wx-green);
    border-radius: 50%;
    animation: wxspin .8s linear infinite;
    vertical-align: -2px;
}

@keyframes wxspin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== 认证徽章（仅后台颁发，大小跟随昵称字号） ===== */
.wx-vbadge {
    display: inline-block;
    height: 1em;
    width: 1em;
    margin-left: 3px;
    vertical-align: -.11em;
    object-fit: contain;
    flex: 0 0 auto;
    user-select: none;
}

.who .wx-vbadge,
.m-nick .wx-vbadge,
.moment-detail .md-head b .wx-vbadge {
    height: .96em;
    width: .96em;
}

/* 点赞 / 评论小图标 */
.i-like {
    display: inline-block;
    width: 13px;
    height: 13px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.8C7.1 17.5 2.5 14.4 2.5 9.9 2.5 6.9 4.9 4.5 7.9 4.5c1.6 0 3.1.8 4.1 2 1-1.2 2.5-2 4.1-2 3 0 5.4 2.4 5.4 5.4 0 4.5-4.6 7.6-9.5 10.9z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.8C7.1 17.5 2.5 14.4 2.5 9.9 2.5 6.9 4.9 4.5 7.9 4.5c1.6 0 3.1.8 4.1 2 1-1.2 2.5-2 4.1-2 3 0 5.4 2.4 5.4 5.4 0 4.5-4.6 7.6-9.5 10.9z'/%3E%3C/svg%3E") center/contain no-repeat;
    vertical-align: -1px;
}

/* 夜间模式图标反色由变量自动接管 */
html.night .wx-vbadge {
    filter: brightness(.92);
}

/* ===== 表情（微信小黄脸 / 旧版本地表情） ===== */
.biaoqing {
    display: inline-block;
    width: 1.55em;
    height: 1.55em;
    vertical-align: -.3em;
    margin: 0 1px;
    user-select: none;
}

.biaoqing.wxqf {
    width: 1.6em;
    height: 1.6em;
}

.m-comment .txt .biaoqing,
.bubble .biaoqing {
    width: 1.45em;
    height: 1.45em;
}

/* ===== 表情面板（微信风：网格 + 底部页签） ===== */
.emoji-picker {
    background: var(--wx-card);
    border: 1px solid var(--wx-border);
    border-radius: 10px;
    overflow: hidden;
}

.emoji-picker .emoji-categories {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    background: var(--wx-like);
    border-bottom: 1px solid var(--wx-border);
}

.emoji-picker .emoji-category {
    appearance: none;
    border: 0;
    background: transparent;
    padding: 5px 12px;
    border-radius: 7px;
    font-size: 13px;
    color: var(--wx-text-2);
    cursor: pointer;
    transition: background .18s, color .18s;
}

.emoji-picker .emoji-category:active {
    background: var(--wx-hover);
}

.emoji-picker .emoji-category.active {
    background: var(--wx-card);
    color: var(--wx-green);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.emoji-picker .emoji-container {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    padding: 10px;
    max-height: 218px;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.emoji-picker .emoji-container img {
    width: 32px;
    height: 32px;
    padding: 4px;
    border-radius: 6px;
    cursor: pointer;
    justify-self: center;
    transition: transform .12s ease, background .15s;
}

.emoji-picker .emoji-container img:hover {
    background: var(--wx-hover);
}

.emoji-picker .emoji-container img:active {
    transform: scale(1.28);
}

.emoji-picker .emoji-container .kaomoji,
.emoji-picker .emoji-container .sym {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--wx-text);
    transition: background .15s;
    white-space: nowrap;
}

.emoji-picker .emoji-container .kaomoji:hover,
.emoji-picker .emoji-container .sym:hover {
    background: var(--wx-hover);
}

/* ===== 精修页脚（双端共用） ===== */
.wx-sfoot {
    margin-top: 20px;
    padding: 30px 24px calc(26px + env(safe-area-inset-bottom));
    text-align: center;
    color: var(--wx-text-3);
    font-size: 12px;
    line-height: 1.9;
}

.wx-sfoot .sf-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.wx-sfoot .sf-avatar {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    background-color: var(--wx-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

.wx-sfoot .sf-id {
    text-align: left;
    line-height: 1.5;
}

.wx-sfoot .sf-id b {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--wx-text);
}

.wx-sfoot .sf-id span {
    display: block;
    font-size: 11.5px;
    color: var(--wx-text-3);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wx-sfoot .sf-nav {
    display: flex;
    justify-content: center;
    gap: 22px;
    margin-bottom: 12px;
    font-size: 12.5px;
}

.wx-sfoot .sf-nav a {
    color: var(--wx-text-2);
    position: relative;
    padding-bottom: 2px;
}

.wx-sfoot .sf-nav a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--wx-green);
    transform: translateX(-50%);
    transition: width .25s cubic-bezier(.33, 1, .68, 1);
}

.wx-sfoot .sf-nav a:hover {
    color: var(--wx-green);
}

.wx-sfoot .sf-nav a:hover::after {
    width: 100%;
}

.wx-sfoot .sf-stats {
    display: flex;
    justify-content: center;
    gap: 26px;
    margin-bottom: 12px;
    font-size: 11.5px;
    color: var(--wx-text-3);
}

.wx-sfoot .sf-stats b {
    font-size: 14px;
    font-weight: 600;
    color: var(--wx-text-2);
    margin-right: 3px;
    font-variant-numeric: tabular-nums;
}

.wx-sfoot .sf-copy,
.wx-sfoot .sf-credit {
    margin: 0;
}

.wx-sfoot a {
    color: var(--wx-text-2);
    transition: color .2s;
}

.wx-sfoot a:hover {
    color: var(--wx-green);
}

/* ===== 懒加载淡入 ===== */
.lazy-load {
    position: relative;
}

.lazy-load::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--wx-border);
    opacity: 1;
    border-radius: inherit;
    pointer-events: none;
    transition: opacity .5s cubic-bezier(.33, 1, .68, 1);
}

.lazy-load.loaded::after {
    opacity: 0;
}

/* ===== 滚动渐入（苹果式） ===== */
.wx-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s cubic-bezier(.33, 1, .68, 1), transform .55s cubic-bezier(.33, 1, .68, 1);
    will-change: opacity, transform;
}

.wx-reveal.wx-in {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .wx-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .lazy-load::after {
        display: none;
    }
}

/* ===== 通用按压反馈 ===== */
a, button {
    -webkit-tap-highlight-color: transparent;
}

/* 移动端隐藏 PC 结构 */
.wx-rail {
    display: none;
}

/* 桌面端窄窗口降级：保证 PC 结构在小屏也可读 */
@media (max-width: 899px) {
    .wx-app {
        display: block;
    }

    .wx-side,
    .wx-main {
        width: auto;
        flex: 1 1 auto;
        border-right: 0;
    }

    .wx-list-scroll,
    .wx-main-body {
        overflow: visible;
    }

    .wx-editor {
        position: relative;
    }

    .wx-msg .bubble {
        max-width: 88%;
    }

    .wx-welcome {
        margin-top: 0;
        padding: 22px;
    }
}

/* ===== 介绍页 ===== */
.wx-intro-hero {
    position: relative;
    width: 100%;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(135deg, #07C160, #059B4F);
    margin-bottom: 22px;
    box-shadow: 0 8px 24px rgba(7, 193, 96, .18);
}
.wx-intro-hero img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}
.wx-intro-hero-mask {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 40px 18px 16px;
    background: linear-gradient(to top, rgba(0, 0, 0, .64), rgba(0, 0, 0, 0));
    color: #fff;
}
.wx-intro-hero-mask h1 {
    font-size: 22px;
    margin: 0 0 6px;
    font-weight: 700;
    letter-spacing: .5px;
}
.wx-intro-hero-mask p {
    margin: 0;
    font-size: 13px;
    opacity: .92;
}
.wx-intro-sec {
    margin: 0 0 24px;
}
.wx-intro-sec > h2 {
    font-size: 16px;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--wx-text);
}
.wx-intro-sec > h2::before {
    content: "";
    width: 4px;
    height: 15px;
    border-radius: 3px;
    background: var(--theme-color);
}
.wx-intro-sec > p {
    margin: 0;
    font-size: 14px;
    line-height: 1.85;
    color: var(--wx-text-2);
}
.wx-intro-feats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.wx-intro-feat {
    background: #fff;
    border: 1px solid var(--wx-border);
    border-radius: 12px;
    padding: 14px;
    transition: transform .15s ease, box-shadow .15s ease;
}
.wx-intro-feat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}
.wx-intro-feat .fi-ico {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(7, 193, 96, .12);
    color: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.wx-intro-feat .fi-ico svg {
    width: 20px;
    height: 20px;
}
.wx-intro-feat b {
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
    color: var(--wx-text);
}
.wx-intro-feat span {
    font-size: 12.5px;
    color: var(--wx-text-2);
    line-height: 1.6;
}
.wx-intro-nav {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.wx-intro-nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 1px solid var(--wx-border);
    border-radius: 10px;
    color: var(--wx-text);
    font-size: 13.5px;
    text-decoration: none;
    background: #fff;
}
.wx-intro-nav a:hover {
    border-color: var(--theme-color);
    color: var(--theme-color);
}
.wx-intro-cta {
    background: linear-gradient(135deg, rgba(7, 193, 96, .10), rgba(7, 193, 96, .04));
    border: 1px solid rgba(7, 193, 96, .25);
    border-radius: 12px;
    padding: 16px;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--wx-text-2);
}
@media (max-width: 560px) {
    .wx-intro-feats {
        grid-template-columns: 1fr;
    }
}

/* 暗色模式 */
.night .wx-intro-feat,
.night .wx-intro-nav a {
    background: #1e1e1e;
    border-color: #2e2e2e;
}
.night .wx-intro-cta {
    background: rgba(7, 193, 96, .12);
    border-color: rgba(7, 193, 96, .3);
}
