/* ==========================================================================
   Sunrise Theme Style - Ver 9.5
   ========================================================================== */

: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;
}

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);
}

/* --- 基础样式 --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: 0.3s;
    overflow-x: hidden;
}

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; }

/* --- 导航栏 --- */
.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 { 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; }
.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); }
.dark-mode-toggle { font-size: 20px; cursor: pointer; color: var(--text-sec); }

/* --- 全局布局 --- */
.layout-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
    margin-top: 25px;
    margin-bottom: 50px;
}
.single-layout { align-items: flex-start; }

/* --- 首页列表头 (切换按钮) --- */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
.notice-bar { font-size: 15px; font-weight: bold; color: var(--text-sec); display: flex; align-items: center; gap: 5px; }
.layout-toggle { display: flex; gap: 10px; }
.toggle-btn { cursor: pointer; color: var(--text-meta); transition: .2s; font-size: 18px; }
.toggle-btn:hover, .toggle-btn.active { color: var(--primary); }

/* --- 文章列表 (网格模式 - 默认3列) --- */
.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: 150px; 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(197 197 197 / 60%); color: #fff;
    padding: 2px 8px; border-radius: 4px; font-size: 12px;
    backdrop-filter: blur(2px);
}
.post-body { padding: 15px; display: flex; flex-direction: column; flex: 1; }
.post-title { font-size: 16px; font-weight: bold; margin: 0 0 8px; line-height: 1.4; }
.post-excerpt {
    font-size: 12px; color: var(--text-sec);
    height: 40px; 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: 160px; }
.post-grid.list-view .post-cover { width: 240px; 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); }

/* --- 侧边栏组件 --- */
.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;
}
.widget ul li:last-child { border: none; }
.widget ul li a {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 80%;
}

/* 1. 个人资料卡片 */
.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;
}
.social-item:hover { color: #fff; }
.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); }

/* 2. 热门文章 (金银铜排行) */
.rank-badge {
    flex-shrink: 0; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; color: #999; border-radius: 4px;
    background: #f5f5f5; font-weight: bold;
}
.rank-1 { color: #fff !important; background: #f1c40f !important; }
.rank-2 { color: #fff !important; background: #bdc3c7 !important; }
.rank-3 { color: #fff !important; background: #d35400 !important; }
.widget-hot ul li { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.widget-hot ul li a { display: flex; align-items: center; gap: 10px; width: 100%; color: var(--text-sec); }
.hot-info { display: flex; justify-content: space-between; width: 100%; }
.hot-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.hot-views { font-size: 12px; color: var(--text-meta); display: flex; align-items: center; gap: 3px; }

/* 3. 分类目录 (悬停渐变) */
.widget-categories ul li { border-bottom: 1px dashed var(--border); padding: 5px 0; }
.widget-categories ul li a {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 12px; border-radius: 6px; color: var(--text-sec);
    transition: .3s; font-size: 14px; background: var(--bg-body);
}
.widget-categories ul li a:hover {
    background: linear-gradient(90deg, var(--primary), #a29bfe);
    color: #fff !important; transform: translateX(5px);
}
.cat-count {
    background: rgba(0,0,0,0.05); padding: 2px 8px;
    border-radius: 10px; font-size: 12px; transition: .3s;
}
.widget-categories ul li a:hover .cat-count { background: rgba(255,255,255,0.3); color: #fff; }

/* 4. 最新评论 (左右布局) */
.widget-comm ul li { margin-bottom: 12px; display: block; border: none; padding: 0; }
.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; }

/* 5. 最新文章 */
.widget-newlog ul li { display: flex; align-items: center; gap: 8px; padding: 8px 0; }
.widget-newlog ul li a { display: flex; align-items: center; gap: 8px; color: var(--text-sec); transition: .3s; width: 100%; }
.widget-newlog ul li a:hover { color: var(--primary); transform: translateX(5px); }
.widget-newlog .dot { width: 6px; height: 6px; border-radius: 50%; background: #dcdfe6; /* 初始单色 */ flex-shrink: 0; transition: all 0.3s ease; }

/* hover时的动态效果 */
.widget-newlog .dot:hover { background: linear-gradient(135deg, #c976e6 0%, #f871a0 100%); transform: translateX(2px) scale(1.2);}

/* 6. 标签云 */
.tag-list { 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; }

/* --- 文章详情页 --- */
.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; 
    transition: .3s; cursor: pointer;
}
/* 分类标签悬停特效 */
.article-cat-tag:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(78, 140, 255, 0.4);
    filter: brightness(1.1);
}
.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;
}
.article-body { font-size: 16px; line-height: 1.8; margin-bottom: 30px; }
.article-body img { border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); max-width: 100%; margin: 15px 0; }
.article-body pre {
    background: #282c34 !important; color: #abb2bf !important;
    border-radius: 8px; padding: 15px;
    font-family: Consolas, monospace; overflow: auto;
    text-shadow: none !important;
}

/* --- 版权图标 --- */
.copyright-icon-area { display: flex; justify-content: flex-end; margin-bottom: 40px; 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: 45px; right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    color: var(--text-main); padding: 15px; border-radius: 8px; width: 220px;
    font-size: 12px; opacity: 0; visibility: hidden; transition: .3s;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15); z-index: 10;
    text-align: left; border: 1px solid var(--border);
    transform: translateY(10px);
}
.copyright-icon-wrapper:hover .copyright-tooltip { opacity: 1; visibility: visible; transform: translateY(0); }
.copyright-tooltip p { margin: 4px 0; color: var(--text-sec); }

/* --- 互动按钮 & 点赞+1动画 --- */
.action-bar { display: flex; justify-content: center; gap: 20px; margin-bottom: 40px; }
.btn-action {
    position: relative; padding: 10px 20px;
    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; }
.share-btn:hover { color: #2ecc71; border-color: #2ecc71; }
.like-count-num { margin-left: 5px; font-size: 12px; }

/* +1 动画关键帧 */
.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: 60%;
    box-shadow: 0 10px 25px 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; }
.share-popup img { display: block; }

/* --- 评论区 --- */
.comments-section { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 30px; clear: both; overflow: hidden; }
.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: 40px; }
.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: 97%; height: 100px; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); resize: vertical; outline: none; }
.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: 30px; height: 30px; border-radius: 12px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
.comment-main { flex: 1; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.comment-header { display: flex; align-items: center; margin-bottom: 8px; }
.comment-user { font-weight: bold; font-size: 14px; margin-right: 10px; color: var(--text-main); }
.comment-date { font-size: 12px; color: var(--text-meta); }
.comment-reply-link { margin-left: auto; font-size: 12px; color: var(--primary); cursor: pointer; }
.comment-content { font-size: 14px; color: var(--text-sec); line-height: 1.6; }
.comment-children { margin-top: 15px; padding-left: 15px; border-left: 3px solid var(--border); }
.comment-item.child .comment-avatar img { width: 36px; height: 36px; border-radius: 8px; }

/* --- 友链 --- */
.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: 30%; 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); }

/* --- 页脚 --- */
.footer {
    background: var(--bg-card); color: var(--text-sec);
    padding: 40px 0; margin-top: 40px; position: relative; text-align: center;
    border-top: 1px solid var(--border); width: 100%; box-sizing: border-box;
}
#footer-canvas { position: absolute !important; 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;
     color: #fff; text-align: center; line-height: 40px;
    border-radius: 30%; cursor: pointer; opacity: 0; visibility: hidden;
    transition: .3s; z-index: 99;
}
.back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* --- TOC 悬浮目录 --- */
.toc-container {
    background: var(--bg-card); padding: 15px; border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 20px;
    position: fixed; top: 520px;
}
.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); }

/* --- 移动端适配 --- */
@media(max-width:768px) {
    .layout-grid { grid-template-columns: 1fr; }
    .post-grid { grid-template-columns: 1fr; }
    .post-grid.list-view .post-card { flex-direction: column !important; height: auto !important; }
    .post-grid.list-view .post-cover { width: 100% !important; height: 180px !important; }
    .nav-menu { display: none; }
    .friend-links-grid { grid-template-columns: repeat(2, 1fr); }
    .toc-container { display: none; }
}
/* ================= 公告栏样式修复 ================= */
.announcement-bar {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 20px; /* 确保与下方最新动态有间距 */
    padding: 12px 20px;
    display: flex;
    align-items: center;
    border: 1px solid var(--border); /* 增加边框增强质感 */
    position: relative;
    overflow: hidden;
}

.announcement-bar a {
    display: flex;
    align-items: center;
    width: 100%;
    color: var(--text-main);
    text-decoration: none;
}

.announcement-icon {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: bold;
    color: #ff6b6b; /* 醒目的红色 */
    margin-right: 15px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 15px;
    border-right: 1px solid var(--border); /* 图标与文字的分隔线 */
}

.announcement-content-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 24px; /* 固定高度 */
}

.announcement-text-scroll {
    white-space: nowrap;
    position: absolute;
    line-height: 24px;
    font-size: 14px;
    color: var(--text-sec);
    animation: marquee 15s linear infinite;
    display: inline-block;
    padding-left: 100%; /* 从最右侧开始滚动 */
}

/* 鼠标悬停时暂停滚动 */
.announcement-bar:hover .announcement-text-scroll {
    animation-play-state: paused;
}

@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* ... 原有 CSS 保持不变 ... */

/* --- 列表头工具栏 --- */
.list-header-card { 
    border-radius: var(--radius); 
    margin-bottom: 20px; 
    box-shadow: var(--shadow); 
}

.list-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px; /* 元素间距 */
    height: 40px;
}

/* 左侧标题 */
.notice-bar { 
    font-size: 15px; 
    font-weight: bold; 
    color: var(--text-sec); 
    display: flex; 
    align-items: center; 
    gap: 5px; 
    white-space: nowrap; /* 防止换行 */
}
.notice-icon { color: var(--primary); margin-right: 5px; }

/* 中间公告 (核心修复) */
.announcement-inline-box {
    flex: 1; /* 占据中间剩余空间 */
    background: var(--bg-body);
    border-radius: 20px;
    padding: 5px 15px;
    border: 1px solid var(--border);
    overflow: hidden;
    max-width: 100%;
}
.announcement-inline-box a {
    display: flex;
    align-items: center;
    color: var(--text-sec);
    text-decoration: none;
    font-size: 13px;
}
.ann-icon {
    color: #ff6b6b;
    font-size: 16px;
    margin-right: 8px;
    animation: shake 2s infinite;
}
.ann-text-wrapper {
    flex: 1;
    overflow: hidden;
    height: 20px;
    position: relative;
}
.ann-text-scroll {
    white-space: nowrap;
    position: absolute;
    left: 0;
    animation: scrollText 15s linear infinite;
}
/* 鼠标悬停停止滚动 */
.announcement-inline-box:hover .ann-text-scroll {
    animation-play-state: paused;
}

@keyframes scrollText {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}
@keyframes shake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* 右侧切换按钮 */
.layout-toggle { 
    display: flex; 
    gap: 15px; 
    flex-shrink: 0; /* 防止被挤压 */
}
.toggle-btn { 
    cursor: pointer; 
    color: var(--text-meta); 
    transition: .2s; 
    font-size: 20px; 
    display: flex; 
    align-items: center; 
}
.toggle-btn:hover, .toggle-btn.active { 
    color: var(--primary); 
    transform: scale(1.1); 
}

/* 移动端适配公告 */
@media(max-width: 768px) {
    .list-toolbar {
        flex-wrap: wrap;
        height: auto;
    }
    .notice-bar { width: 100%; border-bottom: 1px dashed var(--border); padding-bottom: 10px; margin-bottom: 10px; }
    .announcement-inline-box { order: 3; width: 100%; margin-top: 10px; }
    .layout-toggle { margin-left: auto; }
}

/* ========================================
   自定义Widget样式 - 参考主题风格
   ======================================== */

/* === 1. 站内搜索 - 参考主题搜索框风格 === */
.widget-search-styled .styled-search-form {
    margin-top: 10px;
}

.styled-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: 10px;
    padding: 6px;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.styled-search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(78, 140, 255, 0.1);
}

.styled-search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-meta);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.3s;
}

.styled-search-wrapper:focus-within .styled-search-icon {
    color: var(--primary);
}

.styled-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 10px 10px 40px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
}

.styled-search-input::placeholder {
    color: var(--text-meta);
}

.styled-search-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: linear-gradient(90deg, var(--primary), #a29bfe);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.styled-search-btn:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(78, 140, 255, 0.3);
}

/* === 2. 归档 - 参考分类目录的渐变悬停风格 === */
.styled-archive-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.styled-archive-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-body);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-sec);
    transition: all 0.3s;
}

.styled-archive-item:hover {
    background: linear-gradient(90deg, var(--primary), #a29bfe);
    color: #fff !important;
    transform: translateX(5px);
}

.archive-icon-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(78, 140, 255, 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.styled-archive-item:hover .archive-icon-wrap {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.archive-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.archive-badge {
    background: rgba(0, 0, 0, 0.05);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s;
}

.styled-archive-item:hover .archive-badge {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* === 3. 友情链接 - 参考分类目录风格 === */
.styled-link-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.styled-link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-body);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-sec);
    transition: all 0.3s;
    position: relative;
}

.styled-link-item:hover {
    background: linear-gradient(90deg, var(--primary), #a29bfe);
    color: #fff !important;
    transform: translateX(5px);
}

.link-icon-wrap {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(78, 140, 255, 0.1);
    color: var(--primary);
    border-radius: 6px;
    font-size: 14px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.styled-link-item:hover .link-icon-wrap {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.link-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
}

.link-arrow-icon {
    font-size: 18px;
    opacity: 0;
    transition: all 0.3s;
}

.styled-link-item:hover .link-arrow-icon {
    opacity: 1;
}

/* === 移动端适配 === */
@media (max-width: 768px) {
    .styled-search-input {
        padding: 9px 9px 9px 38px;
        font-size: 13px;
    }
    
    .styled-search-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
    
    .styled-archive-item,
    .styled-link-item {
        padding: 9px 10px;
    }
    
    .archive-icon-wrap,
    .link-icon-wrap {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .archive-text,
    .link-text {
        font-size: 13px;
    }
}


/* ========================================
   美化站内搜索样式
   ======================================== */

.widget-search-beautiful .beautiful-search-form {
    margin-top: 10px;
}

.beautiful-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-body);
    border-radius: 10px;
    padding: 6px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.beautiful-search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(78, 140, 255, 0.1);
}

.beautiful-search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-meta);
    font-size: 16px;
    pointer-events: none;
    transition: color 0.3s ease;
}

.beautiful-search-wrapper:focus-within .beautiful-search-icon {
    color: var(--primary);
}

.beautiful-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 10px 10px 40px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
}

.beautiful-search-input::placeholder {
    color: var(--text-meta);
}

.beautiful-search-btn {
    width: 38px;
    height: 38px;
    border: none;
    background: linear-gradient(90deg, var(--primary), #a29bfe);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.beautiful-search-btn:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(78, 140, 255, 0.3);
}

.beautiful-search-btn:active {
    transform: translateX(1px) scale(0.95);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .beautiful-search-input {
        padding: 9px 9px 9px 38px;
        font-size: 13px;
    }
    
    .beautiful-search-btn {
        width: 36px;
        height: 36px;
        font-size: 15px;
    }
}
