/* ==========================================================================
   Sunrise Theme Style - Ver 11.7 (Lightbox & Comment Fix)
   ========================================================================== */

:root {
    --bg-body: #f4f6f8;
    --bg-card: #ffffff;
    --text-main: #333333;
    --text-sec: #666666;
    --text-meta: #999999;
    --primary: #4e8cff;
    --primary-hover: #3a75e0;
    --border: #eaeff5;
    --shadow: 0 5px 20px rgba(0,0,0,0.05);
    --radius: 10px;
    --bubble-bg: #f0f2f5;
    --bubble-bg-child: #e4e6eb;
}

body.dark-mode {
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-main: #e0e0e0;
    --text-sec: #a0a0a0;
    --text-meta: #777;
    --border: #333;
    --primary: #66b1ff;
    --shadow: 0 5px 20px rgba(0,0,0,0.3);
    --bubble-bg: #2c2c2e;
    --bubble-bg-child: #3a3a3c;
}

/* --- 1. 基础全局 --- */
html, body { width: 100%; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; background: var(--bg-body); color: var(--text-main); margin: 0; padding: 0; line-height: 1.6; transition: 0.3s; }
* { box-sizing: border-box; }
a { text-decoration: none; color: inherit; transition: 0.2s; }
a:hover { color: var(--primary); }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; position: relative; }

/* --- 2. 导航栏 --- */
.navbar { background: var(--bg-card); height: 64px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); position: sticky; top: 0; z-index: 999; }
.nav-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo img { height: 40px; width: auto; vertical-align: middle; }
.logo-text { font-size: 22px; font-weight: bold; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
.nav-menu ul { display: flex; gap: 20px; }
.nav-menu a { font-size: 15px; font-weight: 500; color: var(--text-sec); }
.nav-menu li.active a, .nav-menu a:hover { color: var(--primary); font-weight: bold; }
.nav-tools { display: flex; align-items: center; gap: 15px; }
.search-form { background: var(--bg-body); border-radius: 20px; padding: 5px 15px; display: flex; align-items: center; border: 1px solid transparent; transition: .3s; }
.search-form:focus-within { border-color: var(--primary); }
.search-input { border: none; background: transparent; outline: none; width: 120px; font-size: 13px; color: var(--text-main); }
.search-form button { border: none; background: transparent; cursor: pointer; color: var(--text-meta); padding: 0; display: flex; }
.dark-mode-toggle { font-size: 20px; cursor: pointer; color: var(--text-sec); }
.mobile-menu-toggle { display: none; font-size: 24px; cursor: pointer; margin-left: 10px; color: var(--text-main); }

/* --- 3. 布局 --- */
.layout-grid { display: grid; grid-template-columns: 1fr 300px; gap: 25px; margin-top: 25px; margin-bottom: 50px; }
.single-layout { align-items: flex-start; }
.sticky-sidebar { position: -webkit-sticky; position: sticky; top: 80px; align-self: flex-start; height: fit-content; z-index: 10; }

/* --- 4. 列表页组件 --- */
.list-header-card { background: var(--bg-card); padding: 15px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.list-toolbar { display: flex; justify-content: space-between; align-items: center; }
.notice-bar { font-size: 15px; font-weight: bold; color: var(--text-sec); display: flex; align-items: center; gap: 5px; }
.notice-icon { color: var(--primary); font-size: 18px; }
.announcement-inline-box { flex: 1; margin: 0 20px; background: var(--bg-body); padding: 5px 15px; border-radius: 20px; height: 32px; display: flex; align-items: center; overflow: hidden; border: 1px solid var(--border); }
.announcement-inline-box a { display: flex; align-items: center; color: var(--text-sec); width: 100%; font-size: 13px; }
.ann-icon { margin-right: 8px; color: #ff6b6b; flex-shrink: 0; }
.ann-text-wrapper { overflow: hidden; height: 24px; position: relative; flex: 1; }
.ann-text-scroll { white-space: nowrap; position: absolute; left: 0; line-height: 24px; animation: scrollText 15s linear infinite; }
@keyframes scrollText { 0% { transform: translateX(100%); } 100% { transform: translateX(-100%); } }
.layout-toggle { display: flex; gap: 10px; }
.toggle-btn { cursor: pointer; color: var(--text-meta); transition: .2s; font-size: 20px; padding: 5px; }
.toggle-btn:hover, .toggle-btn.active { color: var(--primary); background: rgba(78, 140, 255, 0.1); border-radius: 4px; }

/* --- 5. 文章列表 --- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.post-card { background: var(--bg-card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.3s; display: flex; flex-direction: column; height: 100%; }
.post-card:hover { transform: translateY(-5px); }
.post-cover { height: 160px; position: relative; overflow: hidden; display: block; flex-shrink: 0; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.post-card:hover .post-cover img { transform: scale(1.1); }
.cat-tag { position: absolute; top: 10px; right: 10px; background: rgba(0, 0, 0, 0.6); color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 12px; backdrop-filter: blur(4px); }
.post-body { padding: 15px; display: flex; flex-direction: column; flex: 1; }
.post-title { font-size: 16px; font-weight: bold; margin: 0 0 10px; line-height: 1.4; }
.post-excerpt { font-size: 13px; color: var(--text-sec); height: 42px; overflow: hidden; margin-bottom: 12px; opacity: 0.8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.post-meta { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: var(--text-meta); border-top: 1px solid var(--border); padding-top: 10px; }
.post-grid.list-view { grid-template-columns: 1fr; }
.post-grid.list-view .post-card { flex-direction: row; height: 180px; }
.post-grid.list-view .post-cover { width: 260px; height: 100%; }
.post-grid.list-view .post-body { padding: 20px; justify-content: center; }
.post-grid.list-view .post-excerpt { height: auto; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--text-meta); }
.empty-state svg { width: 120px; height: 120px; margin: 0 auto 20px; display: block; opacity: 0.5; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span { padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; color: var(--text-sec); font-size: 13px; font-weight: 500; }
.pagination a:hover { color: var(--primary); border-color: var(--primary); }
.pagination span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* --- 6. 侧边栏 --- */
.widget { background: var(--bg-card); padding: 15px; border-radius: var(--radius); margin-bottom: 20px; box-shadow: var(--shadow); }
.widget h3 { font-size: 15px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); font-weight: bold; display: flex; align-items: center; gap: 8px; color: var(--text-main); }
.widget ul li { padding: 6px 0; border-bottom: 1px dashed var(--border); font-size: 13px; display: flex; justify-content: space-between; align-items: center; }
.widget ul li:last-child { border: none; }
.widget ul li a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80%; color: var(--text-sec); }
.widget ul li a:hover { color: var(--primary); }

.widget-profile.compact-profile { padding: 0; text-align: center; overflow: visible; }
.profile-header-bg { height: 60px; background: linear-gradient(45deg, var(--primary), #a29bfe); border-radius: var(--radius) var(--radius) 0 0; }
.profile-inner { padding: 0 15px 15px; margin-top: -30px; display: flex; flex-direction: column; align-items: center; }
.profile-avatar { width: 60px; height: 60px; border-radius: 12px; border: 3px solid var(--bg-card); background: var(--bg-card); margin-bottom: 5px; }
.profile-name { font-weight: bold; font-size: 16px; }
.profile-bio { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.profile-social { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; }
.social-item { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text-sec); transition: .3s; position: relative; font-size: 14px; background: var(--bg-body); }
.social-item:hover { color: #fff; background: var(--primary); }
.wechat-qr { position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); width: 100px; padding: 5px; background: #fff; box-shadow: var(--shadow); border-radius: 5px; display: none; z-index: 10; }
.social-item.wechat:hover .wechat-qr { display: block; }
.profile-stats { display: flex; justify-content: center; gap: 20px; padding-top: 10px; border-top: 1px solid var(--border); margin: 0 15px 15px; }
.stat-item { display: flex; flex-direction: column; }
.stat-item .count { font-weight: bold; font-size: 14px; color: var(--primary); }
.stat-item .label { font-size: 12px; color: var(--text-meta); }

.widget-hot ul li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.widget-hot ul li a { display: flex; align-items: center; width: 100%; color: var(--text-sec); text-decoration: none; gap: 10px; }
.rank-num { flex-shrink: 0; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; background: #eee; font-size: 12px; color: #999; display: block; }
.rank-1 { background-color: #f1c40f !important; color: #fff !important; }
.rank-2 { background-color: #bdc3c7 !important; color: #fff !important; }
.rank-3 { background-color: #d35400 !important; color: #fff !important; }
.hot-info { flex: 1; display: flex; justify-content: space-between; align-items: center; overflow: hidden; }
.hot-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 140px; }
.hot-views { font-size: 12px; color: var(--text-meta); display: flex; align-items: center; gap: 3px; flex-shrink: 0; }

.widget-categories ul li a { display: flex; justify-content: space-between; background: var(--bg-body); padding: 6px 10px; border-radius: 4px; transition: .3s; }
.widget-categories ul li a:hover { background: linear-gradient(90deg, var(--primary), #a29bfe); color: #fff !important; padding-left: 15px; }
.cat-count { background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 4px; font-size: 11px; }
.widget-categories ul li a:hover .cat-count { background: rgba(255,255,255,0.3); color: #fff; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { font-size: 12px; background: var(--bg-body); padding: 3px 8px; border-radius: 4px; color: var(--text-sec); transition: .2s; }
.tag-item:hover { background: var(--primary); color: #fff; }
.comm-item-link { display: flex; gap: 10px; align-items: flex-start; text-decoration: none; width: 100%; }
.comm-avatar-small { width: 32px; height: 32px; border-radius: 30%; object-fit: cover; flex-shrink: 0; background: #eee; }
.comm-info { display: flex; flex-direction: column; overflow: hidden; justify-content: center; }
.comm-author { font-size: 13px; font-weight: bold; color: var(--text-main); }
.comm-content { font-size: 12px; color: var(--text-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.widget-newlog .dot { width: 6px; height: 6px; border-radius: 50%; background: #dcdfe6; flex-shrink: 0; transition: all 0.3s ease; }
.widget-newlog .dot:hover { background: linear-gradient(135deg, #c976e6 0%, #f871a0 100%); transform: translateX(2px) scale(1.2);}

.widget-search-beautiful .beautiful-search-wrapper { position: relative; display: flex; align-items: center; background: var(--bg-body); border-radius: 8px; padding: 5px; border: 1px solid transparent; transition: .3s; }
.widget-search-beautiful .beautiful-search-wrapper:focus-within { border-color: var(--primary); }
.beautiful-search-input { flex: 1; border: none; background: transparent; padding: 8px 10px 8px 35px; font-size: 13px; outline: none; color: var(--text-main); }
.beautiful-search-icon { position: absolute; left: 10px; color: var(--text-meta); }
.beautiful-search-btn { width: 32px; height: 32px; border: none; background: var(--primary); color: #fff; border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* --- 7. 文章详情 --- */
.single-content-wrapper { background: var(--bg-card); padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); }
.article-header { text-align: center; margin-bottom: 30px; border-bottom: 1px solid var(--border); padding-bottom: 20px; }
.article-cat-tag { display: inline-block; background: linear-gradient(135deg, var(--primary), #74b9ff); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 12px; margin-bottom: 10px; }
.article-title { font-size: 26px; font-weight: bold; margin-bottom: 15px; }
.article-meta { color: var(--text-meta); font-size: 13px; display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }
.article-body { font-size: 16px; line-height: 1.8; margin-bottom: 30px; overflow-wrap: break-word; }
.article-body img { border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); max-width: 100% !important; height: auto !important; margin: 15px 0; cursor: zoom-in; }
.article-body pre { background: #282c34 !important; color: #abb2bf !important; border-radius: 8px; padding: 15px; font-family: Consolas, monospace; overflow: auto; text-shadow: none !important; position: relative; }
.copy-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,0.2); color: #fff; border: none; border-radius: 4px; padding: 4px 8px; font-size: 12px; cursor: pointer; transition: .3s; opacity: 0; }
.article-body pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--primary); }

.copyright-icon-area { display: flex; justify-content: flex-end; margin-bottom: 30px; position: relative; }
.copyright-icon-wrapper { width: 30px; height: 30px; border-radius: 50%; background: var(--bg-body); color: var(--text-meta); display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: .3s; position: relative; }
.copyright-icon-wrapper:hover { background: var(--primary); color: #fff; transform: rotate(360deg); }
.copyright-tooltip { position: absolute; bottom: 40px; right: 0; background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(5px); border: 1px solid var(--border); color: var(--text-main); padding: 15px; border-radius: 8px; width: 240px; font-size: 12px; opacity: 0; visibility: hidden; transition: .3s; box-shadow: var(--shadow); z-index: 10; text-align: left; transform: translateY(10px); }
.copyright-icon-wrapper:hover .copyright-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }

/* 互动 */
.action-bar { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; }
.btn-action { position: relative; padding: 8px 25px; border-radius: 20px; background: var(--bg-body); border: 1px solid var(--border); cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 500; transition: .3s; }
.like-btn.active { background: #ff6b6b; color: #fff; border-color: #ff6b6b; }
.like-count-num { margin-left: 5px; font-size: 12px; }
.like-plus-one { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-weight: bold; color: #ff6b6b; font-size: 16px; opacity: 0; pointer-events: none; transition: 0.8s ease-out; }
.like-plus-one.animate { top: -50px; opacity: 0; animation: floatUp 0.8s ease-out forwards; }
@keyframes floatUp { 0% { opacity: 1; transform: translate(-50%, -20px) scale(1); } 100% { opacity: 0; transform: translate(-50%, -50px) scale(1.5); } }
.share-popup { position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: #fff; padding: 10px; border-radius: 8px;width: 140px; box-shadow: 0 5px 20px rgba(0,0,0,0.15); border: 1px solid var(--border); display: none; z-index: 100; }
.share-popup.show { display: block; animation: fadeInUp 0.2s; }

/* 相关文章推荐 */
.related-posts { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); }
.related-title { font-size: 18px; font-weight: bold; margin-bottom: 20px; color: var(--text-main); }
.related-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; }
.related-item { display: block; text-decoration: none; group; }
.related-thumb { height: 100px; overflow: hidden; border-radius: 8px; margin-bottom: 8px; }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; transition: .3s; }
.related-item:hover .related-thumb img { transform: scale(1.1); }
.related-info h4 { font-size: 14px; line-height: 1.4; color: var(--text-main); margin: 0 0 5px; height: 40px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.related-info span { font-size: 12px; color: var(--text-meta); }

/* --- 8. 评论区 (iMessage Style - 修复版) --- */
.comments-section { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 30px; }
.com-section-title { font-size: 18px; font-weight: bold; margin-bottom: 20px; border-left: 4px solid var(--primary); padding-left: 10px; }
.comment-post-box { background: var(--bg-body); padding: 20px; border-radius: var(--radius); margin-bottom: 30px; }
.comment-inputs { display: flex; gap: 10px; margin-bottom: 10px; }
.comment-inputs input { flex: 1; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); outline: none; }
.comment-editor textarea { width: 100%; height: 100px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); resize: vertical; outline: none; box-sizing: border-box; }
.comment-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
#comment_submit { background: var(--primary); color: #fff; border: none; padding: 8px 25px; border-radius: 20px; cursor: pointer; }
.emoji-panel { display: none; background: var(--bg-card); padding: 10px; border: 1px solid var(--border); border-radius: 8px; position: absolute; z-index: 10; width: 300px; box-shadow: var(--shadow); flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.emoji-panel.show { display: flex; }
.emoji-item { cursor: pointer; font-size: 20px; padding: 5px; }

/* 评论列表 */
.comment-list { margin-top: 30px; }
.comment-item { display: flex; gap: 15px; margin-bottom: 25px; }
.comment-avatar img { width: 40px; height: 40px; border-radius: 50%; background: #fff; padding: 2px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }
.comment-main { flex: 1; background: var(--bubble-bg); padding: 12px 15px; border-radius: 4px 18px 18px 18px; position: relative; transition: .3s; }

/* ▼▼▼ 评论头部布局核心修复 ▼▼▼ */
.comment-header { 
    display: flex; 
    align-items: center; /* 垂直居中 */
    margin-bottom: 6px; 
    flex-wrap: wrap;
    gap: 8px; /* 元素间距 */
}
.comment-user { 
    font-weight: bold; 
    font-size: 14px; 
    color: var(--text-main); 
}
.comment-date { 
    font-size: 12px; 
    color: var(--text-meta); 
    font-weight: normal; 
}
.comment-reply-link { 
    font-size: 12px; 
    color: var(--primary); 
    cursor: pointer; 
    opacity: 0.7; 
    margin-left: auto; /* 核心：把回复按钮推到最右边 */
}
/* ▲▲▲ 修复结束 ▲▲▲ */

.comment-reply-link:hover { opacity: 1; text-decoration: underline; }
.comment-content { font-size: 14px; color: var(--text-main); line-height: 1.6; }
.comment-children { margin-top: 10px; }
.comment-children .comment-item { margin-bottom: 10px; margin-left: 5px; }
.comment-children .comment-avatar img { width: 32px; height: 32px; }
.comment-children .comment-main { background: var(--bubble-bg-child); }

/* --- 9. 底部 --- */
.footer { background: var(--bg-card); color: var(--text-sec); padding: 40px 0; margin-top: 40px; text-align: center; border-top: 1px solid var(--border); width: 100%; box-sizing: border-box; }
#footer-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.back-to-top { position: fixed; bottom: 40px; right: 40px; width: 40px; height: 40px; background: var(--bg-card); border: 1px solid var(--border); color: var(--text-sec); border-radius: 30%; cursor: pointer; opacity: 0; visibility: hidden; transition: .3s; z-index: 99; display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
.footer-links-box { margin-bottom: 30px; }
.footer-links-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; padding-left: 15px; }
.friend-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
.friend-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 10px; display: flex; align-items: center; gap: 10px; transition: .3s; height: 30px; position: relative; overflow: hidden; }
.friend-card.has-bg { background-size: cover !important; background-position: center !important; border: none; }
.friend-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 1; opacity: 0; transition: .3s; }
.friend-card.has-bg .friend-overlay { opacity: 1; }
.friend-content { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; width: 100%; }
.friend-card.has-bg .friend-name { color: #fff !important; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.friend-icon-placeholder { width: 30px; height: 30px; background: var(--primary); color: #fff; text-align: center; line-height: 30px; border-radius: 50%; font-size: 12px; flex-shrink: 0; }
.friend-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.friend-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.toc-container { background: var(--bg-card); padding: 15px; border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 20px; }
.toc-title { font-weight: bold; margin-bottom: 10px; font-size: 14px; border-bottom: 1px solid var(--border); padding-bottom: 5px; }
.toc-list li { padding: 4px 0; font-size: 13px; line-height: 1.5; }
.toc-list li a { color: var(--text-sec); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-list li a:hover { color: var(--primary); }
.toc-level-1 { padding-left: 0; font-weight: 600; }
.toc-level-2 { padding-left: 10px; }
.toc-level-3 { padding-left: 20px; color: var(--text-meta); }

/* --- 10. 移动端适配 --- */
.mobile-drawer-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; opacity: 0; visibility: hidden; transition: .3s; backdrop-filter: blur(2px); }
.mobile-drawer { position: fixed; top: 0; right: -300px; width: 280px; height: 100%; background: var(--bg-card); z-index: 1001; transition: cubic-bezier(0.4, 0, 0.2, 1) 0.3s; box-shadow: -5px 0 20px rgba(0,0,0,0.1); display: flex; flex-direction: column; visibility: hidden; }
.mobile-drawer.active { right: 0; visibility: visible; }
.mobile-drawer-mask.active { opacity: 1; visibility: visible; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; padding: 20px; background: linear-gradient(135deg, var(--primary), #a29bfe); color: #fff; }
.drawer-title { font-size: 18px; font-weight: bold; }
.drawer-close { font-size: 24px; cursor: pointer; opacity: 0.8; }
.mobile-menu { padding: 10px 0; overflow-y: auto; flex: 1; }
.mobile-menu li { display: block; padding: 0 15px; }
.mobile-menu li a { display: flex; align-items: center; justify-content: space-between; padding: 12px 15px; font-size: 15px; color: var(--text-main); border-radius: 8px; margin-bottom: 5px; }
.mobile-menu li a:hover, .mobile-menu li.active a { background: rgba(78, 140, 255, 0.1); color: var(--primary); }
.drawer-footer { padding: 20px; border-top: 1px solid var(--border); text-align: center; color: var(--text-meta); font-size: 12px; }

@media(max-width:768px) {
    .layout-grid { grid-template-columns: 1fr; margin-top: 15px; }
    .sidebar { display: none !important; }
    .nav-menu, .search-form, .toc-container { display: none; }
    .mobile-menu-toggle { display: block; }
    .list-header-card { padding: 12px; }
    .notice-bar span { display: none; }
    .notice-bar .notice-icon { margin: 0; font-size: 20px; }
    .announcement-inline-box { margin: 0 5px; }
    .post-grid { grid-template-columns: 1fr !important; gap: 15px; }
    .post-card { height: auto; }
    .post-cover { height: 180px; width: 100%; }
    .post-grid.list-view .post-card { flex-direction: row !important; height: auto !important; min-height: 110px; align-items: stretch; }
    .post-grid.list-view .post-cover { width: 110px !important; height: auto !important; min-height: 110px; flex-shrink: 0; }
    .post-grid.list-view .post-body { padding: 10px 12px; width: calc(100% - 110px); justify-content: space-between; }
    .post-grid.list-view .post-title { font-size: 15px; margin-bottom: 5px; line-height: 1.3; max-height: 40px; overflow: hidden; }
    .post-grid.list-view .post-excerpt { display: none; }
    .post-grid.list-view .post-meta { padding-top: 0; border-top: none; font-size: 11px; }
    .single-content-wrapper { padding: 15px; }
    .article-title { font-size: 20px; }
    .article-meta { flex-wrap: wrap; gap: 8px; justify-content: flex-start; }
    .comment-item { flex-direction: row; }
    .emoji-panel { width: 90%; left: 5%; }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .footer { background: transparent !important; box-shadow: none !important; border-top: none !important; margin-top: 20px !important; padding: 30px 0 20px 0 !important; }
    .footer-links-box { display: none !important; }
    .footer-inner .copyright { font-size: 12px !important; color: var(--text-meta) !important; opacity: 0.8; }
    .footer-inner .copyright a { border-bottom: 1px dashed transparent; }
}

/* ==========================================================================
   ▼▼▼ 11. 原生灯箱样式 (Theme Lightbox) ▼▼▼
   ========================================================================== */
#theme-lightbox {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95); z-index: 99999; /* 确保层级最高 */
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    cursor: zoom-out;
}
#theme-lightbox.active { opacity: 1; visibility: visible; }
.lightbox-image {
    max-width: 95vw; max-height: 95vh;
    border-radius: 4px; box-shadow: 0 5px 30px rgba(0,0,0,0.5);
    transform: scale(0.9); transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1);
    object-fit: contain;
}
#theme-lightbox.active .lightbox-image { transform: scale(1); }