/* ============================================
   个人博客模板 - EyouCMS
   主色调: #990000 酒红色
   风格: 简约回忆录/日记风格
   ============================================ */

/* 重置与基础 */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "宋体", Georgia, serif;
    background: #faf8f5;
    color: #33302e;
    line-height: 2.0;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}
a { color: #990000; text-decoration: none; transition: color .3s; }
a:hover { color: #660000; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* 阅读进度条 */
.reading-progress {
    position: fixed; top: 0; left: 0; height: 3px;
    background: linear-gradient(90deg, #990000, #cc3333);
    width: 0%; z-index: 9999; transition: width .1s;
}

/* 顶部导航 */
.site-header {
    background: #faf8f5;
    border-bottom: 1px solid #e8e4df;
    position: sticky; top: 0; z-index: 1000;
    backdrop-filter: blur(10px);
}
.header-inner {
    max-width: 900px; margin: 0 auto; padding: 18px 24px;
    display: flex; justify-content: space-between; align-items: center;
}
.site-logo {
    font-size: 22px; font-weight: 700; color: #33302e;
    letter-spacing: 2px;
}
.site-logo span { color: #990000; }
.site-nav { display: flex; gap: 32px; }
.site-nav a {
    color: #555; font-size: 15px; position: relative;
    padding: 4px 0;
}
.site-nav a:hover, .site-nav a.active { color: #990000; }
.site-nav a.active::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 100%; height: 2px; background: #990000;
}
.menu-toggle {
    display: none; background: none; border: none;
    font-size: 24px; cursor: pointer; color: #33302e;
}

/* 主体内容 */
.site-main {
    max-width: 900px; margin: 0 auto; padding: 48px 24px;
    min-height: calc(100vh - 200px);
}

/* 首页文章列表 */
.page-title {
    font-size: 28px; font-weight: 700; margin-bottom: 8px;
    color: #33302e;
}
.page-subtitle {
    color: #888; font-size: 14px; margin-bottom: 40px;
    padding-bottom: 24px; border-bottom: 1px solid #e8e4df;
}
.article-list { display: flex; flex-direction: column; gap: 36px; }
.article-item {
    padding-bottom: 36px; border-bottom: 1px solid #f0ece7;
}
.article-item:last-child { border-bottom: none; }
.article-date {
    font-size: 13px; color: #999; margin-bottom: 8px;
    letter-spacing: 1px;
}
.article-title {
    font-size: 22px; font-weight: 700; margin-bottom: 12px;
    line-height: 1.5;
}
.article-title a { color: #33302e; }
.article-title a:hover { color: #990000; }
.article-summary {
    color: #666; font-size: 15px; line-height: 1.9;
    margin-bottom: 12px;
}
.article-meta {
    font-size: 13px; color: #999; display: flex; gap: 16px;
}
.article-meta a { color: #990000; }

/* 分页 */
.pagination {
    margin-top: 48px; display: flex; justify-content: center;
    gap: 8px; flex-wrap: wrap;
}
.pagination a, .pagination span {
    padding: 8px 16px; border: 1px solid #e0dcd7; border-radius: 4px;
    font-size: 14px; color: #666; transition: all .3s;
}
.pagination a:hover { background: #990000; color: #fff; border-color: #990000; }
.pagination .current { background: #990000; color: #fff; border-color: #990000; }

/* 文章详情页 */
.article-header {
    text-align: center; margin-bottom: 48px; padding-bottom: 32px;
    border-bottom: 1px solid #e8e4df;
}
.article-header .article-title {
    font-size: 30px; line-height: 1.6; margin-bottom: 20px;
}
.article-header .article-meta {
    justify-content: center; font-size: 14px;
}
.article-header .article-meta span { display: flex; align-items: center; gap: 4px; }
.title-divider {
    width: 60px; height: 2px; background: #990000;
    margin: 0 auto 24px;
}

/* 正文内容 */
.article-content {
    font-size: 17px; line-height: 2.0; color: #33302e;
}
.article-content p {
    margin-bottom: 24px; text-indent: 2em;
}
.article-content h2 {
    font-size: 24px; margin: 40px 0 20px; padding-left: 16px;
    border-left: 4px solid #990000; line-height: 1.5;
}
.article-content h3 {
    font-size: 20px; margin: 32px 0 16px; color: #33302e;
}
.article-content blockquote {
    margin: 32px 0; padding: 20px 24px;
    background: #fdf5f5; border-left: 4px solid #990000;
    font-style: italic; color: #555; border-radius: 0 4px 4px 0;
}
.article-content blockquote p { text-indent: 0; margin-bottom: 0; }
.article-content img {
    margin: 32px auto; border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,.08); cursor: pointer;
}
.article-content ul, .article-content ol {
    margin: 24px 0; padding-left: 2em;
}
.article-content ul li, .article-content ol li {
    margin-bottom: 12px; list-style: disc;
}
.article-content ol li { list-style: decimal; }
.article-content a {
    color: #990000; text-decoration: underline; text-underline-offset: 3px;
}
.article-content table {
    width: 100%; margin: 32px 0; border-collapse: collapse;
    font-size: 15px;
}
.article-content th, .article-content td {
    padding: 12px 16px; border: 1px solid #e0dcd7; text-align: left;
}
.article-content th { background: #f5f2ee; font-weight: 600; }
.article-content code {
    background: #f5f2ee; padding: 2px 8px; border-radius: 4px;
    font-size: 14px; font-family: Consolas, Monaco, monospace;
}
.article-content pre {
    background: #2d2d2d; color: #f8f8f2; padding: 20px;
    border-radius: 8px; overflow-x: auto; margin: 24px 0;
}
.article-content pre code {
    background: none; padding: 0; color: #f8f8f2;
}

/* 文章标签 */
.article-tags {
    margin-top: 48px; padding-top: 24px; border-top: 1px solid #e8e4df;
    display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.article-tags .label { color: #888; font-size: 14px; }
.article-tags a {
    padding: 4px 14px; background: #f5f2ee; border-radius: 20px;
    font-size: 13px; color: #666; transition: all .3s;
}
.article-tags a:hover { background: #990000; color: #fff; }

/* 上一篇下一篇 */
.post-nav {
    margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.post-nav-item {
    padding: 20px; border: 1px solid #e8e4df; border-radius: 8px;
    transition: all .3s;
}
.post-nav-item:hover { border-color: #990000; background: #fdfafa; }
.post-nav-item .nav-label { font-size: 13px; color: #999; margin-bottom: 8px; }
.post-nav-item .nav-title {
    font-size: 15px; color: #33302e; line-height: 1.6;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}
.post-nav-item.next { text-align: right; }

/* 目录导航 */
.toc-sidebar {
    position: fixed; right: 24px; top: 50%; transform: translateY(-50%);
    max-width: 240px; max-height: 70vh; overflow-y: auto;
    background: #fff; padding: 20px; border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0,0,0,.06);
    border-left: 3px solid #990000;
}
.toc-sidebar h4 {
    font-size: 14px; color: #990000; margin-bottom: 12px;
    padding-bottom: 8px; border-bottom: 1px solid #f0ece7;
}
.toc-sidebar ul { font-size: 13px; }
.toc-sidebar li { margin-bottom: 6px; }
.toc-sidebar li a { color: #666; display: block; line-height: 1.6; }
.toc-sidebar li a:hover, .toc-sidebar li a.active { color: #990000; }
.toc-sidebar .toc-h3 { padding-left: 16px; }

/* 评论区 */
.comments-section {
    margin-top: 64px; padding-top: 40px; border-top: 2px solid #990000;
}
.comments-title {
    font-size: 22px; font-weight: 700; margin-bottom: 32px;
    color: #33302e;
}
.comments-title span { color: #990000; font-size: 16px; }
.comment-form {
    background: #fff; padding: 24px; border-radius: 8px;
    margin-bottom: 40px; box-shadow: 0 2px 12px rgba(0,0,0,.04);
}
.comment-form .form-row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
    margin-bottom: 16px;
}
.comment-form input, .comment-form textarea {
    width: 100%; padding: 12px 16px; border: 1px solid #e0dcd7;
    border-radius: 6px; font-size: 14px; font-family: inherit;
    background: #faf8f5; transition: border-color .3s;
}
.comment-form input:focus, .comment-form textarea:focus {
    outline: none; border-color: #990000; background: #fff;
}
.comment-form textarea { min-height: 120px; resize: vertical; }
.comment-form .submit-btn {
    background: #990000; color: #fff; border: none; padding: 12px 32px;
    border-radius: 6px; font-size: 15px; cursor: pointer;
    transition: background .3s; font-family: inherit;
}
.comment-form .submit-btn:hover { background: #770000; }
.comment-list { display: flex; flex-direction: column; gap: 24px; }
.comment-item {
    background: #fff; padding: 20px; border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,.03);
}
.comment-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 12px;
}
.comment-author { display: flex; align-items: center; gap: 12px; }
.comment-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: #990000; color: #fff; display: flex;
    align-items: center; justify-content: center; font-size: 16px;
    font-weight: 600;
}
.comment-name { font-weight: 600; font-size: 15px; }
.comment-date { font-size: 12px; color: #999; }
.comment-content { color: #555; font-size: 14px; line-height: 1.8; }
.comment-reply-btn {
    background: none; border: none; color: #990000; font-size: 13px;
    cursor: pointer; margin-top: 8px;
}
.comment-children { margin-top: 16px; padding-left: 24px; border-left: 2px solid #f0ece7; }

/* 归档页 */
.archive-year {
    font-size: 24px; font-weight: 700; color: #990000;
    margin: 40px 0 20px; padding-bottom: 12px;
    border-bottom: 1px solid #e8e4df;
}
.archive-item {
    display: flex; align-items: baseline; gap: 16px;
    padding: 12px 0; border-bottom: 1px dashed #f0ece7;
}
.archive-item .date {
    font-size: 14px; color: #999; min-width: 80px;
    font-family: Consolas, monospace;
}
.archive-item .title {
    font-size: 16px; color: #33302e; flex: 1;
}
.archive-item .title:hover { color: #990000; }

/* 关于页 */
.about-content { text-align: center; }
.about-avatar {
    width: 120px; height: 120px; border-radius: 50%;
    background: linear-gradient(135deg, #990000, #cc3333);
    margin: 0 auto 24px; display: flex; align-items: center;
    justify-content: center; color: #fff; font-size: 40px;
}
.about-name { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.about-bio { color: #666; font-size: 16px; margin-bottom: 32px; }
.about-section { text-align: left; margin-top: 40px; }
.about-section h3 {
    font-size: 20px; color: #990000; margin-bottom: 16px;
    padding-left: 12px; border-left: 3px solid #990000;
}
.about-section p { margin-bottom: 16px; text-indent: 2em; }

/* 回到顶部 */
.back-to-top {
    position: fixed; bottom: 32px; right: 32px; width: 44px; height: 44px;
    background: #990000; color: #fff; border: none; border-radius: 50%;
    font-size: 20px; cursor: pointer; opacity: 0; visibility: hidden;
    transition: all .3s; z-index: 999; box-shadow: 0 4px 12px rgba(153,0,0,.3);
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: #770000; transform: translateY(-2px); }

/* 页脚 */
.site-footer {
    background: #f5f2ee; border-top: 1px solid #e8e4df;
    padding: 40px 24px; text-align: center;
}
.footer-inner { max-width: 900px; margin: 0 auto; }
.footer-signature {
    font-size: 16px; color: #990000; font-style: italic;
    margin-bottom: 12px;
}
.footer-nav {
    display: flex; justify-content: center; gap: 24px;
    margin-bottom: 16px;
}
.footer-nav a { color: #888; font-size: 14px; }
.footer-nav a:hover { color: #990000; }
.footer-copyright { color: #aaa; font-size: 13px; }

/* 图片放大遮罩 */
.image-lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,.85); display: flex; align-items: center;
    justify-content: center; z-index: 10000; opacity: 0;
    visibility: hidden; transition: all .3s; cursor: zoom-out;
}
.image-lightbox.show { opacity: 1; visibility: visible; }
.image-lightbox img {
    max-width: 90%; max-height: 90%; border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,.3);
}

/* 深色模式 */
body.dark-mode {
    background: #1a1816; color: #d4d0cc;
}
body.dark-mode .site-header { background: #1a1816; border-color: #333; }
body.dark-mode .site-logo { color: #d4d0cc; }
body.dark-mode .site-nav a { color: #aaa; }
body.dark-mode .article-title a { color: #d4d0cc; }
body.dark-mode .article-summary { color: #999; }
body.dark-mode .article-content { color: #d4d0cc; }
body.dark-mode .article-content h2,
body.dark-mode .article-content h3 { color: #d4d0cc; }
body.dark-mode .article-content blockquote {
    background: #2a2525; color: #aaa;
}
body.dark-mode .comment-form,
body.dark-mode .comment-item,
body.dark-mode .toc-sidebar { background: #252220; }
body.dark-mode .comment-form input,
body.dark-mode .comment-form textarea {
    background: #1a1816; border-color: #444; color: #d4d0cc;
}
body.dark-mode .site-footer { background: #151311; border-color: #333; }
body.dark-mode .post-nav-item { background: #252220; border-color: #444; }
body.dark-mode .pagination a,
body.dark-mode .pagination span { border-color: #444; color: #aaa; }
body.dark-mode .article-tags a { background: #252220; color: #aaa; }

/* 响应式 */
@media (max-width: 1280px) {
    .toc-sidebar { display: none; }
}
@media (max-width: 768px) {
    .menu-toggle { display: block; }
    .site-nav {
        display: none; position: absolute; top: 100%; left: 0;
        right: 0; background: #faf8f5; flex-direction: column;
        padding: 20px 24px; gap: 16px;
        border-bottom: 1px solid #e8e4df;
    }
    .site-nav.show { display: flex; }
    .site-main { padding: 32px 16px; }
    .article-header .article-title { font-size: 24px; }
    .article-content { font-size: 16px; }
    .post-nav { grid-template-columns: 1fr; }
    .comment-form .form-row { grid-template-columns: 1fr; }
    .page-title { font-size: 24px; }
    .article-title { font-size: 19px; }
    .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}
