/* ========== 全局重置与变量 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
:root {
    --bg-body: #ffffff;
    --bg-surface: #ffffff;
    --text-primary: #0b1c2e;
    --text-secondary: #4a627a;
    --border-light: #e2e8f0;
    --accent: #2c6ef8;
    --accent-hover: #1a5ad9;
    --footer-text: #6c86a3;
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    --card-hover-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
    --capsule-bg: rgba(255, 255, 255, 0.92);
    --capsule-border: #dce3ec;
    --capsule-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
    --btn-hover-bg: #2c6ef8;
    --btn-hover-color: white;
    --card-hover-bg: #f7faff;
    --tag-bg: #f0f2f5;
    --tag-hover-bg: #2c6ef8;
    --tag-hover-color: white;
    --focus-outline: #2c6ef8;
    --quote-blue-bg: rgba(44, 110, 248, 0.08);
    --quote-green-bg: rgba(16, 185, 129, 0.08);
    --quote-orange-bg: rgba(245, 158, 11, 0.08);
    --quote-purple-bg: rgba(139, 92, 246, 0.08);
    --quote-gray-bg: rgba(107, 114, 128, 0.08);
}
body.dark {
    --bg-body: #0a0f1a;
    --bg-surface: #131c2c;
    --text-primary: #eef2ff;
    --text-secondary: #9aadc8;
    --border-light: #25324b;
    --accent: #5a8eff;
    --accent-hover: #7a9eff;
    --footer-text: #7e92b0;
    --card-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    --card-hover-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    --capsule-bg: rgba(19, 28, 44, 0.88);
    --capsule-border: #2a3650;
    --capsule-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
    --btn-hover-bg: #3b6eff;
    --btn-hover-color: white;
    --card-hover-bg: #202a3e;
    --tag-bg: #1f2a40;
    --tag-hover-bg: #3b6eff;
    --tag-hover-color: #ffffff;
    --focus-outline: #5a8eff;
    --quote-blue-bg: rgba(59, 130, 246, 0.2);
    --quote-green-bg: rgba(16, 185, 129, 0.2);
    --quote-orange-bg: rgba(245, 158, 11, 0.2);
    --quote-purple-bg: rgba(139, 92, 246, 0.2);
    --quote-gray-bg: rgba(107, 114, 128, 0.2);
}
body {
    background: var(--bg-body);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, 'Segoe UI', 'Roboto', sans-serif;
    transition: background 0.25s, color 0.25s;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent);
    color: white;
    padding: 8px 12px;
    text-decoration: none;
    z-index: 10000;
    font-weight: bold;
    border-radius: 0 0 8px 0;
}
.skip-link:focus {
    top: 0;
    outline: 2px solid white;
}
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 2px solid var(--focus-outline);
    outline-offset: 2px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(0);
    border: 0;
}
.site-header {
    text-align: center;
    padding: 56px 0 32px;
}
.site-logo h1 { margin: 0; line-height: 0; }
.site-logo img { height: 56px; width: auto; max-width: 100%; }
.search-form {
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}
.search-box {
    width: 100%;
    padding: 14px 100px 14px 20px;
    font-size: 0.95rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-light);
    border-radius: 44px;
    color: var(--text-primary);
    box-shadow: var(--card-shadow);
}
.search-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(44,110,248,0.15);
}
.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--tag-bg);
    border: none;
    padding: 6px 16px;
    border-radius: 40px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-secondary);
}
.search-btn:hover { background: var(--accent); color: white; }
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    counter-reset: post-counter;
}
.post-card {
    background: var(--bg-surface);
    padding: 18px 16px;
    text-decoration: none;
    display: block;
    counter-increment: post-counter;
    transition: all 0.2s;
}
.post-card:hover {
    background: var(--card-hover-bg);
    box-shadow: var(--card-hover-shadow);
}
.post-title {
    font-weight: 540;
    font-size: 0.95rem;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}
.post-title::before {
    content: counter(post-counter) ". ";
    font-weight: 540;
    margin-right: 4px;
}
@media (max-width: 900px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
    .post-card { padding: 16px 18px; }
    .post-title { font-size: 0.98rem; }
}
@media (max-width: 768px) {
    .posts-grid { grid-template-columns: 1fr; }
    .post-card { padding: 14px 16px; }
}
.tags-section { margin: 32px 0 60px; }
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.tags-cloud a {
    background: var(--tag-bg);
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
.tags-cloud a:hover {
    background: var(--tag-hover-bg);
    color: var(--tag-hover-color);
    transform: translateY(-1px);
}
.featured-section { margin: 28px 0 24px; }
.featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}
.featured-item {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--bg-surface);
    box-shadow: var(--card-shadow);
    transition: transform 0.2s, box-shadow 0.2s;
}
.featured-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-hover-shadow);
}
.featured-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    color: white;
    font-size: 0.7rem;
    padding: 4px 12px;
    border-radius: 40px;
    font-weight: 500;
    pointer-events: none;
}
.featured-img {
    display: block;
    width: 100%;
    height: auto;
}
.archive-section {
    margin: 48px 0 40px;
}
.archive-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.archive-main {
    flex: 2;
    min-width: 0;
}
.archive-sidebar {
    flex: 1;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}
.archive-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.article-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.list-item {
    background: var(--bg-surface);
    padding: 20px;
    transition: background 0.2s;
}
.list-item:hover {
    background: var(--card-hover-bg);
}
.list-title {
    font-size: 1.2rem;
    font-weight: 540;
    margin-bottom: 10px;
}
.list-title a {
    color: var(--text-primary);
    text-decoration: none;
}
.list-title a:hover {
    color: var(--accent);
}
.list-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.list-meta {
    font-size: 0.8rem;
    color: var(--footer-text);
}
.epages {
    text-align: center;
    color: var(--text-secondary);
    width: 100%;
    clear: both;
    padding-top: 20px;
    margin-top: 20px;
}
.epages a {
    color: var(--text-secondary);
    margin: 0 5px 10px;
    padding: 5px 10px;
    background: var(--tag-bg);
    display: inline-block;
    text-decoration: none;
    border-radius: 30px;
    transition: all 0.2s;
}
.epages a:first-child {
    background: none;
    margin: 0;
    padding: 0 50px 0 0;
    position: relative;
}
.epages a:first-child:after {
    position: absolute;
    content: "篇文章";
    right: 0;
    bottom: 0;
    color: var(--text-secondary);
}
.epages a:first-child:hover {
    background: none;
    color: var(--text-secondary);
}
.epages a:hover,
.epages > b {
    color: #FFF;
    background: var(--accent);
}
.epages > b {
    padding: 5px 10px;
    border-radius: 30px;
    display: inline-block;
    margin: 0 5px;
    font-weight: normal;
}
.hot-posts {
    margin-bottom: 30px;
}
.sidebar-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.hot-list {
    background: var(--bg-surface);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    counter-reset: hot-counter;
}
.hot-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    text-decoration: none;
    transition: background 0.2s;
    counter-increment: hot-counter;
}
.hot-item:hover {
    background: var(--card-hover-bg);
}
.hot-title {
    flex: 1;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 540;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hot-title::before {
    content: counter(hot-counter) ". ";
    font-weight: 540;
    margin-right: 4px;
}
.sidebar-02 {
    margin-top: 30px;
}
.sidebar-02 .featured-item {
    border-radius: 20px;
}
.stats-card {
    background: var(--bg-surface);
    border-radius: 20px;
    padding: 8px 12px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: background-color 0.3s ease, border-color 0.3s;
    text-align: center;
    cursor: default;
}
.stats-card.completed {
    background: rgba(16, 185, 129, 0.12);
    border-color: #10b981;
    box-shadow: 0 0 0 1px #10b981;
}
.stats-row {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 4px 0;
    min-height: 24px;
}
.stats-number {
    font-weight: 700;
    color: var(--accent);
}
.progress-container {
    margin: 6px 0 4px;
    height: 3px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 0.2s ease;
}
.stats-card.completed .progress-fill {
    background: #10b981;
}
.archive-sidebar .hot-posts:first-child {
    margin-bottom: 20px;
}
.archive-sidebar .hot-posts:first-child .stats-card {
    margin-top: 0;
}
@media (max-width: 640px) {
    .archive-sidebar .hot-posts:first-child {
        display: none;
    }
}
.content-section {
    margin: 48px 0 40px;
}
.content-container {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    flex-wrap: wrap;
}
.content-main {
    flex: 2;
    min-width: 0;
}
.article-content {
    background: var(--bg-surface);
    border-radius: 28px;
    padding: 32px;
    box-shadow: var(--card-shadow);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.article-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}
.article-meta {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}
.article-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.article-body p {
    text-indent: 2em;
    margin-bottom: 1.2em;
}
.article-body blockquote p {
    text-indent: 0;
}
.article-body h2 {
    font-size: 1.4rem;
    margin: 1.5em 0 0.5em;
    padding-left: 0.8rem;
    border-left: 4px solid var(--accent);
    line-height: 1.3;
}
.article-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5em auto;
    border-radius: 12px;
    cursor: pointer;
    transition: opacity 0.2s;
}
.article-body blockquote {
    margin: 1.5em 0;
    padding: 1.2em 1.8em;
    border-left: 5px solid;
    border-radius: 12px;
    font-style: normal;
    text-indent: 0;
    box-shadow: none;
}
.article-body blockquote.quote-blue {
    background: var(--quote-blue-bg);
    border-left-color: #2c6ef8;
    color: var(--text-secondary);
}
body.dark .article-body blockquote.quote-blue {
    border-left-color: #5a8eff;
}
.article-body blockquote.quote-green {
    background: var(--quote-green-bg);
    border-left-color: #10b981;
}
body.dark .article-body blockquote.quote-green {
    border-left-color: #34d399;
}
.article-body blockquote.quote-orange {
    background: var(--quote-orange-bg);
    border-left-color: #f59e0b;
}
body.dark .article-body blockquote.quote-orange {
    border-left-color: #fbbf24;
}
.article-body blockquote.quote-purple {
    background: var(--quote-purple-bg);
    border-left-color: #8b5cf6;
}
body.dark .article-body blockquote.quote-purple {
    border-left-color: #a78bfa;
}
.article-body blockquote.quote-gray {
    background: var(--quote-gray-bg);
    border-left-color: #9ca3af;
}
.article-body blockquote p:last-child {
    margin-bottom: 0;
}
.article-body blockquote footer {
    margin-top: 0.8em;
    font-size: 0.85rem;
    text-align: right;
    color: var(--footer-text);
}
.author-signature {
    text-align: right;
    margin-top: 2em;
    margin-bottom: 0.5em;
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.copyright-section {
    margin: 0 0 1.5em;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
}
.copyright-section a {
    color: inherit;
    text-decoration: none;
}
.copyright-section a:hover {
    text-decoration: underline;
}
.article-bottom-ad {
    margin: 1.5em 0 1.5em;
}
.article-bottom-ad .featured-item {
    border-radius: 16px;
}
.related-posts {
    margin-top: 40px;
}
.related-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 24px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--accent);
    display: inline-block;
}
.related-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.related-item {
    background: var(--bg-surface);
    padding: 20px;
    transition: background 0.2s;
}
.related-item:hover {
    background: var(--card-hover-bg);
}
.related-item-title {
    font-size: 1.2rem;
    font-weight: 540;
    margin-bottom: 10px;
}
.related-item-title a {
    color: var(--text-primary);
    text-decoration: none;
}
.related-item-title a:hover {
    color: var(--accent);
}
.related-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 900px) {
    .content-container, .archive-container {
        flex-direction: column;
    }
    .archive-sidebar {
        position: static;
        width: 100%;
    }
    .hot-list {
        display: block;
    }
    .sidebar-02 {
        margin-top: 20px;
    }
}
@media (max-width: 640px) {
    .container {
        padding: 0 12px;
    }
    .article-content {
        padding: 20px;
    }
    .article-title {
        font-size: 1.5rem;
    }
    .article-body h2 {
        padding-left: 0.6rem;
        border-left-width: 3px;
    }
}
@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    .article-content {
        padding: 16px;
    }
    .article-body h2 {
        font-size: 1.3rem;
    }
}
.image-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}
.image-preview-modal.active {
    display: flex;
}
.preview-container {
    width: 90%;
    height: 85%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.preview-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.1s ease;
}
.preview-image:active {
    cursor: grabbing;
}
.preview-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 40px;
    display: flex;
    gap: 12px;
    padding: 8px 16px;
    z-index: 3010;
    backdrop-filter: blur(8px);
}
.preview-controls button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px 12px;
    transition: 0.2s;
    border-radius: 30px;
}
.preview-controls button:hover {
    background: rgba(255, 255, 255, 0.2);
}
.preview-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    background: none;
    border: none;
    z-index: 3010;
    font-family: monospace;
}
.site-footer {
    margin-top: 40px;
    padding: 32px 0 40px;
    border-top: 1px solid var(--border-light);
    font-size: 0.8rem;
    color: var(--footer-text);
}
.site-footer a {
    color: inherit;
    text-decoration: none;
}
.site-footer a:hover {
    color: var(--accent);
}
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}
.footer-left, .footer-center, .footer-right {
    flex: 1;
}
.footer-left {
    text-align: left;
}
.footer-center {
    text-align: center;
}
.footer-right {
    text-align: right;
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}
.beian-icon-img {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
}
.beian-sep {
    margin: 0 6px;
    color: var(--footer-text);
}
@media (max-width: 768px) {
    .footer-row {
        flex-direction: column;
        text-align: center;
    }
    .footer-left, .footer-center, .footer-right {
        text-align: center;
        white-space: normal;
        justify-content: center;
    }
}
/* 右下角胶囊 - 初始隐藏，滚动后显示 */
.action-capsule {
    position: fixed;
    bottom: 28px;
    right: 28px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--capsule-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--capsule-border);
    border-radius: 12px;
    padding: 8px 4px;
    width: 50px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s, transform 0.2s;
    transform: translateY(10px) scale(0.96);
}
.action-capsule.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}
.capsule-btn {
    width: 100%;
    padding: 6px 0;
    font-size: 0.8rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-primary);
    text-align: center;
    text-decoration: none;
}
.capsule-btn:hover {
    background: var(--btn-hover-bg);
    color: var(--btn-hover-color);
}
.action-capsule a.capsule-btn {
    text-decoration: none;
}
@media (max-width: 768px) {
    .featured-grid { grid-template-columns: 1fr; gap: 16px; }
    .action-capsule { bottom: 18px; right: 18px; width: 46px; }
}