/*
Theme Name: 复盘博客
Theme URI: https://www.myfupan.com
Author: myfupan
Author URI: https://www.myfupan.com
Description: 个人博客主题（极客深色风，参考 DEVLOG 设计）：终端风格 Hero、青色渐变导航、文章列表、关于卡片；文章页保留左侧目录导航。
Version: 2.0.0
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fupan-blog
Tags: blog, one-column, two-columns, custom-menu, featured-images, threaded-comments, translation-ready, dark
*/

/* ============================================================
   复盘博客主题 v2.0 —— 极客深色风（参考 DEVLOG 设计）
   首页：终端 Hero + 文章列表 + 关于
   文章页：左侧目录 + 中部正文
   ============================================================ */

:root {
    --bg: #0a0f1e;
    --bg-soft: #0d1428;
    --card: rgba(255, 255, 255, .04);
    --card-hover: rgba(255, 255, 255, .07);
    --border: rgba(255, 255, 255, .10);
    --border-strong: rgba(255, 255, 255, .18);
    --text: #e6edf7;
    --text-2: #b8c4d6;
    --muted: #8b98ad;
    --accent: #00d4ff;
    --violet: #8b5cf6;
    --grad: linear-gradient(120deg, #00d4ff, #8b5cf6);
    --radius: 14px;
    --mono: "JetBrains Mono", "SF Mono", Consolas, "Courier New", monospace;
    --shadow: 0 16px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: var(--bg); }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }
img { max-width: 100%; height: auto; }

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* ---------- 背景装饰 ---------- */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image:
        linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
    background-size: 44px 44px;
}
.bg-glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(110px);
    z-index: -1;
    pointer-events: none;
}
.bg-glow--cyan { width: 440px; height: 440px; background: rgba(0, 212, 255, .10); top: -120px; right: -80px; }
.bg-glow--violet { width: 480px; height: 480px; background: rgba(139, 92, 246, .11); bottom: -150px; left: -110px; }

/* ---------- 顶部导航 ---------- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 15, 30, .82);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.nav__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.nav__logo { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap; }
.nav__logo-icon { color: var(--accent); font-size: 20px; }
.nav__logo-text { color: #fff; font-weight: 800; font-size: 19px; letter-spacing: .6px; }
.accent { color: var(--accent); }

.nav__links { display: flex; gap: 6px; }
.nav__links .nav-menu { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.nav__links .nav-menu a {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 14.5px;
    font-weight: 500;
    transition: all .18s ease;
}
.nav__links .nav-menu a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav__links .nav-menu .current-menu-item > a,
.nav__links .nav-menu .current_page_item > a {
    color: var(--accent);
    background: rgba(0, 212, 255, .10);
}
.nav__links .sub-menu { display: none; }

.nav__toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
}
.nav__toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: .2s; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 40px; }
.hero__inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; text-align: center; }

.hero__terminal {
    max-width: 560px;
    margin: 0 auto 44px;
    text-align: left;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.hero__terminal-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .04);
    border-bottom: 1px solid var(--border);
}
.hero__terminal-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.dot--red { background: #ff5f57; }
.dot--yellow { background: #febc2e; }
.dot--green { background: #28c840; }
.hero__terminal-title { margin-left: 10px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.hero__terminal-body {
    padding: 18px 20px;
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.95;
}
.hero__terminal-body p { margin: 0; }
.term-prompt { color: var(--accent); }
.term-cmd { color: #fff; }
.term-out { color: #9adcff; }
.term-cursor { color: var(--accent); animation: term-blink 1.1s step-end infinite; }
@keyframes term-blink { 50% { opacity: 0; } }

.hero__title {
    font-size: 44px;
    line-height: 1.25;
    margin: 0 0 10px;
    font-weight: 800;
    color: #fff;
}
.grad-text {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}
.hero__type {
    font-family: var(--mono);
    font-size: 17px;
    color: var(--accent);
    min-height: 1.7em;
    margin: 0 0 18px;
}
.hero__desc { color: var(--muted); max-width: 560px; margin: 0 auto 26px; }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.hero__socials {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.social-link {
    display: inline-block;
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: all .18s ease;
}
.social-link:hover { color: var(--accent); border-color: rgba(0, 212, 255, .5); box-shadow: 0 0 14px rgba(0, 212, 255, .18); }

/* 按钮 */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 11px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all .2s ease;
}
.btn--primary { background: var(--grad); color: #06101f; box-shadow: 0 6px 22px rgba(0, 212, 255, .22); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0, 212, 255, .34); }
.btn--ghost { border: 1px solid var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent); color: #fff; box-shadow: 0 0 20px rgba(0, 212, 255, .18); transform: translateY(-2px); }

/* ---------- Section ---------- */
.section { padding: 44px 0; }
.section__inner { max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 6px;
}
.section__hash { color: var(--accent); }
.section__sub { color: var(--muted); margin: 0 0 28px; }

/* ---------- 文章列表 ---------- */
.post-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 22px 26px;
    margin-bottom: 16px;
    display: block;
    text-decoration: none;
    transition: all .2s ease;
}
.post-item:hover {
    border-color: rgba(0, 212, 255, .42);
    background: var(--card-hover);
    transform: translateY(-2px);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .4), 0 0 24px rgba(0, 212, 255, .07);
}
.post-item__title { color: #fff; font-size: 19px; font-weight: 700; margin: 0 0 8px; line-height: 1.45; }
.post-item:hover .post-item__title { color: var(--accent); }
.post-item__meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .3px; margin-bottom: 10px; }
.post-item__meta .post-date::before { content: "// "; color: var(--accent); }
.post-item__excerpt { color: var(--text-2); font-size: 14.5px; margin: 0 0 12px; }
.post-item__tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, .30);
    background: rgba(0, 212, 255, .06);
    color: var(--accent);
    font-size: 12px;
    letter-spacing: .3px;
}
.tag--violet { border-color: rgba(139, 92, 246, .32); background: rgba(139, 92, 246, .08); color: #c4b5fd; }
.read-more { display: inline-block; font-size: 13.5px; font-weight: 700; color: var(--accent); text-decoration: none; }
.read-more::after { content: " →"; display: inline-block; transition: transform .2s ease; }
.read-more:hover::after { transform: translateX(5px); }

/* 分页 */
.pagination .nav-links { display: flex; gap: 8px; justify-content: center; margin: 30px 0; }
.pagination .page-numbers {
    display: inline-block;
    min-width: 40px;
    padding: 9px 14px;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-2);
    text-decoration: none;
    transition: all .15s ease;
}
.pagination .page-numbers:hover { border-color: var(--accent); color: #fff; box-shadow: 0 0 16px rgba(0, 212, 255, .2); }
.pagination .page-numbers.current { background: var(--grad); color: #06101f; border-color: transparent; font-weight: 700; }

/* ---------- 关于 ---------- */
.about { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.about__card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 30px 26px;
    text-align: center;
}
.about__avatar {
    width: 84px; height: 84px;
    border-radius: 50%;
    margin: 0 auto 16px;
    background: var(--grad);
    color: #06101f;
    font-size: 34px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 26px rgba(0, 212, 255, .25);
}
.about__name { color: #fff; font-size: 20px; font-weight: 700; margin: 0 0 4px; }
.about__role { color: var(--accent); font-family: var(--mono); font-size: 13px; margin: 0 0 18px; }
.about__stats { display: flex; gap: 16px; justify-content: center; list-style: none; padding: 0; margin: 0 0 20px; }
.about__stats li { display: flex; flex-direction: column; }
.about__stats b { color: #fff; font-size: 22px; font-family: var(--mono); }
.about__stats span { color: var(--muted); font-size: 12px; }
.about__tech { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.about__bio { color: var(--text-2); }
.about__bio p { margin: 0 0 16px; }
.about__quote {
    border-left: 3px solid var(--accent);
    padding: 8px 18px;
    color: var(--muted);
    font-style: italic;
    background: linear-gradient(90deg, rgba(0, 212, 255, .05), transparent);
    border-radius: 0 10px 10px 0;
}
.quote-mark { color: var(--accent); font-style: normal; font-size: 20px; }

/* ---------- 单篇布局（左侧目录 + 正文） ---------- */
.post-layout {
    max-width: 1080px;
    margin: 30px auto;
    padding: 0 24px;
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.sidebar-toc { position: sticky; top: 84px; }
.toc-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}
.toc-title {
    margin: 0 0 14px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent);
    font-family: var(--mono);
    display: flex;
    align-items: center;
    gap: 8px;
}
.toc-title::before {
    content: "#";
    color: var(--accent);
}
.toc-list { list-style: none; margin: 0 0 16px; padding: 0; }
.toc-list li { margin: 2px 0; line-height: 1.5; }
.toc-list a {
    display: block;
    color: var(--text-2);
    text-decoration: none;
    font-size: 13.5px;
    padding: 5px 0 5px 12px;
    border-left: 2px solid transparent;
    transition: all .16s ease;
}
.toc-list a:hover { color: #fff; border-left-color: var(--accent); padding-left: 15px; }
.toc-list .toc-level-2 { font-weight: 600; }
.toc-list .toc-level-3 { padding-left: 20px; font-size: 12.8px; color: var(--muted); }
.toc-list .toc-level-3 a { padding-left: 12px; }
.toc-list li.active > a {
    color: var(--accent);
    border-left-color: var(--accent);
    background: linear-gradient(90deg, rgba(0, 212, 255, .09), transparent);
}
.cat-list, .recent-list { list-style: none; margin: 0 0 16px; padding: 0; }
.cat-list li, .recent-list li { margin: 5px 0; font-size: 13.5px; }
.cat-list a, .recent-list a { color: var(--text-2); text-decoration: none; transition: color .15s ease; }
.cat-list a:hover, .recent-list a:hover { color: var(--accent); }
.cat-list .children { padding-left: 16px; }
.cat-list li a::before { content: "▸ "; color: var(--accent); opacity: .7; }
.recent-list li a::before { content: "· "; color: var(--accent); }

/* ---------- 单篇文章卡片 ---------- */
.single-post {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 34px 40px;
    min-width: 0;
}
.single-post .entry-title {
    font-size: 30px;
    font-weight: 800;
    line-height: 1.35;
    color: #fff;
    margin: 0 0 12px;
}
.single-post .entry-header { border-bottom: 1px solid var(--border); padding-bottom: 18px; margin-bottom: 26px; }
.entry-meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .3px; margin-bottom: 12px; }
.entry-meta .post-date::before { content: "// "; color: var(--accent); }
.entry-meta a { color: var(--muted); text-decoration: none; }
.entry-meta a:hover { color: var(--accent); }
.entry-meta .post-cats a {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 212, 255, .3);
    background: rgba(0, 212, 255, .06);
    color: var(--accent);
    font-size: 11.5px;
}

.entry-content { font-size: 16.5px; line-height: 1.95; color: var(--text-2); }
.entry-content h2 {
    font-size: 24px;
    color: #fff;
    margin: 38px 0 16px;
    padding: 4px 0 4px 14px;
    border-left: 3px solid var(--accent);
}
.entry-content h3 { font-size: 20px; color: #fff; margin: 30px 0 12px; }
.entry-content p { margin: 0 0 18px; }
.entry-content a { text-decoration: underline; text-underline-offset: 3px; }
.entry-content img { border-radius: 10px; box-shadow: 0 8px 30px rgba(0, 0, 0, .45); }
.entry-content blockquote {
    margin: 22px 0;
    padding: 16px 22px;
    border-left: 3px solid var(--violet);
    background: linear-gradient(90deg, rgba(139, 92, 246, .08), transparent);
    color: var(--text-2);
    border-radius: 0 10px 10px 0;
}
.entry-content code {
    background: rgba(0, 212, 255, .10);
    border: 1px solid rgba(0, 212, 255, .16);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--mono);
}
.entry-content pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: #dbe4f3;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    line-height: 1.65;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, .5);
}
.entry-content pre code { background: none; border: none; color: inherit; padding: 0; }
.entry-content table { border-collapse: collapse; width: 100%; margin: 20px 0; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 9px 14px; }
.entry-content th { background: rgba(0, 212, 255, .07); color: #fff; }

.entry-footer { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14px; }
.entry-footer .tags-links a {
    display: inline-block;
    background: rgba(139, 92, 246, .10);
    border: 1px solid rgba(139, 92, 246, .3);
    color: #c4b5fd;
    padding: 3px 12px;
    border-radius: 999px;
    margin-right: 6px;
    text-decoration: none;
    font-size: 12.5px;
}
.post-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: 30px; font-size: 14px; }
.post-nav a { text-decoration: none; color: var(--accent); transition: text-shadow .15s; }
.post-nav a:hover { text-shadow: 0 0 12px rgba(0, 212, 255, .5); }
.post-nav .nav-next { text-align: right; }

/* 评论 */
.comments-area {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-top: 24px;
}
.comments-area .comment-list { list-style: none; padding: 0; }
.comments-area .comment-body { border-bottom: 1px solid var(--border); padding: 14px 0; }
.comments-area .comment-author .fn { color: #fff; font-style: normal; font-weight: 600; }
.comments-area .comment-metadata a { color: var(--muted); font-size: 12.5px; text-decoration: none; }
.comments-area input, .comments-area textarea {
    width: 100%;
    padding: 11px 16px;
    background: rgba(255, 255, 255, .06);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
    font-family: inherit;
    outline: none;
}
.comments-area input:focus, .comments-area textarea:focus { border-color: rgba(0, 212, 255, .5); box-shadow: 0 0 14px rgba(0, 212, 255, .12); }
.comments-area .submit {
    background: var(--grad);
    color: #06101f;
    border: none;
    cursor: pointer;
    width: auto;
    padding: 11px 30px;
    font-weight: 700;
    border-radius: 10px;
    transition: box-shadow .18s, transform .18s;
}
.comments-area .submit:hover { box-shadow: 0 0 24px rgba(0, 212, 255, .3); transform: translateY(-1px); }

/* ---------- 页脚 ---------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    margin-top: 40px;
}
.footer__inner { max-width: 1080px; margin: 0 auto; }
.footer p { margin: 4px 0; }
.footer__slogan { color: var(--accent); font-family: var(--mono); font-size: 13px; letter-spacing: .5px; }
.footer a { color: var(--accent); text-decoration: none; }

/* ---------- 回到顶部 ---------- */
.back-top {
    position: fixed;
    right: 26px;
    bottom: 26px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: rgba(13, 20, 40, .85);
    color: var(--accent);
    font-size: 18px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all .25s ease;
    z-index: 99;
}
.back-top.is-visible { opacity: 1; visibility: visible; }
.back-top:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(0, 212, 255, .25); transform: translateY(-2px); }

/* ---------- 归档/搜索/404 页标题 ---------- */
.page-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 24px;
}
.page-title::before { content: "#"; color: var(--accent); }
.archive-description { color: var(--muted); margin: 0 0 24px; }

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
    .nav__toggle { display: flex; }
    .nav__links {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background: rgba(10, 15, 30, .97);
        border-bottom: 1px solid var(--border);
        padding: 12px 24px 20px;
        display: none;
    }
    .nav__links.is-open { display: flex; }
    .nav__links .nav-menu { flex-direction: column; width: 100%; gap: 4px; }
    .hero__title { font-size: 32px; }
    .about { grid-template-columns: 1fr; }
    .post-layout { grid-template-columns: 1fr; }
    .sidebar-toc { position: static; order: -1; }
    .single-post { padding: 24px 20px; }
}
