/* SunBlog 主题样式 - 现代化响应式博客主题
*/

/* 1. Reset & Base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif; line-height: 1.6; color: #333; background: #f5f6f8; -webkit-font-smoothing: antialiased; }
:root { --theme-color: #667eea; --theme-color-dark: #5568d3; --sidebar-width: 300px; --content-width: 860px; }
a { color: var(--theme-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--theme-color-dark); }
img { max-width: 100%; height: auto; display: block; border: 0; }

/* 暗色模式 */
body.dark-mode { background: #1a1a1a; color: #d0d0d0; }
body.dark-mode a { color: #8fa0ff; }
body.dark-mode .sunblog-header, body.dark-mode footer, body.dark-mode .post-card, body.dark-mode .sidebar-widget, body.dark-mode .article-detail { background: #2a2a2a; color: #d0d0d0; }
body.dark-mode .post-title a, body.dark-mode h1, body.dark-mode h2, body.dark-mode h3 { color: #e5e5e5; }

/* 容器 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 头部导航 */
.sunblog-header { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
body.dark-mode .sunblog-header { background: #2a2a2a; }
.header-container { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
.header-left .logo { font-size: 22px; font-weight: 700; color: var(--theme-color); }
.header-nav { flex: 1; padding: 0 30px; }
.nav-list { list-style: none; display: flex; gap: 20px; }
.nav-item a { color: #555; font-weight: 500; font-size: 15px; padding: 5px 0; }
.nav-item.active a, .nav-item a:hover { color: var(--theme-color); }
.header-right { display: flex; align-items: center; gap: 10px; }
.search-box { display: flex; align-items: center; }
.search-box form { display: flex; align-items: center; }
.search-input { padding: 8px 12px; border: 1px solid #ddd; border-radius: 20px 0 0 20px; font-size: 13px; width: 180px; outline: none; transition: border-color 0.2s; }
.search-input:focus { border-color: var(--theme-color); }
.search-btn { padding: 8px 12px; background: var(--theme-color); color: #fff; border: none; border-radius: 0 20px 20px 0; cursor: pointer; }
.dark-mode-toggle { background: transparent; border: 1px solid #ddd; border-radius: 50%; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; }

/* 阅读进度条 */
.reading-progress-bar { position: fixed; top: 0; left: 0; width: 100%; height: 3px; background: rgba(0,0,0,0.05); z-index: 100; }
.reading-progress-fill { height: 100%; width: 0%; background: var(--theme-color); transition: width 0.1s; }

/* 主内容区 */
.sunblog-main { padding: 30px 0; }
.content-wrapper { display: flex; gap: 30px; align-items: flex-start; }
body.theme-none .content-wrapper { flex-direction: column; }
body.theme-right .content-wrapper { flex-direction: row; }
body.theme-left .content-wrapper { flex-direction: row-reverse; }
/* 内容区宽度 */
.sunblog-main .sunblog-main { flex: 1; min-width: 0; }
/* 文章卡片列表 */
.post-list { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.post-list-card { display: flex; flex-direction: column; }
.post-list-list { display: flex; flex-direction: column; }
.post-card { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; }
body.dark-mode .post-card { background: #2a2a2a; box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.post-card:hover { transform: translateY(-3px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.post-thumbnail { position: relative; overflow: hidden; }
.post-thumb-img { width: 100%; height: 220px; object-fit: cover; display: block; }
.post-content-wrapper { padding: 22px 26px; }
.post-title { font-size: 22px; font-weight: 600; margin-bottom: 12px; color: #333; }
body.dark-mode .post-title { color: #e5e5e5; }
.post-title a { color: #333; }
body.dark-mode .post-title a { color: #e5e5e5; }
.post-meta { font-size: 13px; color: #888; display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 14px; }
.post-meta .meta-item { display: inline-flex; align-items: center; gap: 4px; }
.post-excerpt { color: #666; font-size: 15px; line-height: 1.7; margin-bottom: 15px; }
body.dark-mode .post-excerpt { color: #aaa; }
.post-tags { margin: 10px 0; }
.post-tag { display: inline-block; padding: 4px 12px; background: rgba(102, 126, 234, 0.08); color: var(--theme-color); border-radius: 14px; font-size: 12px; margin: 3px 4px 3px 0; }
body.dark-mode .post-tag { background: rgba(135, 160, 255, 0.15); }
.post-footer { margin-top: 15px; padding-top: 15px; border-top: 1px solid #f0f0f0; }
body.dark-mode .post-footer { border-top-color: #444; }
.read-more-btn { font-size: 14px; color: var(--theme-color); font-weight: 500; }

/* 文章详情页 */
.article-detail { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 36px 40px; }
body.dark-mode .article-detail { background: #2a2a2a; color: #d0d0d0; }
.article-header { text-align: center; margin-bottom: 30px; padding-bottom: 24px; border-bottom: 1px solid #f0f0f0; }
body.dark-mode .article-header { border-bottom-color: #444; }
.article-title { font-size: 32px; font-weight: 700; margin-bottom: 16px; color: #333; line-height: 1.3; }
body.dark-mode .article-title { color: #fff; }
.article-meta { font-size: 14px; color: #888; display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.article-content { font-size: 16px; line-height: 1.9; color: #444; }
body.dark-mode .article-content { color: #ccc; }
.article-content p { margin: 0 0 20px; }
.article-content h2 { font-size: 24px; font-weight: 600; margin: 30px 0 15px; padding-left: 12px; border-left: 4px solid var(--theme-color); }
body.dark-mode .article-content h2 { color: #f0f0f0; }
.article-content h3 { font-size: 20px; font-weight: 600; margin: 25px 0 12px; }
body.dark-mode .article-content h3 { color: #e5e5e5; }
.article-content img { max-width: 100%; margin: 20px auto; border-radius: 6px; }
.article-content blockquote { padding: 15px 20px; background: #f8f8f8; border-left: 4px solid var(--theme-color); margin: 20px 0; border-radius: 0 6px 6px 0; }
body.dark-mode .article-content blockquote { background: #333; color: #d0d0d0; }
.article-content pre { background: #f5f5f5; padding: 15px; border-radius: 6px; overflow-x: auto; font-size: 14px; }
body.dark-mode .article-content pre { background: #1a1a1a; }
.article-content code { background: #f0f0f0; padding: 2px 6px; border-radius: 3px; font-size: 14px; color: #c7254e; }
body.dark-mode .article-content code { background: #333; color: #ffa5c7; }
.article-content ul, .article-content ol { padding-left: 30px; margin: 15px 0; }
.article-content table { border-collapse: collapse; width: 100%; margin: 20px 0; }
.article-content th, .article-content td { border: 1px solid #e0e0e0; padding: 8px 12px; text-align: left; }
body.dark-mode .article-content th, body.dark-mode .article-content td { border-color: #555; }
.article-content th { background: #f5f5f5; }
body.dark-mode .article-content th { background: #333; }

/* 文章目录 */
.article-toc { background: #f8f9fa; padding: 20px 25px; margin: 25px 0; border-radius: 8px; border-left: 4px solid var(--theme-color); }
body.dark-mode .article-toc { background: #333; }
.toc-title { font-size: 18px; font-weight: 600; margin-bottom: 12px; color: var(--theme-color); }
.toc-content ol, .toc-content ul { list-style: none; padding-left: 20px; }
.toc-content a { font-size: 14px; }
.article-tags { margin: 25px 0; padding: 15px 0; border-top: 1px solid #f0f0f0; border-bottom: 1px solid #f0f0f0; }
body.dark-mode .article-tags { border-color: #444; }
.article-tag { display: inline-block; padding: 4px 12px; background: rgba(102, 126, 234, 0.1); color: var(--theme-color); border-radius: 14px; font-size: 12px; margin: 3px 4px 3px 0; }
body.dark-mode .article-tag { background: rgba(135, 160, 255, 0.15); }

/* 版权声明 */
.article-copyright { background: #f8f9fa; padding: 16px 20px; border-left: 4px solid #ff9800; border-radius: 0 6px 6px 0; margin: 25px 0; font-size: 13px; color: #666; white-space: pre-wrap; }
body.dark-mode .article-copyright { background: #3a3a3a; color: #c0c0c0; }

/* 点赞按钮 */
.like-button { display: block; margin: 20px auto; padding: 12px 30px; background: linear-gradient(135deg, #667eea, #764ba2); color: #fff; border: none; border-radius: 25px; cursor: pointer; font-size: 15px; transition: transform 0.2s; }
.like-button:hover { transform: scale(1.05); }

/* 上一篇 / 下一篇 */
.article-nav { display: flex; justify-content: space-between; gap: 15px; margin: 30px 0; }
.prev-article, .next-article { flex: 1; padding: 15px 20px; background: #f8f9fa; border-radius: 8px; }
body.dark-mode .prev-article, body.dark-mode .next-article { background: #333; }
.prev-article { text-align: left; }
.next-article { text-align: right; }
.article-nav a { color: #555; }
body.dark-mode .article-nav a { color: #ccc; }

/* 相关文章 */
.related-posts { margin-top: 30px; padding-top: 20px; border-top: 2px solid #f0f0f0; }
body.dark-mode .related-posts { border-top-color: #444; }
.related-title { font-size: 22px; font-weight: 600; margin-bottom: 20px; color: #333; }
body.dark-mode .related-title { color: #f0f0f0; }
.related-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; }
.related-item { display: flex; flex-direction: column; background: #f8f9fa; border-radius: 8px; overflow: hidden; transition: transform 0.2s; }
body.dark-mode .related-item { background: #333; }
.related-item:hover { transform: translateY(-2px); }
.related-thumbnail img { width: 100%; height: 120px; object-fit: cover; }
.related-content { padding: 12px; }
.related-post-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; color: #333; line-height: 1.4; }
body.dark-mode .related-post-title { color: #e5e5e5; }
.related-date { font-size: 12px; color: #888; }

/* 侧边栏 */
.sidebar { width: 300px; flex-shrink: 0; }
.sidebar-widgets { display: flex; flex-direction: column; gap: 20px; }
.sidebar-widget { background: #fff; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); padding: 20px; }
body.dark-mode .sidebar-widget { background: #2a2a2a; }
.widget-title { font-size: 17px; font-weight: 600; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 2px solid var(--theme-color); color: #333; }
body.dark-mode .widget-title { color: #e5e5e5; }
.widget-list { list-style: none; }
.widget-list li { padding: 8px 0; border-bottom: 1px dashed #eee; font-size: 14px; }
body.dark-mode .widget-list li { border-bottom-color: #444; }
.widget-list li:last-child { border-bottom: none; }
.widget-list li a { color: #555; }
body.dark-mode .widget-list li a { color: #ccc; }
.widget-list li a:hover { color: var(--theme-color); }
.search-input-sidebar { width: 100%; padding: 8px 12px; border: 1px solid #ddd; border-radius: 20px; font-size: 13px; outline: none; }
body.dark-mode .search-input-sidebar { background: #333; border-color: #555; color: #fff; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { padding: 5px 12px; background: #f0f0f0; color: #555; border-radius: 15px; font-size: 13px; }
body.dark-mode .tag-cloud a { background: #333; color: #ccc; }
.tag-cloud a:hover { background: var(--theme-color); color: #fff; }
.comment-author { font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.widget-custom .widget-content { font-size: 14px; color: #666; }

/* 面包屑 */
.sunblog-breadcrumb { margin-bottom: 20px; padding: 10px 15px; background: #f8f9fa; border-radius: 6px; font-size: 13px; }
body.dark-mode .sunblog-breadcrumb { background: #333; }
.sunblog-breadcrumb ol { display: flex; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; gap: 8px; }
.sunblog-breadcrumb li { color: #888; }
.breadcrumb-item.active { color: #555; }
body.dark-mode .breadcrumb-item.active { color: #ccc; }

/* 首页横幅 */
.home-banner { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 50px 40px; border-radius: 12px; margin-bottom: 25px; text-align: center; }
.home-banner h1 { color: #fff; font-size: 28px; margin-bottom: 10px; }
.home-banner p { color: rgba(255,255,255,0.9); font-size: 16px; }

/* 置顶文章 */
.sticky-posts { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 25px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
body.dark-mode .sticky-posts { background: #2a2a2a; }
.sticky-posts h3 { font-size: 18px; margin-bottom: 15px; color: var(--theme-color); }
.sticky-posts ul { list-style: none; padding: 0; margin: 0; }
.sticky-posts li { padding: 8px 0; border-bottom: 1px dashed #eee; }
body.dark-mode .sticky-posts li { border-bottom-color: #444; }
.sticky-posts li:last-child { border-bottom: none; }

/* 分页 */
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 14px; background: #fff; border-radius: 6px; color: #555; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
body.dark-mode .pagination a, body.dark-mode .pagination span { background: #2a2a2a; color: #ccc; }
.pagination .pagecurrent, .pagination span.pagecurrent { background: var(--theme-color); color: #fff; }
.pagination a:hover { background: var(--theme-color); color: #fff; }

/* 页脚 */
.sunblog-footer { background: #2a2a2a; color: #ccc; padding: 40px 0 20px; margin-top: 50px; }
.footer-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 30px; margin-bottom: 30px; }
.footer-section h3 { color: #fff; font-size: 16px; margin-bottom: 15px; }
.footer-section p { font-size: 14px; color: #999; line-height: 1.8; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 8px; font-size: 14px; }
.footer-links li a { color: #999; }
.footer-links li a:hover { color: var(--theme-color); }
.footer-bottom { border-top: 1px solid #444; padding-top: 20px; text-align: center; font-size: 13px; color: #888; }
.footer-powered { margin-top: 8px; }

/* 回到顶部按钮 */
.back-to-top { position: fixed; right: 30px; bottom: 50px; width: 40px; height: 40px; border-radius: 50%; background: var(--theme-color); color: #fff; border: none; font-size: 18px; cursor: pointer; display: none; z-index: 99; box-shadow: 0 2px 8px rgba(0,0,0,0.2); transition: opacity 0.3s, background 0.3s; }
.back-to-top:hover { background: var(--theme-color-dark); }

/* 移动端响应式 */
@media (max-width: 768px) {
    .content-wrapper { flex-direction: column; }
    .sidebar { width: 100%; }
    .header-container { flex-wrap: wrap; padding: 12px; }
    .header-nav { display: none; }
    .article-detail { padding: 20px 15px; }
    .article-title { font-size: 22px; }
    .post-content-wrapper { padding: 16px; }
    .home-banner { padding: 30px 20px; }
    .home-banner h1 { font-size: 22px; }
    .back-to-top { right: 15px; bottom: 20px; }
}
