/* ==========================================================
   PaulRen 主题 - 科技风格（性能优化版）
   --------------------------------------------------------
   性能原则：
   - 不使用 backdrop-filter（滚动时开销极大）
   - 不使用大面积无限循环动画（避免持续重绘）
   - 阴影控制在 1~2 层，模糊半径适中
   - 背景纹理为静态绘制，只绘制一次
   ========================================================== */

/* ---------- 全局变量 ---------- */
:root {
    --tech-bg: #080b12;
    --tech-bg-card: #0e131c;
    --tech-line: rgba(0, 240, 255, 0.16);
    --tech-primary: #00f0ff;
    --tech-secondary: #7b2cbf;
    --tech-accent: #ff006e;
    --tech-text: #e6f4f6;
    --tech-text-soft: #8fa6b8;

    --primary: var(--tech-primary);
    --primary-800: #00c4d4;
    --primary-700: #009aa8;
    --primary-300: #66f7ff;
    --light: var(--tech-bg-card);
    --bg: var(--tech-bg);

    --font-tech: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display",
                 "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", "Consolas", monospace;
}

/* ---------- 全局 ---------- */
html { background-color: var(--tech-bg); }
body {
    background-color: transparent;
    color: var(--tech-text);
    font-family: var(--font-tech);
    -webkit-font-smoothing: antialiased;
}

/* 静态网格背景：只绘制一次，不参与动画 */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.04) 1px, transparent 1px);
    background-size: 64px 64px;
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--tech-bg); }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--tech-primary), var(--tech-secondary));
    border-radius: 4px;
}

/* ---------- 首屏 Banner ---------- */
.index-banner {
    /* 静态渐变，避免 JS 改写 background-position 造成全屏重绘
       背景设为半透明，让漂浮代码符层可见 */
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(0, 240, 255, 0.10), transparent 70%),
        radial-gradient(ellipse 60% 50% at 80% 80%, rgba(123, 44, 191, 0.12), transparent 70%),
        rgba(8, 11, 18, 0.55);
}

/* 两栏布局 */
.index-banner .wrap.min {
    max-width: 1120px;
    width: 100%;
}

.index-banner .card {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    align-items: center;
    gap: 2.5em;
    padding: 2.75em 3em;
    min-height: 420px;
    border-radius: 14px;
    /* 半透明卡片：让背景的漂浮代码符隐约透出 */
    background: rgba(14, 19, 28, 0.72);
    border: 1px solid var(--tech-line);
    box-shadow:
        0 0 24px rgba(0, 240, 255, 0.10),
        0 18px 50px rgba(0, 0, 0, 0.55);
    position: relative;
}

/* 顶部霓虹线由 .card::before 的四角装饰统一处理 */

.index-banner .banner-text {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transform: translateZ(30px);
}

/* 重置原插画绝对定位 */
.index-banner .banner-illust {
    position: relative;
    inset: auto;
    right: auto;
    top: auto;
    bottom: auto;
    max-height: none;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1.5em;
    transform: translateZ(60px);
}

.index-banner .banner-illust img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 340px;
    object-fit: contain;
    display: block;
    /* 单层阴影代替多层滤镜 */
    filter: drop-shadow(0 6px 24px rgba(0, 240, 255, 0.18));
    /* 边缘柔化：径向暗角 + 四边渐隐，彻底融进卡片底色 */
    -webkit-mask-image:
        linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%),
        linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%),
        radial-gradient(ellipse 82% 78% at 50% 50%, #000 62%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%),
        linear-gradient(180deg, transparent 0, #000 8%, #000 92%, transparent 100%),
        radial-gradient(ellipse 82% 78% at 50% 50%, #000 62%, transparent 100%);
    mask-composite: intersect;
}

/* 标题：渐变文字（不使用 text-shadow，透明填充下无效且增加开销） */
.index-banner h1 {
    font-size: clamp(2em, 4vw, 3.1em);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
    margin-bottom: 0.9em;
    max-width: 10em;
    text-wrap: balance;
    overflow-wrap: break-word;
    line-break: loose;
    background: linear-gradient(120deg, var(--tech-primary) 0%, #6f8bff 45%, var(--tech-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.index-banner .banner-secondly {
    color: var(--tech-text-soft);
    font-size: 0.95em;
    letter-spacing: 0.06em;
}

.index-banner .banner-secondly.slogan {
    margin-bottom: 1.4em;
}

/* 光标闪烁：仅作用于 1px 边框，开销极小 */
.index-banner .banner-secondly.slogan::after {
    animation: cursor-blink 1.1s step-end infinite;
}

@keyframes cursor-blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 社交图标 */
.index-banner .banner-social {
    margin-bottom: 1.6em;
}
.index-banner .banner-social a {
    color: var(--tech-text-soft);
    transition: color .2s ease;
}
.index-banner .banner-social a:hover {
    color: var(--tech-primary);
}

/* 按钮 */
.index-banner .btn.lighter {
    background: linear-gradient(135deg, var(--tech-primary), #4d7cff);
    color: #04121a;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    box-shadow: 0 6px 18px rgba(0, 240, 255, 0.22);
    transition: transform .2s ease, box-shadow .2s ease;
}
.index-banner .btn.lighter:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(0, 240, 255, 0.32);
}

/* ---------- 通用卡片（文章 / 分类 / 评论） ---------- */
.index-banner .is-card,
#posts .is-card,
#tags .is-card,
#comments .is-card {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.index-banner .is-card:hover,
#posts .is-card:hover,
#tags .is-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 240, 255, 0.42);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45), 0 0 22px rgba(0, 240, 255, 0.10);
}

/* 区块标题 */
#posts .title h2,
#tags .title h2,
#comments .title h2 {
    color: var(--tech-text);
    letter-spacing: 0.02em;
}
#posts .title h2 i,
#tags .title h2 i,
#comments .title h2 i {
    color: var(--tech-primary);
}
#posts .title p,
#tags .title p,
#comments .title p {
    color: var(--tech-text-soft);
}

/* 文章卡片文字 */
#posts .article-card h3,
#tags .note-card h3 {
    color: var(--tech-text);
}
#posts .article-card p,
#tags .note-card p {
    color: var(--tech-text-soft);
}
/* 卡片底部渐变遮罩改成卡片底色，避免白边 */
#posts .article-card .card-image::after {
    background: linear-gradient(transparent, var(--tech-bg-card));
}

/* 区块标题：隐藏原站的半透明大图标（深色下会糊成色块），改用霓虹竖条 */
.title h2 .ri {
    display: none !important;
}
#posts .title h2,
#tags .title h2,
#comments .title h2 {
    position: relative;
    padding-left: .62em;
    text-shadow: none;
    letter-spacing: .02em;
}
#posts .title h2::before,
#tags .title h2::before,
#comments .title h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: .16em;
    bottom: .16em;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--tech-primary), var(--tech-secondary));
    box-shadow: 0 0 10px rgba(0, 240, 255, .45);
}

/* 分类卡片：年份/篇数配色 */
#tags .note-card time {
    color: var(--tech-primary);
}
#tags .note-card time span {
    color: var(--tech-text-soft);
}
#tags .note-card .card-detail h3 {
    color: var(--tech-text);
}
#tags .note-card:hover .card-detail h3 {
    color: var(--tech-primary);
}

/* ---------- 首页分页（page-navigator） ---------- */
#posts .view-more {
    margin-top: 2.5em;
}
#posts .page-navigator {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: .45em;
    list-style: none;
    padding: 0;
    margin: 0;
}
#posts .page-navigator li {
    list-style: none;
}
#posts .page-navigator li > a,
#posts .page-navigator li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5em;
    height: 2.5em;
    padding: 0 .85em;
    border-radius: 8px;
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    color: var(--tech-text-soft);
    font-size: .9em;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease,
                border-color .2s ease, transform .15s ease;
}
#posts .page-navigator li > a:hover {
    color: var(--tech-primary);
    border-color: rgba(0, 240, 255, .45);
    transform: translateY(-1px);
}
#posts .page-navigator li.current > a {
    background: var(--tech-primary);
    border-color: var(--tech-primary);
    color: #04121a;
    font-weight: 700;
}
#posts .page-navigator li.next > a,
#posts .page-navigator li.prev > a {
    color: var(--tech-primary);
}
#posts .page-navigator li > span {
    color: var(--tech-text-soft);
    opacity: .6;
}

/* ---------- 文章列表页 ---------- */
.page-archive .recent-post-item {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.page-archive .recent-post-item:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 240, 255, 0.42);
    box-shadow: 0 14px 38px rgba(0, 0, 0, 0.45);
}
.page-archive .article-title a { color: var(--tech-text); }
.page-archive .article-title a:hover { color: var(--tech-primary); }
.page-archive .article-meta-wrap { color: var(--tech-text-soft); }
.page-archive .article-meta__categories,
.page-archive .article-meta__tags {
    background: rgba(0, 240, 255, 0.10);
    border: 1px solid rgba(0, 240, 255, 0.22);
    color: var(--tech-primary);
}
.page-archive .article-meta__categories:hover,
.page-archive .article-meta__tags:hover {
    background: var(--tech-primary);
    color: #04121a;
}
.page-archive .content { color: var(--tech-text-soft); }
.page-archive .home-title h1 { color: var(--tech-text); }
.page-archive .home-title > span,
.page-archive .home-title .archive-desc { color: var(--tech-text-soft); }

/* 分页 */
.page-archive .pager-inner > span,
.page-archive .pager-inner > a {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    color: var(--tech-text);
}
.page-archive .pager-inner .current {
    background: var(--tech-primary);
    color: #04121a;
    border-color: var(--tech-primary);
}

/* ==========================================================
   文章详情页
   ========================================================== */
.page-post .post-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 3em 1.6em 2.5em;
}

/* 时效提示 */
.page-post .post-outdated {
    display: flex;
    align-items: flex-start;
    gap: .6em;
    padding: .9em 1.1em;
    margin: 0 0 1.6em;
    background: rgba(255, 0, 110, 0.07);
    border-left: 3px solid var(--tech-accent);
    border-radius: 8px;
    color: #ffb6d4;
    font-size: .9em;
    line-height: 1.65;
}
.page-post .post-outdated i {
    font-size: 1.05em;
    line-height: 1.65;
}

/* 标题 */
.page-post .post-title {
    font-size: clamp(1.7em, 3.4vw, 2.3em);
    font-weight: 700;
    line-height: 1.32;
    letter-spacing: -0.01em;
    margin: 0 0 1.1em;
    background: linear-gradient(120deg, var(--tech-primary) 0%, #6f8bff 50%, var(--tech-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 元信息 */
.page-post .post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.1em;
    padding-bottom: 1.2em;
    margin-bottom: 1.8em;
    border-bottom: 1px solid var(--tech-line);
    font-size: .86em;
    color: var(--tech-text-soft);
}
.page-post .post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: .35em;
}
.page-post .post-meta-item i { opacity: .7; }
.page-post .post-meta-cat {
    color: var(--tech-primary);
    text-decoration: none;
}
.page-post .post-meta-cat:hover { text-decoration: underline; }

/* 封面 */
.page-post .post-cover {
    margin: 1.6em 0;
}
.page-post .post-cover img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

/* 正文排版 */
.page-post .content {
    font-size: 1.02em;
    line-height: 1.9;
    color: #cbdae3;
}
.page-post .content > *:first-child { margin-top: 0; }
.page-post .content p { margin: 0 0 1.2em; }
.page-post .content h1,
.page-post .content h2,
.page-post .content h3,
.page-post .content h4 {
    margin: 2em 0 .75em;
    line-height: 1.4;
    color: var(--tech-text);
    font-weight: 700;
}
.page-post .content h1 { font-size: 1.6em; }
.page-post .content h2 {
    font-size: 1.35em;
    padding-left: .6em;
    border-left: 3px solid var(--tech-primary);
}
.page-post .content h3 { font-size: 1.15em; }

.page-post .content a {
    color: var(--tech-primary);
    border-bottom: 1px solid rgba(0, 240, 255, .35);
    text-decoration: none;
    transition: border-color .2s ease;
}
.page-post .content a:hover { border-bottom-color: var(--tech-primary); }

.page-post .content ul,
.page-post .content ol { margin: 0 0 1.2em; padding-left: 1.5em; list-style: revert; }
.page-post .content li { margin-bottom: .4em; }
.page-post .content li::marker { color: var(--tech-primary); }

.page-post .content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.4em auto;
    border-radius: 10px;
}

.page-post .content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.2em;
    border-left: 3px solid var(--tech-primary);
    border-radius: 0 8px 8px 0;
    background: rgba(0, 240, 255, 0.05);
    color: var(--tech-text-soft);
}
.page-post .content blockquote p:last-child { margin: 0; }

.page-post .content code {
    padding: .15em .4em;
    border-radius: 4px;
    background: rgba(0, 240, 255, 0.10);
    border: 1px solid rgba(0, 240, 255, 0.16);
    color: #7fe9f3;
    font-family: var(--font-mono);
    font-size: .88em;
}
.page-post .content pre {
    margin: 1.4em 0;
    padding: 1.1em 1.3em;
    border-radius: 10px;
    background: #060a10;
    border: 1px solid var(--tech-line);
    color: #cfe8ee;
    overflow-x: auto;
    font-size: .86em;
    line-height: 1.7;
}
.page-post .content pre code {
    padding: 0;
    background: none;
    border: none;
    color: inherit;
}
.page-post .content table {
    width: 100%;
    margin: 1.4em 0;
    border-collapse: collapse;
    font-size: .92em;
}
.page-post .content th,
.page-post .content td {
    padding: .6em .8em;
    border: 1px solid var(--tech-line);
    text-align: left;
}
.page-post .content th {
    background: rgba(0, 240, 255, 0.06);
    color: var(--tech-text);
}
.page-post .content hr {
    margin: 2em 0;
    border: none;
    border-top: 1px solid var(--tech-line);
}

/* 标签 */
.page-post .post-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5em .8em;
    padding: 1.1em 1.3em;
    margin-top: 2.5em;
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 10px;
    font-size: .9em;
}
.page-post .post-tags i { color: var(--tech-primary); }
.page-post .post-tag {
    color: var(--tech-text-soft);
    text-decoration: none;
    padding: .15em .6em;
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.14);
    transition: all .2s ease;
}
.page-post .post-tag:hover {
    background: var(--tech-primary);
    border-color: var(--tech-primary);
    color: #04121a;
}

/* 上一篇 / 下一篇 */
.page-post .post-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1em;
    margin-top: 2.2em;
}
.page-post .post-nav-item {
    padding: 1.1em 1.3em;
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 10px;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.page-post .post-nav-item:hover {
    transform: translateY(-2px);
    border-color: rgba(0, 240, 255, 0.35);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
}
.page-post .post-nav-label {
    display: block;
    font-size: .8em;
    opacity: .62;
    margin-bottom: .35em;
}
.page-post .post-nav a {
    color: var(--tech-primary);
    text-decoration: none;
    font-weight: 600;
    line-height: 1.45;
    display: block;
}
.page-post .post-nav-empty {
    color: var(--tech-text-soft);
    opacity: .45;
    font-size: .92em;
}
.page-post .post-nav-next { text-align: right; }

/* ==========================================================
   评论模块
   ========================================================== */
.comment-section {
    max-width: 720px;
    margin: 3em auto 0;
    padding: 0 1.6em 3em;
}
.comment-section .title { margin-bottom: 1.6em; }

.comment-list {
    display: flex;
    flex-direction: column;
    gap: .9em;
}
.comment-item {
    padding: 1.15em 1.3em;
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 10px;
    transition: border-color .25s ease, transform .25s ease;
}
.comment-item:hover {
    border-color: rgba(0, 240, 255, 0.32);
    transform: translateY(-2px);
}
.comment-head {
    display: flex;
    align-items: center;
    gap: .8em;
    margin-bottom: .75em;
}
.cmt-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.25);
    overflow: hidden;
    display: block;
    background: #0b1018;
}
.cmt-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.comment-who {
    display: flex;
    flex-direction: column;
    gap: .15em;
    flex: 1;
    min-width: 0;
}
.comment-author {
    font-weight: 600;
    color: var(--tech-text);
    text-decoration: none;
    font-size: .95em;
}
.comment-author:hover { color: var(--tech-primary); }
.comment-date { font-size: .78em; opacity: .58; }
.comment-body {
    color: var(--tech-text-soft);
    line-height: 1.75;
    font-size: .94em;
    word-wrap: break-word;
}
.comment-body p { margin: 0 0 .6em; }
.comment-body p:last-child { margin: 0; }

.comment-pager {
    display: flex;
    justify-content: center;
    gap: .4em;
    margin-top: 1.4em;
    font-size: .9em;
}
.comment-empty,
.comment-closed {
    padding: 2.2em 1em;
    text-align: center;
    color: var(--tech-text-soft);
    opacity: .65;
    font-size: .93em;
}

/* 评论表单 */
.comment-form-card {
    padding: 1.7em 1.8em;
    margin-top: 2.2em;
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 12px;
}
.comment-form-card h3 {
    font-size: 1.02em;
    font-weight: 600;
    color: var(--tech-text);
    margin: 0 0 1.3em;
    padding-bottom: .75em;
    border-bottom: 1px solid var(--tech-line);
}
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 1em;
}
.form-field {
    display: flex;
    flex-direction: column;
    gap: .45em;
    margin-bottom: 1em;
}
.form-field label {
    font-size: .82em;
    color: var(--tech-text-soft);
}
.form-field input,
.form-field textarea {
    width: 100%;
    padding: .7em .9em;
    background: #070b12;
    border: 1px solid var(--tech-line);
    border-radius: 8px;
    color: var(--tech-text);
    font-size: .92em;
    font-family: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.form-field textarea { resize: vertical; min-height: 7em; }
.form-field input:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--tech-primary);
    box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.10);
}
.btn.primary {
    padding: .7em 1.6em;
    background: linear-gradient(135deg, var(--tech-primary), #4d7cff);
    color: #04121a;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 240, 255, 0.3);
}

/* 文章页移动端 */
@media screen and (max-width: 900px) {
    .page-post .post-content { padding: 2em 1.2em; }
    .page-post .post-title { font-size: 1.55em; }
    .page-post .post-nav { grid-template-columns: 1fr; }
    .page-post .post-nav-next { text-align: left; }
    .comment-section { padding: 0 1.2em 2.5em; }
    .comment-form-card { padding: 1.3em 1.2em; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
}

/* ==========================================================
   页脚：比正文稍亮一档，形成层次；去掉原站的点阵背景
   ========================================================== */
footer {
    background: linear-gradient(180deg, #131b2b 0%, #0e1522 55%, #0b1019 100%);
    border-top: 1px solid rgba(0, 240, 255, 0.22);
    border-top-right-radius: 0;
    margin-right: 0;
    color: #a9bccb;
    position: relative;
    overflow: hidden;
    padding: 3.5em 0 2em;
}

/* 顶部一条霓虹光带 */
footer::before {
    content: "";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(0, 240, 255, 0.55) 25%,
        rgba(123, 44, 191, 0.55) 55%,
        rgba(255, 0, 110, 0.45) 80%,
        transparent 100%);
    opacity: .9;
    pointer-events: none;
}

/* 极淡的网格，替代原站密集点阵 */
footer::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.045) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: .55;
}
footer > .wrap { position: relative; z-index: 1; }

footer h3 {
    color: #e8f6ff;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: .06em;
    margin: 0 0 1em;
    padding-bottom: .55em;
    border-bottom: 1px solid rgba(0, 240, 255, 0.14);
}

footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    color: #a9bccb;
    line-height: 1.9;
}
footer li {
    margin-bottom: .5em;
    position: relative;
    line-height: 1.7;
    font-size: .93em;
}
footer li:last-child { margin-bottom: 0; }
footer li::before { display: none; content: none; }

footer a {
    color: #a9bccb;
    text-decoration: none;
    transition: color .2s ease;
}
footer a:hover { color: var(--tech-primary); }

/* 社交圆按钮 */
footer .social { margin-top: 1.2em; }
footer .social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.3em;
    height: 2.3em;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.09);
    border: 1px solid rgba(0, 240, 255, 0.18);
    color: var(--tech-primary);
    margin-right: .5em;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}
footer .social a:hover {
    background: var(--tech-primary);
    border-color: var(--tech-primary);
    color: #04121a;
    transform: translateY(-2px);
}

footer .footer-logo {
    width: 88px;
    height: auto;
    max-height: 88px;
    object-fit: contain;
    margin-bottom: .8em;
    opacity: 1;
    filter: brightness(1.45) contrast(1.1);
}

/* 底栏 */
footer .sub-footer {
    margin-top: 2.5em;
    padding-top: 1.4em;
    border-top: 1px solid rgba(0, 240, 255, 0.10);
    color: #8fa3b3;
    font-size: .88em;
}
footer .sub-footer a { color: var(--tech-primary); }
footer .sub-footer .icp {
    color: #8fa3b3;
    margin-left: 1em;
}
footer .sub-footer .icp:hover { color: var(--tech-primary); }
footer .footer-extra { margin-left: 1em; }

/* 回到顶部按钮 */
footer .action { z-index: 5; }
footer .action button {
    background: var(--tech-primary);
    color: #04121a;
    border: none;
    box-shadow: 0 6px 18px rgba(0, 240, 255, 0.28);
}
footer .to-top {
    opacity: 0;
    transform: scale(0);
    transition: opacity .3s ease, transform .3s ease;
}
footer .to-top.active {
    opacity: 1;
    transform: scale(1);
}

/* 页脚移动端 */
@media screen and (max-width: 768px) {
    footer { padding: 2.5em 0 1.5em; }
    footer .row > div { margin-bottom: 1.8em; }
    footer h3 { margin-bottom: .7em; }
    footer .footer-logo { width: 64px; }
}

/* ---------- 搜索面板 ---------- */
.search-overlay {
    background: rgba(4, 8, 14, 0.86);
}
.search-overlay .search-panel {
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
}
.search-overlay .search-panel input { color: var(--tech-text); }
.search-overlay .search-close { color: var(--tech-text) !important; }

/* ---------- 头部（去掉 backdrop-filter，改用纯色半透明） ---------- */
body.is-home header.is-solid {
    background-color: rgba(8, 12, 20, 0.92) !important;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
body:not(.is-home) header {
    background-color: rgba(8, 12, 20, 0.92) !important;
}
body:not(.is-home) header.is-solid {
    background-color: rgba(6, 9, 15, 0.96) !important;
}

/* ---------- 移动端 ---------- */
@media screen and (max-width: 900px) {
    .index-banner .card {
        grid-template-columns: 1fr;
        padding: 2em 1.6em;
        gap: 1.6em;
        text-align: left;
    }
    .index-banner .banner-illust { order: -1; }
    .index-banner .banner-illust img { max-height: 260px; }
    .index-banner h1 { font-size: 2em; }
    .page-post .post-content { padding: 1.3em; }
}

/* ---------- 尊重「减少动态效果」系统偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

/* ==========================================================
   细节打磨 v2
   ========================================================== */

/* ---------- 1. 文章卡片 ---------- */
#posts .article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

/* 封面渐隐改为轻量，避免照片被完全吞掉 */
#posts .article-card .card-image::after {
    background: linear-gradient(
        to bottom,
        transparent 55%,
        rgba(14, 19, 28, 0.55) 82%,
        rgba(14, 19, 28, 0.92) 100%
    );
}

/* 图片悬停轻微放大 */
#posts .article-card .card-image img {
    transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
#posts .article-card:hover .card-image img {
    transform: scale(1.05);
}

/* 无封面占位：科技风渐变 + 首字 */
#posts .article-card .cover-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 3.4em;
    font-weight: 700;
    color: rgba(0, 240, 255, 0.55);
    background:
        radial-gradient(ellipse at 30% 20%, rgba(0, 240, 255, 0.14), transparent 60%),
        radial-gradient(ellipse at 75% 80%, rgba(123, 44, 191, 0.18), transparent 60%),
        #0b1018;
    letter-spacing: .04em;
    text-shadow: 0 0 24px rgba(0, 240, 255, 0.25);
}
#posts .article-card .cover-placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, .06) 1px, transparent 1px);
    background-size: 26px 26px;
    pointer-events: none;
}

/* 卡片文字区 */
#posts .article-card .card-info {
    padding: 1.15em 1.3em 1.35em;
    display: flex;
    flex-direction: column;
    gap: .5em;
    flex: 1;
}
#posts .article-card h3 {
    font-size: 1.05em;
    line-height: 1.45;
    font-weight: 600;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s ease;
}
#posts .article-card:hover h3 { color: var(--tech-primary); }
#posts .article-card p {
    margin: 0;
    font-size: .86em;
    line-height: 1.65;
    color: #93a6b6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 2. 分类卡片：年份 / 篇数 分层 ---------- */
#tags .note-card {
    display: flex;
    align-items: center;
    gap: 1.25em;
    padding: 1.15em 1.4em;
    height: 100%;
}
#tags .note-card time {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 3.4em;
    padding-right: 1.25em;
    border-right: 1px solid rgba(0, 240, 255, 0.14);
    font-size: .72em;
    line-height: 1.4;
    color: #7e93a5;
    letter-spacing: .04em;
}
#tags .note-card time span {
    display: block;
    font-size: 1.9em;
    font-weight: 700;
    line-height: 1.15;
    color: var(--tech-primary);
    letter-spacing: 0;
    white-space: nowrap;
}
#tags .note-card .card-detail {
    min-width: 0;
    flex: 1;
}
#tags .note-card h3 {
    font-size: 1.02em;
    font-weight: 600;
    margin: 0 0 .3em;
    transition: color .2s ease;
}
#tags .note-card p {
    margin: 0;
    font-size: .82em;
    line-height: 1.55;
    color: #8296a8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- 3. 评论卡片 ---------- */
#comments .is-card {
    padding: 1.3em 1.4em !important;
    margin-bottom: 0 !important;
    height: 100%;
    transition: border-color .25s ease, transform .25s ease;
}
#comments .is-card:hover {
    border-color: rgba(0, 240, 255, 0.35);
    transform: translateY(-2px);
}
#comments .is-card img {
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.25);
    flex: 0 0 auto;
}
#comments .is-card a[style] { color: var(--tech-text) !important; }
#comments .is-card p {
    color: #93a6b6 !important;
    opacity: 1 !important;
    font-size: .9em;
    line-height: 1.7;
}

/* ---------- 4. 区块节奏与分隔 ---------- */
main > section {
    padding-top: 4.5em;
    padding-bottom: 4.5em;
}
main > section + section {
    border-top: 1px solid rgba(0, 240, 255, 0.07);
}
#posts .title,
#tags .title,
#comments .title {
    margin-bottom: 2.2em;
}
#posts .title h2,
#tags .title h2,
#comments .title h2 {
    font-size: clamp(1.5em, 2.6vw, 2em);
    font-weight: 700;
}
#posts .title p,
#tags .title p,
#comments .title p {
    font-size: .9em;
    opacity: .75;
}

/* 首屏 HUD 四角见文件末尾「卡片四角装饰」 */

/* 社交图标 */
.index-banner .banner-social {
    display: flex;
    align-items: center;
    gap: .55em;
}
.index-banner .banner-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4em;
    height: 2.4em;
    margin-right: 0 !important;
    border-radius: 50%;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.16);
    color: #9fb6c6;
    font-size: 1em;
    transition: all .22s ease;
}
.index-banner .banner-social a:hover {
    background: var(--tech-primary);
    border-color: var(--tech-primary);
    color: #04121a;
    transform: translateY(-2px);
}

/* 首屏小标签 */
.index-banner .banner-secondly:first-child {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .3em .85em;
    margin-bottom: 1.1em;
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.16);
    color: #8fd8e0;
    font-size: .78em;
    letter-spacing: .12em;
}
.index-banner .banner-secondly:first-child::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--tech-primary);
    box-shadow: 0 0 8px rgba(0, 240, 255, .8);
}

/* ---------- 6. 分页 ---------- */
#posts .view-more {
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid rgba(0, 240, 255, 0.08);
}

/* ---------- 7. 导航悬停指示 ---------- */
.head-menu > a,
.head-menu .has-child > a {
    position: relative;
}
.head-menu > a::after,
.head-menu .has-child > a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: .35em;
    width: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--tech-primary);
    transform: translateX(-50%);
    transition: width .22s ease;
    pointer-events: none;
}
.head-menu > a:hover::after,
.head-menu .has-child > a:hover::after,
.head-menu .has-child:focus-within > a::after {
    width: 40%;
}

/* ---------- 8. 键盘可访问性 ---------- */
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--tech-primary);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- 9. 选中文本 ---------- */
::selection {
    background: rgba(0, 240, 255, 0.28);
    color: #eafcff;
}

/* ---------- 10. 移动端细节 ---------- */
@media screen and (max-width: 900px) {
    main > section {
        padding-top: 3em;
        padding-bottom: 3em;
    }
    #tags .note-card {
        gap: .9em;
        padding: 1em 1.1em;
    }
    #tags .note-card time { padding-right: .9em; }
    #posts .article-card .cover-placeholder { font-size: 2.6em; }
}

/* ==========================================================
   列表页（archive）细节打磨
   ========================================================== */

/* 标题区收敛，减少空白 */
.page-archive .home-title {
    padding: 3.5em 1.5em 1.8em;
    text-align: left;
    max-width: 900px;
}
.page-archive .home-title h1 {
    position: relative;
    padding-left: .62em;
    font-size: clamp(1.6em, 3vw, 2.1em);
    font-weight: 700;
    margin: 0 0 .5em;
}
.page-archive .home-title h1::before {
    content: "";
    position: absolute;
    left: 0;
    top: .18em;
    bottom: .18em;
    width: 4px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--tech-primary), var(--tech-secondary));
    box-shadow: 0 0 10px rgba(0, 240, 255, .45);
}
.page-archive .home-title > span {
    display: inline-block;
    font-size: .95em;
    color: var(--tech-primary);
    opacity: .9;
}
.page-archive .home-title .archive-desc {
    margin: .6em 0 .4em;
    font-size: .9em;
    color: var(--tech-text-soft);
    opacity: .8;
}
.page-archive .home-title .archive-count {
    display: inline-block;
    margin-top: .4em;
    padding: .18em .75em;
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.07);
    border: 1px solid rgba(0, 240, 255, 0.16);
    font-size: .78em;
    color: #8fd8e0;
}

/* 卡片：统一内边距，封面与文字对齐 */
.page-archive .recent-post-item {
    align-items: stretch;
    overflow: hidden;
}
.page-archive .post_cover {
    width: 34%;
    min-height: 0;
    align-self: stretch;
}
.page-archive .post_cover .post-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .45s cubic-bezier(.22, 1, .36, 1);
}
.page-archive .recent-post-item:hover .post_cover .post-bg {
    transform: scale(1.06);
}

/* 无封面卡片：文字区留白收紧 */
.page-archive .recent-post-item.no-cover .recent-post-info {
    padding: 1.5em 1.7em;
}
.page-archive .recent-post-info {
    padding: 1.4em 1.7em;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: .7em;
}
.page-archive .article-title {
    font-size: 1.16em;
    font-weight: 600;
    line-height: 1.45;
    color: var(--tech-text);
    text-decoration: none;
    transition: color .2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.page-archive .recent-post-item:hover .article-title {
    color: var(--tech-primary);
}

/* 元信息行 */
.page-archive .article-meta-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55em .9em;
    font-size: .8em;
    color: #8095a7;
    opacity: 1;
}
.page-archive .article-meta-wrap i {
    font-size: .95em;
    margin-right: .15em;
    opacity: .75;
}
.page-archive .article-meta,
.page-archive .post-meta-date {
    display: inline-flex;
    align-items: center;
    gap: .2em;
}
.page-archive .article-meta-separator {
    display: none;
}
.page-archive .article-meta__categories,
.page-archive .article-meta__tags {
    padding: .12em .55em;
    border-radius: 999px;
    font-size: .98em;
    margin-right: .3em;
    text-decoration: none;
}

/* 摘要 */
.page-archive .content {
    font-size: .9em;
    line-height: 1.72;
    color: #8fa4b6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* 无封面卡片顶部加一条极细霓虹边，避免过于单调 */
.page-archive .recent-post-item.no-cover::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--tech-primary), var(--tech-secondary));
    opacity: .35;
    transition: opacity .25s ease;
}
.page-archive .recent-post-item.no-cover:hover::before {
    opacity: .9;
}
.page-archive .recent-post-item {
    position: relative;
}

/* 列表页底部留白 */
.page-archive .recent-posts {
    padding-bottom: 5em;
}

@media screen and (max-width: 768px) {
    .page-archive .home-title { padding: 2.5em 1.2em 1.4em; }
    .page-archive .post_cover { width: 100%; min-height: 170px; }
    .page-archive .recent-post-info { padding: 1.15em 1.2em; gap: .6em; }
    .page-archive .article-title { font-size: 1.06em; }
    .page-archive .article-meta-wrap { font-size: .76em; gap: .45em .7em; }
}

/* ==========================================================
   移动端深度优化
   ========================================================== */

/* ---------- 首页首屏 ---------- */
@media screen and (max-width: 768px) {
    /* 卡片布局改为垂直堆叠 */
    .index-banner .card {
        grid-template-columns: 1fr !important;
        padding: 1.8em 1.4em;
        gap: 1.6em;
        min-height: auto;
    }

    /* 左侧文字区 */
    .index-banner .banner-text {
        text-align: left;
        align-items: flex-start;
    }

    /* "Hi，我是" 标签 */
    .index-banner .banner-secondly:first-child {
        font-size: .72em;
        padding: .25em .7em;
        letter-spacing: .1em;
    }

    /* 标题 */
    .index-banner h1 {
        font-size: clamp(1.65em, 9vw, 2.1em);
        line-height: 1.28;
        margin-bottom: .75em;
        max-width: 100%;
    }

    /* 副标题 */
    .index-banner .slogan {
        font-size: .92em;
        margin-bottom: 1.1em;
        line-height: 1.55;
    }

    /* 社交图标 */
    .index-banner .banner-social {
        gap: .5em;
        margin-bottom: 1.1em;
    }
    .index-banner .banner-social a {
        width: 2.2em;
        height: 2.2em;
        font-size: .95em;
    }

    /* 按钮 */
    .index-banner .btn.lighter {
        padding: .7em 1.3em;
        font-size: .95em;
    }

    /* 插画区域 */
    .index-banner .banner-illust {
        order: -1;
        max-height: none;
        transform: translateZ(0);
    }
    .index-banner .banner-illust img {
        max-height: 240px;
        max-width: 100%;
        width: auto;
        object-fit: contain;
        filter: drop-shadow(0 4px 16px rgba(0, 240, 255, 0.2));
    }

    /* 向下滚动箭头 */
    .go-down {
        display: none;
    }

    /* 区块间距 */
    main > section {
        padding-top: 2.8em;
        padding-bottom: 2.8em;
    }

    /* 列表页卡片 */
    .page-archive .recent-post-item {
        flex-direction: column;
        gap: 0;
    }
    .page-archive .post_cover {
        width: 100% !important;
        min-height: 170px;
        order: -1;
    }
    .page-archive .recent-post-info {
        order: 1;
    }
    .page-archive .recent-post-info {
        padding: 1.1em 1.2em;
        gap: .6em;
    }
    .page-archive .article-title {
        font-size: 1.05em;
    }
    .page-archive .article-meta-wrap {
        font-size: .76em;
        gap: .4em .6em;
    }
    .page-archive .content {
        font-size: .88em;
    }

    /* 分类卡片 */
    #tags .note-card {
        flex-direction: column;
        align-items: flex-start;
        gap: .8em;
        padding: 1em 1.1em;
    }
    #tags .note-card time {
        flex: 0 0 auto;
        border-right: none;
        padding-right: 0;
        display: flex;
        flex-direction: row;
        gap: .5em;
        align-items: center;
    }
    #tags .note-card time span {
        font-size: 1.5em;
    }
    #tags .note-card p {
        font-size: .8em;
    }

    /* 文章页 */
    .page-post .post-content {
        padding: 1.6em 1.1em;
    }
    .page-post .post-title {
        font-size: 1.5em;
    }
    .page-post .post-meta {
        font-size: .82em;
        gap: .8em;
    }
    .page-post .post-nav {
        grid-template-columns: 1fr;
    }
    .page-post .post-nav-next {
        text-align: left;
        margin-top: .5em;
    }

    /* 评论模块 */
    .comment-section {
        margin-top: 2.2em;
        padding: 0 1.1em 2em;
    }
    .comment-form-card {
        padding: 1.2em 1.1em;
    }
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    /* 页脚 */
    footer {
        padding: 2.2em 0 1.5em;
    }
    footer .row > div {
        margin-bottom: 1.5em;
    }
    footer h3 {
        font-size: .92em;
        margin-bottom: .7em;
    }
    footer ul li {
        font-size: .88em;
    }
    footer .footer-logo {
        width: 64px;
    }
    footer .social a {
        width: 2em;
        height: 2em;
    }

    /* 导航栏 */
    header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 100;
        background-color: transparent !important;
        box-shadow: none;
    }
    body.is-home header.is-solid {
        background-color: rgba(8, 12, 20, .92) !important;
    }
    .head-toggle {
        display: block !important;
    }
    .head-menu {
        position: fixed;
        inset: 64px 0 auto;
        background: var(--tech-bg-card);
        border-bottom: 1px solid var(--tech-line);
        padding: 1em 1.2em;
        transform: translateY(-120%);
        transition: transform .3s ease;
        overflow-y: auto;
        max-height: calc(100vh - 64px);
    }
    .head-menu.active {
        transform: translateY(0);
    }
    .head-menu > a,
    .head-menu .has-child > a {
        display: flex;
        align-items: center;
        gap: .5em;
        padding: .6em .8em;
        font-size: .95em;
    }
    .head-menu .sub-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: transparent;
        border: none;
        padding: .5em 0 0;
        margin-left: 1.8em;
        display: flex;
        flex-direction: column;
        gap: .3em;
    }
    .head-menu .sub-menu a {
        padding: .4em 0;
        font-size: .9em;
        color: var(--tech-text-soft);
    }
    .head-social {
        display: none;
    }
}

/* 小屏手机 */
@media screen and (max-width: 375px) {
    .index-banner .card {
        padding: 1.4em 1em;
    }
    .index-banner h1 {
        font-size: 1.5em;
    }
    .page-archive .article-title {
        font-size: 1em;
    }
}

/* ==========================================================
   404 页面
   ========================================================== */
.page-404 {
    min-height: 70vh;
    display: flex;
    align-items: center;
    padding: 5em 0 6em;
}
.page-404 .wrap { width: 100%; }
.notfound-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 3em 2.4em;
    text-align: center;
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}
.notfound-card::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(0, 240, 255, 0.10), transparent 70%),
        radial-gradient(ellipse 60% 50% at 50% 100%, rgba(123, 44, 191, 0.10), transparent 70%);
}
.notfound-code {
    position: relative;
    margin: 0 0 .2em;
    font-size: clamp(4em, 12vw, 6.5em);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .04em;
    background: linear-gradient(120deg, var(--tech-primary), #6f8bff 50%, var(--tech-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.notfound-title {
    position: relative;
    margin: 0 0 .6em;
    font-size: 1.35em;
    font-weight: 700;
    color: var(--tech-text);
}
.notfound-desc {
    position: relative;
    margin: 0 0 1.8em;
    font-size: .93em;
    line-height: 1.7;
    color: var(--tech-text-soft);
}
.notfound-actions {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: .7em;
    justify-content: center;
}
.btn.ghost {
    display: inline-flex;
    align-items: center;
    padding: .7em 1.5em;
    background: transparent;
    border: 1px solid var(--tech-line);
    border-radius: 8px;
    color: var(--tech-text-soft);
    text-decoration: none;
    font-size: .95em;
    transition: all .2s ease;
}
.btn.ghost:hover {
    border-color: rgba(0, 240, 255, .45);
    color: var(--tech-primary);
}

/* 单页（page.php） */
.page-single .post-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 3.5em 1.6em 3em;
}
.page-single .post-title {
    margin-bottom: 1.4em;
}

@media screen and (max-width: 768px) {
    .notfound-card { padding: 2.2em 1.4em; }
    .page-single .post-content { padding: 2.2em 1.1em; }
}

/* ==========================================================
   正文排版美化（统一标题/列表/引用/表格）
   ========================================================== */

.page-post .content,
.page-archive .content {
    font-size: 1.02em;
    line-height: 1.9;
    color: #cbdae3;
}

/* 段落 */
.page-post p,
.page-archive p {
    margin: 0 0 1.2em;
}

/* 标题 */
.page-post h1,
.page-post h2,
.page-post h3,
.page-post h4,
.page-post h5,
.page-post h6,
.page-archive h1,
.page-archive h2,
.page-archive h3,
.page-archive h4,
.page-archive h5,
.page-archive h6 {
    margin: 2em 0 .75em;
    line-height: 1.4;
    font-weight: 700;
    color: var(--tech-text);
}
.page-post h1,
.page-archive h1 { font-size: 1.6em; }
.page-post h2,
.page-archive h2 { font-size: 1.35em; padding-left: .6em; border-left: 3px solid var(--tech-primary); }
.page-post h3,
.page-archive h3 { font-size: 1.15em; }
.page-post h4,
.page-archive h4 { font-size: 1.05em; }

/* 引用 */
.page-post blockquote,
.page-archive blockquote {
    margin: 1.5em 0;
    padding: 1em 1.2em;
    border-left: 3px solid var(--tech-primary);
    border-radius: 0 8px 8px 0;
    background: rgba(0, 240, 255, 0.05);
    color: var(--tech-text-soft);
}
.page-post blockquote p,
.page-archive blockquote p { margin: 0 0 .6em; }
.page-post blockquote p:last-child,
.page-archive blockquote p:last-child { margin: 0; }

/* 列表 */
.page-post ul,
.page-post ol,
.page-archive ul,
.page-archive ol {
    margin: 0 0 1.2em;
    padding-left: 1.5em;
}
.page-post li,
.page-archive li {
    margin-bottom: .4em;
    position: relative;
}
.page-post li::marker,
.page-archive li::marker {
    color: var(--tech-primary);
}

/* 链接 */
.page-post a,
.page-archive a {
    color: var(--tech-primary);
    border-bottom: 1px solid rgba(0, 240, 255, .35);
    text-decoration: none;
    transition: border-color .2s ease;
}
.page-post a:hover,
.page-archive a:hover {
    border-bottom-color: var(--tech-primary);
}

/* 图片 */
.page-post img,
.page-archive img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.4em auto;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* 分隔线 */
.page-post hr,
.page-archive hr {
    margin: 2em 0;
    border: none;
    border-top: 1px solid var(--tech-line);
}

/* 表格 */
.page-post table,
.page-archive table {
    width: 100%;
    margin: 1.4em 0;
    border-collapse: collapse;
    font-size: .92em;
}
.page-post th,
.page-archive th,
.page-post td,
.page-archive td {
    padding: .6em .8em;
    border: 1px solid var(--tech-line);
    text-align: left;
}
.page-post th,
.page-archive th {
    background: rgba(0, 240, 255, 0.06);
    color: var(--tech-text);
    font-weight: 600;
}
.page-post tr:nth-child(even),
.page-archive tr:nth-child(even) {
    background: rgba(0, 0, 0, 0.15);
}

/* 移动端 */
@media screen and (max-width: 768px) {
    .page-post .content,
    .page-archive .content { font-size: .98em; }
    .page-post h2,
    .page-archive h2 { padding-left: .5em; }
    .page-post blockquote,
    .page-archive blockquote { padding: .9em 1em; }
    .page-post table,
    .page-archive table { font-size: .88em; }
}

/* ---------- 首页「浏览全部博文」按钮 ---------- */
#posts .view-more {
    display: flex;
    justify-content: center;
    margin-top: 3em;
    padding-top: 2em;
    border-top: 1px solid rgba(0, 240, 255, 0.08);
}
#posts .view-more .btn.primary {
    display: inline-flex;
    align-items: center;
    gap: .5em;
    padding: .8em 2em;
    font-size: .95em;
    letter-spacing: .02em;
    text-decoration: none;
    border-radius: 999px;
}
#posts .view-more .btn.primary i {
    font-size: 1.05em;
    transition: transform .25s ease;
}
#posts .view-more .btn.primary:hover i {
    transform: translateX(4px);
}

/* 首页文章卡片：固定三列，内容对齐 */
#posts .row.auto > .col-s-6.col-m-4 {
    display: flex;
}
#posts .article-card {
    width: 100%;
}

/* ==========================================================
   卡片四角 HUD 装饰
   --------------------------------------------------------
   用 4 个真实 <span> 元素定位到卡片四角，
   避免伪元素落在子容器（如 .banner-text）上导致错位。
   ========================================================== */
.index-banner .card {
    position: relative;
}

.index-banner .card .hud-corner {
    position: absolute;
    width: 26px;
    height: 26px;
    pointer-events: none;
    z-index: 3;
    opacity: .95;
    /* 默认朝左上：横线 + 竖线 */
    background:
        linear-gradient(var(--tech-primary), var(--tech-primary)) left top / 100% 2px no-repeat,
        linear-gradient(var(--tech-primary), var(--tech-primary)) left top / 2px 100% no-repeat;
}

/* 四个角位置 */
.index-banner .card .hud-corner.tl { top: 0;    left: 0; }
.index-banner .card .hud-corner.tr { top: 0;    right: 0; transform: scaleX(-1); }
.index-banner .card .hud-corner.bl { bottom: 0; left: 0;  transform: scaleY(-1); }
.index-banner .card .hud-corner.br { bottom: 0; right: 0; transform: scale(-1, -1); }

/* 让角标贴合圆角，稍微内缩 1px */
.index-banner .card .hud-corner.tl { top: 1px; left: 1px; }
.index-banner .card .hud-corner.tr { top: 1px; right: 1px; }
.index-banner .card .hud-corner.bl { bottom: 1px; left: 1px; }
.index-banner .card .hud-corner.br { bottom: 1px; right: 1px; }

/* 小屏收窄 */
@media screen and (max-width: 900px) {
    .index-banner .card .hud-corner {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================================
   漂浮代码符画布层
   --------------------------------------------------------
   全屏固定，不影响点击，层级在背景之上、正文之下
   ========================================================== */
#code-float-layer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    display: block;
}

/* ---------- 首屏卡片内的漂浮代码符画布 ---------- */
.index-banner .card .card-code-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
    /* 裁切到卡片圆角内 */
    overflow: hidden;
}

/* 卡片内容浮在画布之上 */
.index-banner .card .banner-text,
.index-banner .card .banner-illust {
    position: relative;
    z-index: 1;
}

/* HUD 四角保持在最上层 */
.index-banner .card .hud-corner {
    z-index: 3;
}

/* ==========================================================
   性能优化 - 预加载关键资源 + 字体优化
   ========================================================== */

/* 关键 CSS 预加载（减少 LCP） */
@font-face {
    font-family: 'Bahnschrift';
    src: url('../assets/fonts/Bahnschrift.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 系统字体回退 */
:root {
    --font-tech: "Bahnschrift", "DIN Alternate", "Segoe UI Variable Display", 
                 "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-mono: "Cascadia Code", "JetBrains Mono", "Consolas", monospace;
}

/* 图片懒加载优化 - 占位符淡入 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
img[loading="lazy"].loaded {
    opacity: 1;
}

/* 避免布局偏移 (CLS) - 预留空间 */
article .card-image,
.post_cover {
    aspect-ratio: 4/3;
    min-height: 180px;
}

/* 关键资源预连接 */
<link rel="preconnect" href="https://cravatar.cn" crossorigin>
<link rel="dns-prefetch" href="https://cravatar.cn">

/* ==========================================================
   首页评论区样式（语义化类名）
   ========================================================== */
#comments .comment-item {
    padding: 1.5em;
    margin-bottom: 1em;
    background: var(--tech-bg-card);
    border: 1px solid var(--tech-line);
    border-radius: 10px;
    transition: border-color .25s ease, transform .25s ease;
}
#comments .comment-item:hover {
    border-color: rgba(0, 240, 255, 0.35);
    transform: translateY(-2px);
}
#comments .comment-head {
    display: flex;
    align-items: center;
    gap: .75em;
    margin-bottom: .75em;
}
#comments .cmt-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(0, 240, 255, 0.25);
    flex: 0 0 auto;
}
#comments .comment-info {
    display: flex;
    flex-direction: column;
    gap: .2em;
    flex: 1;
    min-width: 0;
}
#comments .cmt-author {
    font-weight: 600;
    color: var(--tech-text);
    text-decoration: none;
    font-size: .95em;
}
#comments .cmt-author:hover {
    color: var(--tech-primary);
}
#comments .cmt-date {
    font-size: .8em;
    opacity: .6;
}
#comments .cmt-text {
    margin: 0;
    opacity: .75;
    color: var(--tech-text-soft);
    line-height: 1.7;
    font-size: .9em;
}

/* ==========================================================
   旧文章兼容性优化 - 覆盖内联样式
   ========================================================== */

/* 正文内容区域 */
.page-post .content,
.page-archive .content {
    /* 强制亮色字体，覆盖内联黑色 */
    color: #e6f8f8 !important;
}

/* 段落 */
.page-post p,
.page-archive p {
    color: #d4e8e8 !important;
    font-size: 1.05em !important;
    line-height: 1.8 !important;
    margin: 0 0 1.3em !important;
}

/* 标题 */
.page-post h1,
.page-post h2,
.page-post h3,
.page-post h4,
.page-post h5,
.page-post h6,
.page-archive h1,
.page-archive h2,
.page-archive h3,
.page-archive h4,
.page-archive h5,
.page-archive h6 {
    color: #ffffff !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    margin: 2em 0 .8em !important;
}

/* 链接 */
.page-post a,
.page-archive a {
    color: var(--tech-primary) !important;
    text-decoration: none !important;
    border-bottom: 1px solid rgba(0, 240, 255, 0.35) !important;
    transition: all .2s ease !important;
}
.page-post a:hover,
.page-archive a:hover {
    color: var(--tech-secondary) !important;
    border-bottom-color: var(--tech-secondary) !important;
}

/* 列表 */
.page-post ul li,
.page-post ol li,
.page-archive ul li,
.page-archive ol li {
    color: #d4e8e8 !important;
    font-size: 1.02em !important;
    line-height: 1.7 !important;
    margin-bottom: .5em !important;
}

/* 引用块 */
.page-post blockquote,
.page-archive blockquote {
    background: rgba(0, 240, 255, 0.08) !important;
    border-left: 4px solid var(--tech-primary) !important;
    color: #cfe8ee !important;
    padding: 1.2em 1.4em !important;
    margin: 1.6em 0 !important;
}

/* 代码块 */
.page-post pre code,
.page-archive pre code {
    background: #0a0e14 !important;
    color: #7fe9f3 !important;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
    padding: .2em .4em !important;
    font-size: .9em !important;
}

/* 表格 */
.page-post table,
.page-archive table {
    border-collapse: collapse !important;
    width: 100% !important;
    margin: 1.5em 0 !important;
}
.page-post th,
.page-archive th {
    background: rgba(0, 240, 255, 0.1) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    padding: .8em 1em !important;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
}
.page-post td,
.page-archive td {
    background: rgba(0, 240, 255, 0.03) !important;
    color: #d4e8e8 !important;
    padding: .7em 1em !important;
    border: 1px solid rgba(0, 240, 255, 0.15) !important;
}

/* 图片 */
.page-post img,
.page-archive img {
    border-radius: 10px !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
    margin: 1.5em auto !important;
    display: block !important;
}

/* 强调文字 */
.page-post strong,
.page-archive strong,
.page-post b,
.page-archive b {
    color: #7fe9f3 !important;
    font-weight: 700 !important;
}

/* 删除线 */
.page-post del,
.page-archive del {
    color: #8fa6b2 !important;
    text-decoration: line-through !important;
}

/* 下划线 */
.page-post u,
.page-archive u {
    color: var(--tech-accent) !important;
    text-decoration: underline !important;
}

/* 斜体 */
.page-post em,
.page-archive em,
.page-post i,
.page-archive i {
    color: #a78bfa !important;
    font-style: italic !important;
}

/* 清除 Word 残留样式 */
.page-post *[style*="color:#000"],
.page-archive *[style*="color:#000"] {
    color: #d4e8e8 !important;
}
.page-post *[style*="color:black"],
.page-archive *[style*="color:black"] {
    color: #d4e8e8 !important;
}
.page-post *[style*="font-size:large"],
.page-archive *[style*="font-size:large"] {
    font-size: 1.2em !important;
}
.page-post *[style*="font-size:small"],
.page-archive *[style*="font-size:small"] {
    font-size: .9em !important;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .page-post p,
    .page-archive p {
        font-size: 1em !important;
        line-height: 1.7 !important;
    }
    .page-post h1,
    .page-archive h1 {
        font-size: 1.5em !important;
    }
    .page-post h2,
    .page-archive h2 {
        font-size: 1.3em !important;
    }
}
