/* =========================================================
   Nebula —— 现代化炫酷 Typecho 主题
   深色为默认，html.light 切换为浅色
   ========================================================= */

/* ---------- 变量 ---------- */
:root {
    --accent: #22d3ee;            /* 强调色，由 data-scheme 覆盖 */
    --accent-2: #a855f7;
    --accent-3: #f472b6;
    --accent-text: #0e7490;       /* 浅色模式下渐变标题的实色，保证可读 */

    --bg: #07070f;
    --bg-soft: #0d0d1a;
    --surface: rgba(255, 255, 255, 0.045);
    --surface-strong: rgba(255, 255, 255, 0.08);
    --border: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text: #e9e9f5;
    --text-soft: #b6b8cf;
    --text-mute: #7d8098;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
    --glow: 0 0 22px rgba(34, 211, 238, 0.35);
    --radius: 18px;
    --maxw: 1180px;
    --header-h: 66px;
}

html.light {
    --bg: #eef1f8;
    --bg-soft: #e4e9f4;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-strong: rgba(255, 255, 255, 0.9);
    --border: rgba(20, 30, 70, 0.12);
    --border-strong: rgba(20, 30, 70, 0.22);
    --text: #1a1c2e;
    --text-soft: #41445e;
    --text-mute: #767a93;
    --shadow: 0 18px 45px rgba(40, 50, 90, 0.18);
    --glow: 0 0 20px rgba(34, 211, 238, 0.28);
}

/* ---------- 配色方案（前台可切换，data-scheme 控制） ---------- */
:root[data-scheme="aurora"]  { --accent:#22d3ee; --accent-2:#818cf8; --accent-3:#f0abfc; --accent-text:#0e7490; --glow:0 0 22px color-mix(in srgb, var(--accent) 42%, transparent); }
:root[data-scheme="purple"]  { --accent:#a855f7; --accent-2:#6366f1; --accent-3:#ec4899; --accent-text:#7e22ce; --glow:0 0 22px color-mix(in srgb, var(--accent) 42%, transparent); }
:root[data-scheme="peach"]   { --accent:#fb7185; --accent-2:#f59e0b; --accent-3:#f472b6; --accent-text:#be123c; --glow:0 0 22px color-mix(in srgb, var(--accent) 42%, transparent); }
:root[data-scheme="emerald"] { --accent:#34d399; --accent-2:#10b981; --accent-3:#a3e635; --accent-text:#047857; --glow:0 0 22px color-mix(in srgb, var(--accent) 42%, transparent); }
:root[data-scheme="lava"]    { --accent:#f97316; --accent-2:#ef4444; --accent-3:#fbbf24; --accent-text:#c2410c; --glow:0 0 22px color-mix(in srgb, var(--accent) 42%, transparent); }
:root[data-scheme="ocean"]   { --accent:#38bdf8; --accent-2:#2563eb; --accent-3:#818cf8; --accent-text:#0369a1; --glow:0 0 22px color-mix(in srgb, var(--accent) 42%, transparent); }

/* 浅色模式下渐变标题改用实色，避免浅色强调色在亮底上看不清 */
html.light .brand-name,
html.light .hero h1,
html.light .post-header h1 {
    -webkit-text-fill-color: var(--accent-text);
    background: none;
    animation: none;
}

/* 配色方案切换时的整页平滑过渡：仅在切换瞬间加类，不影响正常加载与 hover 动效 */
html.scheme-transition,
html.scheme-transition * {
    transition: background-color .55s ease, color .55s ease, border-color .55s ease,
                box-shadow .55s ease, fill .55s ease, stroke .55s ease !important;
}
/* 尊重系统的“减少动态效果”偏好 */
@media (prefers-reduced-motion: reduce) {
    html.scheme-transition,
    html.scheme-transition * { transition-duration: .001ms !important; }
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; overflow-x: hidden; overflow-x: clip; }

body {
    margin: 0;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.75;
    font-size: 16px;
    overflow-x: hidden;
    overflow-x: clip;   /* 移动端彻底消除横向溢出，避免浏览器撑宽布局视口（顶栏不到边、悬浮按钮跑到屏幕外） */
    -webkit-font-smoothing: antialiased;
    transition: background .5s ease, color .4s ease;
}

a { color: var(--accent); text-decoration: none; transition: color .25s; }
a:hover { color: var(--accent-2); }

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

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

::selection { background: var(--accent); color: #06080f; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--accent), var(--accent-2));
    border-radius: 10px; border: 2px solid transparent; background-clip: padding-box;
}

/* ---------- 动态极光背景 ---------- */
.nebula-bg { position: fixed; inset: 0; z-index: -3; overflow: hidden; pointer-events: none; }
.nebula-bg .aurora {
    position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55;
    mix-blend-mode: screen; animation: drift 22s ease-in-out infinite;
}
html.light .nebula-bg .aurora { opacity: .35; mix-blend-mode: multiply; }
.aurora.a1 { width: 46vw; height: 46vw; left: -8vw; top: -10vw;
    background: radial-gradient(circle, var(--accent), transparent 70%); animation-delay: 0s; }
.aurora.a2 { width: 40vw; height: 40vw; right: -6vw; top: 8vw;
    background: radial-gradient(circle, var(--accent-2), transparent 70%); animation-delay: -6s; }
.aurora.a3 { width: 42vw; height: 42vw; left: 18vw; bottom: -14vw;
    background: radial-gradient(circle, var(--accent-3), transparent 70%); animation-delay: -12s; }
.aurora.a4 { width: 30vw; height: 30vw; right: 10vw; bottom: -8vw;
    background: radial-gradient(circle, var(--accent), transparent 70%); animation-delay: -3s; }
@keyframes drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(6vw, 4vw) scale(1.15); }
    66% { transform: translate(-5vw, -3vw) scale(.9); }
}

#nebula-particles { position: fixed; inset: 0; z-index: -2; pointer-events: none; }

/* ---------- 鼠标光晕 ---------- */
.cursor-glow {
    position: fixed; width: 360px; height: 360px; border-radius: 50%;
    left: 0; top: 0; pointer-events: none; z-index: -1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 65%);
    transition: opacity .3s; opacity: 0; mix-blend-mode: screen;
}
@media (hover: hover) and (pointer: fine) { .cursor-glow { opacity: 1; } }
/* 触屏设备不渲染鼠标光晕，避免固定定位的大圆块参与绘制 */
@media (hover: none) { .cursor-glow { display: none; } }

/* ---------- 阅读进度条 ---------- */
.progress-bar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 100;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent-3));
    box-shadow: 0 0 12px var(--accent); transition: width .1s linear;
}

/* ---------- 顶部导航 ---------- */
.site-header {
    position: sticky; top: 0; z-index: 90;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    background: color-mix(in srgb, var(--bg) 55%, transparent);
    border-bottom: 1px solid transparent;
    transition: background .35s, border-color .35s, box-shadow .35s;
}
.site-header.scrolled {
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    border-bottom-color: var(--border);
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.nav-wrap { display: flex; align-items: center; gap: 18px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.brand-logo { height: 34px; width: auto; border-radius: 9px; }
.brand-name {
    font-size: 1.32rem; letter-spacing: .5px; font-weight: 800; color: var(--text);
    background: linear-gradient(120deg, var(--accent), var(--accent-2) 55%, var(--accent-3));
    background-size: 220% auto;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: shine 6s linear infinite;
}

.site-nav { display: flex; gap: 4px; margin-left: 14px; flex: 1; }
.site-nav a {
    position: relative; color: var(--text-soft); font-weight: 600; padding: 8px 14px;
    border-radius: 10px; transition: color .25s, background .25s;
}
.site-nav a::after {
    content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px; transform: scaleX(0); transform-origin: left; transition: transform .3s;
}
.site-nav a:hover, .site-nav a.active { color: var(--text); background: var(--surface); }
.site-nav a.active::after, .site-nav a:hover::after { transform: scaleX(1); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--border); background: var(--surface); color: var(--text);
    border-radius: 12px; transition: transform .25s, border-color .25s, box-shadow .25s;
}
.icon-btn:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--glow); }
.icon-sun { display: none; }
html.light .icon-moon { display: none; }
html.light .icon-sun { display: block; }

/* ---------- 配色方案切换浮层 ---------- */
.scheme-switcher { position: relative; }
.scheme-pop {
    position: absolute; top: calc(100% + 12px); right: 0; z-index: 120;
    width: 236px; padding: 14px; border-radius: 16px;
    background: color-mix(in srgb, var(--bg) 88%, var(--accent) 8%);
    border: 1px solid var(--border-strong);
    box-shadow: 0 24px 60px rgba(0,0,0,.55), var(--glow);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .25s, visibility .25s;
}
.scheme-pop.open { opacity: 1; visibility: visible; transform: none; }
.scheme-pop-title { margin: 0 0 10px; font-size: .8rem; color: var(--text-mute); font-weight: 600; }
.scheme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.scheme-swatch {
    display: flex; flex-direction: column; align-items: center; gap: 7px;
    padding: 8px 4px; border-radius: 12px; cursor: pointer; font-size: .72rem;
    background: var(--surface); border: 1px solid var(--border); color: var(--text-soft);
    transition: transform .2s, border-color .2s, color .2s, box-shadow .2s;
}
.scheme-swatch .sw {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, var(--s1), var(--s2) 55%, var(--s3));
    box-shadow: 0 4px 12px color-mix(in srgb, var(--s1) 45%, transparent);
}
.scheme-swatch:hover { transform: translateY(-2px); border-color: var(--border-strong); color: var(--text); }
.scheme-swatch.active {
    border-color: var(--accent); color: var(--text);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent);
}
@media (max-width: 480px) {
    .scheme-pop { width: 200px; }
    .scheme-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 全局搜索浮层 ---------- */
.search-overlay {
    position: fixed; inset: 0; z-index: 200; opacity: 0; visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}
.search-overlay.open { opacity: 1; visibility: visible; }
.search-backdrop {
    position: absolute; inset: 0;
    background: color-mix(in srgb, var(--bg) 72%, transparent);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.search-panel {
    position: relative; max-width: 640px; margin: 13vh auto 0; padding: 0 20px;
    transform: translateY(-14px) scale(.98); transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.search-overlay.open .search-panel { transform: none; }
.search-form {
    display: flex; align-items: center; gap: 12px; background: var(--surface-strong);
    border: 1px solid var(--border-strong); border-radius: 18px; padding: 14px 18px;
    box-shadow: var(--shadow); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    transition: border-color .25s, box-shadow .25s;
}
.search-form:focus-within { border-color: var(--accent); box-shadow: var(--glow); }
.sf-icon { width: 22px; height: 22px; color: var(--accent); flex: none; }
#searchInput {
    flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
    font-size: 1.2rem; outline: none; font-family: inherit;
}
#searchInput::placeholder { color: var(--text-mute); }
.sf-close {
    border: 0; background: var(--surface); color: var(--text-soft); width: 36px; height: 36px;
    border-radius: 10px; cursor: pointer; display: grid; place-items: center; flex: none; transition: .25s;
}
.sf-close:hover { color: var(--accent); transform: rotate(90deg); }
.search-hint { text-align: center; color: var(--text-mute); font-size: .85rem; margin: 16px 0 0; }

/* ---------- 搜索/空结果状态 ---------- */
.empty-state { text-align: center; padding: 70px 20px; color: var(--text-soft); }
.empty-state .empty-emoji { font-size: 3rem; margin-bottom: 12px; filter: drop-shadow(0 0 14px var(--glow)); }
.empty-state p { font-size: 1.05rem; margin: 0; }

.menu-toggle { display: none; flex-direction: column; gap: 5px; width: 40px; height: 40px; justify-content: center; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.menu-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: .3s; }

/* ---------- 主体布局 ---------- */
.site-main { padding: 38px 22px 60px; max-width: var(--layout-w, var(--maxw)); }

/* ---------- 内容宽度调节（桌面端，控制中间栏宽度） ---------- */
.width-ctl { display: none; }
@media (min-width: 1200px) {
    .width-ctl {
        display: inline-flex; align-items: center; gap: 14px; margin: 0 0 26px;
        max-width: 100%; padding: 9px 18px; border: 1px solid var(--border); border-radius: 999px;
        background: var(--surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 8px 22px rgba(0,0,0,.16); color: var(--text-soft); font-size: .82rem;
    }
    .width-ctl .wc-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--text); white-space: nowrap; }
    .width-ctl .wc-label svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
    /* 三挡预设：默认 / 宽 / 布满 */
    .width-ctl .wc-presets {
        display: inline-flex; align-items: center; gap: 2px; flex: none; padding: 3px;
        border-radius: 999px; background: color-mix(in srgb, var(--border) 60%, transparent);
    }
    .width-ctl .wc-btn {
        border: 0; background: transparent; color: var(--text-soft); font: inherit; font-size: .76rem; font-weight: 700;
        padding: 4px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: .22s;
    }
    .width-ctl .wc-btn:hover { color: var(--text); }
    .width-ctl .wc-btn.active {
        color: #06080f; background: linear-gradient(120deg, var(--accent), var(--accent-2));
        box-shadow: 0 2px 10px var(--glow);
    }
    .width-ctl input[type="range"] {
        width: 360px; max-width: 34vw; min-width: 180px; flex: none; height: 4px; margin: 0;
        -webkit-appearance: none; appearance: none; border-radius: 999px; outline: none; cursor: pointer;
        background: linear-gradient(90deg, var(--accent), var(--accent-2));
    }
    .width-ctl input[type="range"]::-webkit-slider-thumb {
        -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
        background: #fff; border: 2px solid var(--accent); box-shadow: 0 0 8px var(--accent); cursor: pointer;
    }
    .width-ctl input[type="range"]::-moz-range-thumb {
        width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: pointer;
    }
    .width-ctl .wc-val { min-width: 56px; text-align: right; color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
}
/* 移动优先：单列，正文优先于侧栏 */
.layout { display: flex; flex-direction: column; gap: 26px; align-items: stretch; }
.content { order: 1; min-width: 0; }
.sidebar { width: 100%; }
.sidebar-left { order: 2; }
.sidebar-right { order: 3; }
/* 桌面端：左 - 中 - 右 三栏，左栏悬浮跟随阅读 */
@media (min-width: 1024px) {
    .layout {
        display: grid; grid-template-columns: 230px minmax(0, 1fr) 290px;
        gap: 30px; align-items: start;
    }
    .sidebar { width: auto; }
    .sidebar-left { order: 1; position: sticky; top: calc(var(--header-h) + 18px); }
    .content { order: 2; }
    .sidebar-right { order: 3; }
}

/* 手机端首页：个人介绍栏移到「站点标题」与「文章列表」之间（仅首页生效，文章页保持原顺序） */
@media (max-width: 1023px) {
    .nebula-home .layout { gap: 0; }
    /* display:contents 让标题 / 文章 / 分页直接参与上下栏排序 */
    .nebula-home .content { display: contents; }
    .nebula-home .sidebar-left { display: contents; }

    .nebula-home .hero { order: 1; }
    .nebula-home .profile-card { order: 2; }
    .nebula-home .post-card { order: 3; }
    .nebula-home .page-nav { order: 4; margin-bottom: 26px; }
    .nebula-home .sidebar-left .widget { order: 5; }
    .nebula-home .sidebar { order: 6; margin-top: 22px; }

    /* 内容区块自身留有 margin，上面已把 gap 归零，这里补齐最后一个间距 */
    .nebula-home .hero { margin-bottom: 24px; }
    .nebula-home .profile-card { margin-bottom: 22px; }
}

/* ---------- 站点头图/欢迎 ---------- */
.hero {
    position: relative; overflow: hidden; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 46px 40px; margin-bottom: 32px;
    background: linear-gradient(135deg, var(--surface-strong), var(--surface));
    box-shadow: var(--shadow);
}
.hero::before {
    content: ""; position: absolute; width: 340px; height: 340px; right: -70px; top: -90px;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 32%, transparent), transparent 70%);
    filter: blur(18px); pointer-events: none;
}
.hero h1 {
    margin: 0 0 10px; font-size: 2.1rem; line-height: 1.2; font-weight: 800; position: relative;
    background: linear-gradient(120deg, var(--accent), var(--accent-2) 60%, var(--accent-3));
    background-size: 220% auto;
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
    animation: shine 7s linear infinite;
}
@keyframes shine { to { background-position: 220% center; } }
.hero p { margin: 0; color: var(--text-soft); font-size: 1.05rem; }

/* ---------- 文章卡片 ---------- */
.post-card {
    position: relative; border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); padding: 26px 28px; margin-bottom: 22px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s, box-shadow .35s;
    overflow: hidden;
}
.post-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: linear-gradient(135deg, var(--accent), transparent 40%, transparent 60%, var(--accent-3));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude; opacity: 0; transition: opacity .35s;
    pointer-events: none;
}
.post-card:hover {
    transform: translateY(-6px); border-color: transparent;
    box-shadow: 0 22px 50px rgba(0,0,0,.4), var(--glow);
}
.post-card:hover::before { opacity: 1; }

.post-card .pc-meta {
    display: flex; flex-wrap: wrap; gap: 14px; align-items: center;
    font-size: .82rem; color: var(--text-mute); margin-bottom: 12px;
}
.post-card .pc-meta span { display: inline-flex; align-items: center; gap: 5px; }
.post-card .pc-meta a { color: var(--text-soft); }
.post-card .pc-meta a:hover { color: var(--accent); }
.post-card h2 { margin: 0 0 10px; font-size: 1.5rem; line-height: 1.35; font-weight: 800; }
.post-card h2 a { color: var(--text); background-image: linear-gradient(var(--accent), var(--accent)); background-size: 0% 2px; background-repeat: no-repeat; background-position: 0 100%; transition: background-size .35s, color .25s; }
.post-card:hover h2 a { background-size: 100% 2px; }
.post-card .pc-excerpt { color: var(--text-soft); margin: 0 0 16px; }
.post-card .pc-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.read-more {
    display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .9rem;
    padding: 8px 16px; border-radius: 999px; color: var(--text);
    border: 1px solid var(--border-strong); transition: .3s;
}
.read-more:hover { color: #06080f; background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: var(--glow); }

/* 缩略图卡片（如有） */
.post-card.has-thumb { display: grid; grid-template-columns: 200px 1fr; gap: 0; padding: 0; }
.post-card.has-thumb .pc-thumb { position: relative; min-height: 170px; overflow: hidden; display: block; border-top-left-radius: var(--radius); border-bottom-left-radius: var(--radius); }
.post-card.has-thumb .pc-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.post-card.has-thumb:hover .pc-thumb img { transform: scale(1.08); }
.post-card.has-thumb .pc-body { padding: 24px 26px; }

/* ---------- 文章正文排版 ---------- */
.post-header { margin-bottom: 26px; }
.post-header h1 {
    margin: 0 0 14px; font-size: 2.2rem; line-height: 1.25; font-weight: 800;
    background: linear-gradient(120deg, var(--text), var(--accent));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}
.post-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; color: var(--text-mute); font-size: .88rem; margin-top: 16px; }
.pm-item { display: inline-flex; align-items: center; gap: 6px; }
.pm-item svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.pm-item a { color: var(--text-soft); transition: color .25s; }
.pm-item a:hover { color: var(--accent); }
.pm-author { gap: 9px; }
.pm-author a { color: var(--text); font-weight: 700; }
.pm-author a:hover { color: var(--accent); }

/* 统一头像：QQ 头像 / 主题配色一致的渐变头像 */
.avatar {
    --av-size: 40px; --rot: 135deg;
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: var(--av-size); height: var(--av-size); border-radius: 50%;
    overflow: hidden; flex: none; vertical-align: middle; color: #fff; font-weight: 800;
    background: linear-gradient(var(--rot), var(--accent), var(--accent-2));
    border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
    box-shadow: 0 3px 12px color-mix(in srgb, var(--accent) 38%, transparent);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.avatar .avatar-initial { width: 56%; height: 56%; color: #fff; opacity: .92; }

/* 页面徽章 */
.page-card .page-badge {
    display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: 1px;
    color: var(--accent); border: 1px solid var(--border-strong); border-radius: 999px;
    padding: 3px 13px; margin-bottom: 14px; background: var(--surface);
}

.post-content { font-size: 1.06rem; }
.post-content p { margin: 1.1em 0; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
    margin: 1.6em 0 .7em; font-weight: 800; line-height: 1.35; position: relative; padding-left: 14px;
    scroll-margin-top: calc(var(--header-h) + 18px);
}
.post-content h2::before, .post-content h3::before {
    content: ""; position: absolute; left: 0; top: .12em; bottom: .12em; width: 4px; border-radius: 4px;
    background: linear-gradient(var(--accent), var(--accent-2));
}
.post-content img { border-radius: 14px; margin: 1.2em auto; box-shadow: var(--shadow); }
.post-content a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); }
.post-content a:hover { border-bottom-color: transparent; }
.post-content blockquote {
    margin: 1.3em 0; padding: 14px 20px; border-left: 4px solid var(--accent);
    background: var(--surface); border-radius: 0 12px 12px 0; color: var(--text-soft);
}
.post-content code {
    background: var(--surface-strong); padding: 2px 7px; border-radius: 6px;
    font-family: "JetBrains Mono", Menlo, Consolas, monospace; font-size: .9em; color: var(--accent-2);
}
.post-content pre {
    background: #06070f; border: 1px solid var(--border); padding: 18px; border-radius: 14px;
    overflow: auto; box-shadow: var(--shadow); position: relative;
}
.post-content pre code { background: transparent; color: #d7e0ff; padding: 0; }
.post-content pre code.hljs { background: transparent !important; color: #d7e0ff; }
.post-content table { width: 100%; border-collapse: collapse; margin: 1.2em 0; border-radius: 12px; overflow: hidden; }
.post-content th, .post-content td { border: 1px solid var(--border); padding: 10px 14px; }
.post-content th { background: var(--surface-strong); }
.post-content hr { border: 0; height: 1px; background: var(--border); margin: 2em 0; }

/* ---------- 标签 / 上下篇 ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.tags a {
    font-size: .82rem; padding: 5px 12px; border-radius: 999px; color: var(--text-soft);
    border: 1px solid var(--border); background: var(--surface); transition: .25s;
}
.tags a:hover { color: #06080f; background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; }

.post-near { display: flex; justify-content: space-between; gap: 16px; margin: 30px 0; flex-wrap: wrap; }
.post-near a {
    flex: 1; min-width: 200px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 14px;
    background: var(--surface); color: var(--text-soft); transition: .3s;
}
.post-near a:hover { transform: translateY(-3px); border-color: var(--accent); color: var(--text); box-shadow: var(--glow); }
.post-near .label { display: block; font-size: .78rem; color: var(--text-mute); margin-bottom: 4px; }
.post-near .title { font-weight: 700; color: var(--text); }

/* ---------- 侧栏 ---------- */
.widget {
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
    padding: 22px 24px; margin-bottom: 22px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    transition: transform .3s, border-color .3s, box-shadow .3s;
}
.widget:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.widget-title {
    margin: 0 0 16px; font-size: 1.05rem; font-weight: 800; position: relative; padding-left: 12px;
}
.widget-title::before { content: ""; position: absolute; left: 0; top: 2px; bottom: 2px; width: 4px; border-radius: 4px; background: linear-gradient(var(--accent), var(--accent-2)); }
.widget-list { list-style: none; margin: 0; padding: 0; }
.widget-list li { padding: 9px 0; border-bottom: 1px dashed var(--border); }
.widget-list li:last-child { border-bottom: 0; }
.widget-list a { color: var(--text-soft); }
.widget-list a:hover { color: var(--accent); }
.widget .cat-item a { color: var(--text-soft); }
.widget .cat-item a:hover { color: var(--accent); }

/* ---------- 左侧栏：个人简介栏 ---------- */
.profile-card {
    position: relative; overflow: hidden; text-align: center;
    border: 1px solid var(--border); border-radius: var(--radius);
    background: linear-gradient(160deg, var(--surface-strong), var(--surface));
    padding: 28px 22px; margin-bottom: 22px;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
.profile-card::before {
    content: ""; position: absolute; left: 50%; top: -46px; transform: translateX(-50%);
    width: 170px; height: 170px; border-radius: 50%; pointer-events: none;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%);
    filter: blur(16px);
}
.profile-avatar { position: relative; display: flex; justify-content: center; margin-bottom: 14px; }
.profile-avatar > img, .profile-avatar > .avatar {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
}
.profile-avatar > .avatar { border-width: 3px; font-size: 2rem; }
.profile-name { margin: 4px 0 6px; font-size: 1.15rem; font-weight: 800; }
.profile-bio { margin: 0; color: var(--text-soft); font-size: .9rem; line-height: 1.7; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 16px; }
.profile-links a {
    font-size: .8rem; padding: 6px 13px; border-radius: 999px; color: var(--text-soft);
    border: 1px solid var(--border); background: var(--surface); transition: .25s;
}
.profile-links a:hover { color: #06080f; background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-color: transparent; box-shadow: var(--glow); }

/* 左栏 widget 间距统一 */
.sidebar-left .widget { margin-bottom: 22px; }
.sidebar-left .widget:last-child { margin-bottom: 0; }

/* ---------- 评论 ---------- */
.comments-wrap { margin-top: 40px; }
.comments-wrap h3 { font-size: 1.3rem; font-weight: 800; margin: 0 0 18px; }
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment-list .comment-body {
    border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
    padding: 18px 20px; margin-bottom: 16px; transition: border-color .3s;
}
.comment-list .comment-body:hover { border-color: var(--border-strong); }
.comment-list .comment-children { margin-left: 26px; margin-top: 14px; }
.comment-author { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.comment-author .avatar { width: 40px; height: 40px; box-shadow: var(--glow); }
.comment-author-meta { display: flex; flex-direction: column; line-height: 1.45; }
.comment-author .fn { font-weight: 700; color: var(--text); font-style: normal; }
.op-tag { display: inline-block; font-size: .68rem; font-weight: 700; color: #06080f; background: linear-gradient(120deg, var(--accent), var(--accent-2)); border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.comment-meta { color: var(--text-mute); font-size: .8rem; }
.comment-content { color: var(--text-soft); }
.comment-reply a { font-size: .82rem; color: var(--accent); }
.comment-reply a:hover { color: var(--accent-2); }

.respond { margin-top: 26px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 24px; }
.respond h3 { margin: 0 0 16px; font-weight: 800; }
.respond label { display: block; font-size: .85rem; color: var(--text-soft); margin: 12px 0 6px; }
.respond .required { color: var(--accent-3); }
.respond input[type=text], .respond input[type=email], .respond input[type=url], .respond textarea {
    width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg-soft); color: var(--text); outline: none; font-family: inherit; transition: border-color .25s, box-shadow .25s;
}
.respond input:focus, .respond textarea:focus { border-color: var(--accent); box-shadow: var(--glow); }
.respond textarea { resize: vertical; min-height: 120px; }
.respond .submit, .comment-form .submit {
    margin-top: 16px; cursor: pointer; border: 0; color: #06080f; font-weight: 800;
    padding: 11px 26px; border-radius: 999px; background: linear-gradient(120deg, var(--accent), var(--accent-2));
    transition: transform .25s, box-shadow .25s;
}
.respond .submit:hover { transform: translateY(-2px); box-shadow: var(--glow); }

/* ---------- 分页 ---------- */
/* Typecho 输出的每项是 li，当前页为 li.current，状态样式必须落在内层 a/span 上，否则 li 无圆角会显示成方角 */
.page-nav {
    display: flex; justify-content: center; align-items: center; gap: 10px;
    margin: 34px 0 10px; flex-wrap: wrap; list-style: none; padding: 0;
}
.page-nav li { display: flex; margin: 0; padding: 0; }
.page-nav a, .page-nav li > span {
    min-width: 42px; height: 42px; display: grid; place-items: center; padding: 0 14px;
    border: 1px solid var(--border); border-radius: 12px; background: var(--surface);
    color: var(--text-soft); transition: .25s; box-sizing: border-box;
}
.page-nav a:hover,
.page-nav .current > a,
.page-nav .current > span {
    color: #06080f; background: linear-gradient(120deg, var(--accent), var(--accent-2));
    border-color: transparent; box-shadow: var(--glow);
}

/* ---------- 404 ---------- */
.not-found { text-align: center; padding: 80px 20px; }
.not-found .code {
    font-size: 7rem; font-weight: 900; line-height: 1; margin: 0;
    background: linear-gradient(120deg, var(--accent), var(--accent-2), var(--accent-3));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.not-found p { color: var(--text-soft); font-size: 1.1rem; margin: 10px 0 26px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 30px; padding: 40px 22px 30px; background: color-mix(in srgb, var(--bg-soft) 60%, transparent); }
.footer-inner { display: flex; justify-content: space-between; gap: 26px; flex-wrap: wrap; align-items: flex-start; }
.footer-brand .brand-name { font-size: 1.3rem; }
.footer-desc { color: var(--text-mute); margin: 8px 0 0; max-width: 360px; }
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-links a { color: var(--text-soft); }
.footer-links a:hover { color: var(--accent); }
.footer-copy { text-align: center; color: var(--text-mute); font-size: .85rem; margin-top: 26px; }
.footer-copy .dot { margin: 0 8px; opacity: .5; }
.footer-copy a { color: var(--text-soft); }
.footer-copy .icp-link { color: var(--text-mute); font-variant-numeric: tabular-nums; }
.footer-copy .icp-link:hover { color: var(--accent); }

/* ---------- 回到顶部 ---------- */
.to-top {
    position: fixed; z-index: 120;
    right: 26px; bottom: 26px;
    right: max(26px, env(safe-area-inset-right)); bottom: max(26px, env(safe-area-inset-bottom));
    width: 46px; height: 46px;
    display: grid; place-items: center; cursor: pointer; color: #06080f; border: 0;
    border-radius: 50%; background: linear-gradient(120deg, var(--accent), var(--accent-2));
    box-shadow: var(--glow); opacity: 0; transform: translateY(20px) scale(.8); pointer-events: none;
    transition: opacity .35s, transform .35s;
}
.to-top.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.to-top:hover { transform: translateY(-4px) scale(1.05); }

/* ---------- 滚动渐显（仅在 JS 启用时隐藏，避免无脚本时内容不可见） ---------- */
.js .reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 文章目录 TOC ---------- */
.toc { display: none; } /* 默认隐藏，由 JS 生成后显示 */
.toc {
    border: 1px solid var(--border); border-radius: var(--radius);
    background: var(--surface); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    padding: 12px 16px; margin: 0 0 22px; box-shadow: var(--shadow);
}
.toc-title {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    background: none; border: 0; cursor: pointer; padding: 2px 0; color: var(--text);
    font-size: 1rem; font-weight: 800; font-family: inherit;
}
.toc-label { display: inline-flex; align-items: center; gap: 8px; }
.toc-label svg { width: 18px; height: 18px; color: var(--accent); }
.toc-chevron { width: 18px; height: 18px; color: var(--text-soft); transition: transform .3s; }
.toc.collapsed .toc-chevron { transform: rotate(-90deg); }
.toc-body { overflow: hidden; }
.toc.collapsed .toc-body { display: none; }
.toc-list { list-style: none; margin: 12px 0 0; padding: 0; }
.toc-list a {
    display: block; padding: 6px 12px; border-left: 2px solid var(--border);
    color: var(--text-soft); font-size: .92rem; line-height: 1.5; border-radius: 0 8px 8px 0;
    transition: color .25s, border-color .25s, background .25s;
}
.toc-list a:hover { color: var(--text); border-left-color: var(--accent); background: var(--surface-strong); }
.toc-list a.toc-sub { padding-left: 28px; font-size: .88rem; color: var(--text-mute); }
.toc-list a.active {
    color: var(--accent); font-weight: 700; border-left-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
}
/* 桌面端：目录悬浮跟随阅读 */
@media (min-width: 1080px) {
    .toc {
        position: sticky; top: calc(var(--header-h) + 18px);
        max-height: calc(100vh - var(--header-h) - 38px); overflow: auto;
    }
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .post-card.has-thumb { grid-template-columns: 1fr; }
    .post-card.has-thumb .pc-thumb { min-height: 180px; border-radius: 0; border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
}
@media (max-width: 720px) {
    .menu-toggle { display: flex; }
    .site-nav {
        position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column; gap: 0;
        background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(16px);
        border-bottom: 1px solid var(--border); padding: 10px 16px; transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .3s;
    }
    .site-nav.open { transform: none; opacity: 1; pointer-events: auto; }
    .site-nav a { padding: 12px 8px; border-radius: 10px; }
    .site-nav a::after { display: none; }
    .site-main { padding: 24px 16px 50px; }
    .post-card { padding: 20px 18px; }
    .post-card.has-thumb .pc-body { padding: 18px 18px; }
    .hero { padding: 30px 22px; }
    .hero h1 { font-size: 1.5rem; }
    .post-header h1 { font-size: 1.55rem; }
    .post-content { font-size: 1rem; }
    .footer-inner { flex-direction: column; gap: 16px; }
    .search-panel { margin-top: 16vh; }
}

/* 常规手机屏幕（≤480px）进一步微调 */
@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .site-main { padding: 20px 12px 44px; }
    .nav-wrap { gap: 10px; }
    .brand-name { font-size: 1.15rem; }
    .brand-logo { height: 30px; }
    .post-card { padding: 18px 15px; margin-bottom: 18px; border-radius: 14px; }
    .post-card.has-thumb .pc-body { padding: 16px 15px; }
    .post-header h1 { font-size: 1.4rem; }
    .post-meta { gap: 7px 14px; font-size: .82rem; }
    .post-near { flex-direction: column; }
    .post-near a { min-width: 0; }
    .tags a { font-size: .78rem; padding: 4px 10px; }
    .widget { padding: 18px 16px; }
    .respond { padding: 18px 16px; }
    .comment-list .comment-children { margin-left: 14px; }
    .to-top {
        right: 16px; bottom: 16px;
        right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom));
        width: 44px; height: 44px;
    }
    .not-found .code { font-size: 5rem; }
    .footer-copy { font-size: .78rem; }
}

/* 超小屏（≤360px）极致压缩 */
@media (max-width: 360px) {
    .post-meta { gap: 6px 10px; }
    .pm-read, .pm-comment { font-size: .8rem; }
}

/* 尊重减弱动效偏好 */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
    .reveal { opacity: 1; transform: none; }
}
