/* 左侧栏 · 互动区 · 评论区 · 右侧栏 */

/* 左侧栏子元素 */
.left-toggle { display: none; }
.left-panel { display: block; }
.left-profile { text-align: center; margin-bottom: 16px; }
/* 头像 + 花草光泽边框 */
.left-avatar-link { display: block; width: 160px; height: 160px; margin: 0 auto 10px; border-radius: 50%; overflow: hidden; padding: 4px; background: linear-gradient(135deg, #4f8a6b, #8db58e, #c2d3b9, #a8c9a5, #6b9e78, #4f8a6b); background-size: 300% 300%; animation: leafShimmer 4s ease infinite; }
.left-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
@keyframes leafShimmer { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.left-poem { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.left-name-link { text-decoration: none; color: inherit; } .left-name { font-size: 1.05rem; font-weight: 700; margin: 4px 0; }
.left-bio { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 6px; }
.left-bio a { color: var(--accent); text-decoration: none; }
.left-stats, .stat-label { font-size: 0.85rem; }
.left-stats {
    display: flex; justify-content: space-around;
    border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    padding: 10px 0; margin-bottom: 12px;
}
.stat-item { text-align: center; }
.stat-num { font-size: 1.1rem; font-weight: 700; color: var(--accent); display: block; }
.stat-label { font-size: 0.68rem; color: var(--text-secondary); }
.left-comments h4 { font-size: 0.78rem; margin-bottom: 8px; }
.left-comment-item {
    padding: 4px 0; font-size: 0.72rem; border-bottom: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.lc-author { font-weight: 600; color: var(--accent); flex-shrink: 0; white-space: nowrap; }
.lc-text { color: #555; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-link { font-size: 0.65rem; color: var(--accent); text-decoration: none; flex-shrink: 0; }

/* ===== 互动区 ===== */
.post-interact { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 28px; margin-top: 20px; box-shadow: var(--shadow-sm); }
.post-stats { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; font-size: 0.9rem; }
.like-btn {
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 20px;
    background: var(--surface); cursor: pointer; font-size: 0.85rem; transition: all 0.15s;
}
.like-btn:hover { border-color: var(--accent); background: var(--accent-light); }
.post-modified { font-size: 0.8rem; color: var(--text-secondary); }

/* ===== 文章控制栏 ===== */
.post-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0 16px; font-size: 0.82rem; }
.pc-left { display: flex; align-items: center; gap: 4px; }
.pc-center { display: flex; align-items: center; gap: 3px; }
.pc-right { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.comment-form input:focus, .comment-form textarea:focus { border-color: var(--accent); }
.comment-form button {
    align-self: flex-end; padding: 8px 20px; border: none; border-radius: 8px;
    background: var(--accent); color: #fff; font-size: 0.85rem; cursor: pointer; font-weight: 600;
}
.comment-form button:hover { background: #4f46e5; }
.comment-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.comment-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; font-size: 0.82rem; }
.comment-meta span { color: #999; font-size: 0.72rem; }
.comment-content {
    font-size: 0.9rem; line-height: 1.6; color: var(--text);
    white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word;
    max-width: 100%;
}
/* 评论截断 */
.comment-truncated {
    display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal;
}
.comment-truncated.expanded { display: block; white-space: pre-wrap; -webkit-line-clamp: unset; }
.comment-expand-btn {
    display: none; margin-top: 4px; background: none; border: none;
    color: var(--accent); font-size: 0.8rem; cursor: pointer; padding: 0;
    font-family: inherit;
}
.comment-expand-btn:hover { text-decoration: underline; }

/* ===== 文章右侧栏（fixed 居中浮动 + 边缘折叠按钮） ===== */
.article-sidebar { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 500; }
.aside-toggle {
    width: 38px; height: 38px; border: 1px solid var(--border); border-right: none;
    border-radius: 8px 0 0 8px; background: var(--surface); font-size: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); position: absolute; right: 0; top: 0;
}
.aside-toggle:hover { background: var(--accent-light); }
.aside-panel {
    display: none; position: absolute; right: 38px; top: 50%; transform: translateY(-50%);
    width: 280px; max-height: 70vh; overflow-y: auto; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius) 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md); padding: 16px 20px;
}
.article-sidebar.open .aside-panel { display: block; }
/* 侧栏内文章列表 */
.aside-panel h4 { font-size: 0.95rem; margin-bottom: 12px; color: var(--accent); }
.aside-item {
    display: flex; flex-direction: column; padding: 8px 0;
    border-bottom: 1px solid var(--border); text-decoration: none;
    color: var(--text); font-size: 0.88rem; gap: 2px;
}
.aside-item:last-child { border-bottom: none; }
.aside-item:hover { color: var(--accent); }
.aside-active { background: var(--accent-light); border-radius: 6px; padding-left: 8px; font-weight: 600; }
.aside-title { flex: 1; word-break: break-word; }
.aside-date { color: var(--text-secondary); font-size: 0.72rem; flex-shrink: 0; }

/* 赞助面板保持 style.css 的 fixed 样式（此处不覆盖） */

/* ===== 页面三栏布局（弹性宽度） ===== */
.page-wrapper {
    display: flex; justify-content: center; gap: 20px;
    max-width: 1280px; margin: 0 auto; padding: 0 20px;
    min-height: 60vh;
}
.left-sidebar {
    flex: 0 1 260px; min-width: 180px; max-width: 300px;
    position: sticky; top: 70px; align-self: flex-start;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-sm);
    padding: 16px; max-height: 85vh; overflow-y: auto;
}
.page-main { flex: 1 1 700px; min-width: 380px; max-width: 900px; }
.page-right {
    flex: 0 1 260px; min-width: 120px; max-width: 300px;
}
.page-right:not(.has-content) { visibility: hidden; }

/* 文章右侧图片 */
.page-right.has-content {
    position: sticky; top: 70px; align-self: flex-start;
    max-height: 85vh; overflow-y: auto;
}
.post-images {
    display: flex; flex-direction: column; gap: 12px;
}
.post-side-image {
    width: 100%; height: auto; border-radius: 8px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    display: block;
    transition: transform 0.2s;
}
.post-side-image:hover { transform: scale(1.03); }
/* 缩略图矩阵 */
.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.thumb-item { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; cursor: pointer; border: 1px solid var(--border); transition: transform 0.15s; }
.thumb-item:hover { transform: scale(1.08); border-color: var(--accent); }
.thumb-more { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; background: var(--accent-light); border-radius: 4px; cursor: pointer; font-size: 1.2rem; font-weight: 700; color: var(--accent); border: 1px dashed var(--accent); transition: background 0.15s; }
.thumb-more:hover { background: var(--accent); color: #fff; }
/* PDF 内嵌阅读器 */
.pdf-embed { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 16px 0; }
.pdf-toolbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #f8fafc; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.pdf-frame { border: none; display: block; width: 100%; min-height: 500px; }
/* 全图弹窗 */
.img-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; overflow-y: auto; display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; }
.img-overlay-close { position: fixed; top: 16px; right: 24px; color: #fff; font-size: 1.8rem; cursor: pointer; z-index: 10000; }

/* 响应式：窗口太窄时堆叠 + 底部横向滚动兜底 */
@media (max-width: 860px) {
    body { overflow-x: auto; }
    .page-wrapper { flex-wrap: wrap; min-width: 860px; }
    .left-sidebar { flex: 0 0 180px; }
    .page-main { flex: 1 1 400px; }
}

/* ===== 分类树形下拉 ===== */
.dropdown-menu { min-width: 200px; max-height: 60vh; overflow-y: auto; }
.dd-all { display: block; padding: 7px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.tree-row { display: flex; align-items: center; margin: 0; padding: 0; }
.tree-arrow {
    cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; user-select: none;
    font-size: 1.1rem; color: var(--text-secondary);
    border-radius: 3px; margin-right: 2px; flex-shrink: 0;
}
.tree-arrow:hover { background: var(--accent-light); color: var(--accent); }
.tree-arrow.empty { display: none; }
.tree-link {
    flex: 1; display: block; padding: 5px 8px; font-size: 0.84rem;
    color: var(--text); text-decoration: none; border-radius: 4px;
}
.tree-link:hover { background: var(--accent-light); color: var(--accent); }
.tree-sub { display: none; }
.tree-l1 { font-weight: 600; font-size: 0.85rem !important; }
.tree-l2 { padding-left: 18px !important; font-size: 0.8rem !important; }
.tree-l3 { padding-left: 36px !important; font-size: 0.76rem !important; color: var(--text-secondary) !important; }

/* ===== 搜索技巧卡片 ===== */
.search-tips {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 20px; box-shadow: var(--shadow-sm);
    margin-bottom: 32px; font-size: 0.85rem; line-height: 1.8;
}
.search-tips strong { color: var(--accent); }
.tips-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; margin-top: 6px; line-height: 1.7; font-size: 0.82rem; }
.search-tips code {
    background: var(--accent-light); padding: 1px 6px; border-radius: 4px;
    font-size: 0.82em; color: var(--accent);
}

.gear-btn { background: none; border: none; cursor: pointer; font-size: 1.2rem; padding: 4px; border-radius: 6px; }
.gear-btn:hover { background: var(--accent-light); }
.settings-panel { position: fixed; top: 60px; right: 16px; z-index: 1000; }
.settings-inner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 16px 20px; min-width: 280px; }
.setting-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.setting-row:last-child { border-bottom: none; }
.setting-row button { padding: 4px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); cursor: pointer; font-size: 0.8rem; }
.setting-row select { padding: 4px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 0.82rem; outline: none; }
/* 文章列表控制栏 */
.post-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; margin-bottom: 12px; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.pc-left, .pc-center, .pc-right { display: flex; align-items: center; gap: 4px; }

/* 搜索页头部背景框 */
.search-header-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 20px; margin: 32px 0 20px; box-shadow: var(--shadow-sm); }
.search-controls { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.sc-row { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 0.82rem; }

.shb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }

.font-btn { padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); cursor: pointer; font-size: 0.75rem; font-family: inherit; }
.setting-row button.setting-active { background: var(--accent) !important; color: #fff !important; border-color: var(--accent) !important; }
