/* =========================================================
   GreenFuture 主题 - 侧边栏模块
   分类树 / 联系卡片
   配合 fragments/gf/sidebar.html 使用（内页引用）
   ========================================================= */
.gf-sidebar { display: flex; flex-direction: column; gap: 24px; }
.gf-sidebar-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 24px;
    box-shadow: var(--shadow);
}
.gf-sidebar-card > h3 {
    font-size: 15px; font-weight: 800; color: var(--secondary);
    text-transform: uppercase; letter-spacing: 1px;
    padding-bottom: 12px; margin-bottom: 12px;
    border-bottom: 2px solid var(--bg);
    position: relative;
}
.gf-sidebar-card > h3::after {
    content: ''; position: absolute; bottom: -2px; left: 0;
    width: 40px; height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}
.gf-sidebar-cats > li > a {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 0; font-size: 14px; font-weight: 600; color: var(--secondary-light);
    border-bottom: 1px dashed var(--border);
}
.gf-sidebar-cats > li:last-child > a { border-bottom: none; }
.gf-sidebar-cats > li > a:hover { color: var(--primary); padding-left: 4px; }
.gf-sidebar-cats > li > a .count { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.gf-sidebar-subs { padding: 4px 0 8px 14px; }
.gf-sidebar-subs li a {
    display: block; padding: 5px 0; font-size: 13px; color: var(--text-muted);
}
.gf-sidebar-subs li a:hover { color: var(--primary); padding-left: 4px; }
.gf-sidebar-subs li a::before { content: '›'; margin-right: 6px; color: var(--primary); }

/* ===== 搜索卡片 ===== */
.gf-sidebar-search { display: flex; gap: 8px; }
.gf-sidebar-search input {
    flex: 1; min-width: 0; padding: 10px 14px;
    border: 1.5px solid var(--border); border-radius: 24px;
    font-size: 13px; background: var(--bg); transition: var(--transition);
}
.gf-sidebar-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.gf-sidebar-search button {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff; font-size: 14px; box-shadow: 0 4px 12px rgba(6,182,212,0.3);
    transition: var(--transition);
}
.gf-sidebar-search button:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(6,182,212,0.4); }

/* 当前分类高亮 */
.gf-sidebar-cats > li > a.active { color: var(--primary); }

/* ===== 最新新闻卡片（数据：recentNews；配合 fragments/gf/sidebar :: recentNews） ===== */
.gf-sidebar-news li a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.gf-sidebar-news li:first-child a { padding-top: 2px; }
.gf-sidebar-news li:last-child a { border-bottom: none; padding-bottom: 0; }
.gf-sidebar-news-img {
    width: 76px; height: 62px; flex-shrink: 0;
    border-radius: var(--radius-sm); overflow: hidden; background: var(--bg);
}
.gf-sidebar-news-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.gf-sidebar-news li a:hover .gf-sidebar-news-img img { transform: scale(1.08); }
.gf-sidebar-news-placeholder { display: flex; align-items: center; justify-content: center; color: var(--primary-light); }
.gf-sidebar-news-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gf-sidebar-news-title {
    font-size: 13.5px; font-weight: 600; color: var(--secondary-light); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.gf-sidebar-news li a:hover .gf-sidebar-news-title { color: var(--primary); }
.gf-sidebar-news-date { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); }
.gf-sidebar-news-date svg { color: var(--primary); flex-shrink: 0; }

/* 联系卡片 */
.gf-sidebar-contact p { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-muted); margin-bottom: 14px; word-break: break-all; }
.gf-sidebar-contact p span { font-size: 16px; }
.gf-sidebar-contact a:hover { color: var(--primary); }
.gf-sidebar-contact .btn-primary { display: block; text-align: center; margin-top: 8px; }

/* ===== 响应式（含侧边栏的内页共享：窄屏时卡片两列 → 单列） ===== */
@media (max-width: 1080px) {
    .gf-sidebar { display: grid; grid-template-columns: repeat(2, 1fr); align-items: start; }
}
@media (max-width: 640px) {
    .gf-sidebar { grid-template-columns: 1fr; }
}
