* { box-sizing: border-box; margin: 0; padding: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body { background-color: #f7f9fa; color: #333; overflow: hidden; }

.layout { display: flex; height: 100vh; }

/* 左侧边栏 */
.sidebar { width: 220px; background: #fff; border-right: 1px solid #e1e4e8; padding: 20px 0; }
.logo { font-size: 1.2rem; font-weight: bold; padding: 0 20px 20px; border-bottom: 1px solid #e1e4e8; margin-bottom: 20px; color: #d9534f; }
.sidebar ul { list-style: none; }
.sidebar li { padding: 12px 20px; cursor: pointer; color: #555; transition: background 0.2s; }
.sidebar li:hover, .sidebar li.active { background: #f0f4f8; color: #0056b3; border-right: 3px solid #0056b3; font-weight: 500; }

/* 中间列表 */
.list-pane { flex: 1; display: flex; flex-direction: column; background: #f7f9fa; transition: width 0.3s; }
.list-header { padding: 20px; background: #fff; border-bottom: 1px solid #e1e4e8; font-weight: bold; font-size: 1.1rem;}
.cards-container { padding: 20px; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; align-content: start; height: 100%;}

/* 卡片样式 */
.card { background: #fff; border: 1px solid #e1e4e8; border-radius: 8px; padding: 16px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column;}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 8px; line-height: 1.4; color: #1a1a1a; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-source { font-size: 0.8rem; color: #888; margin-bottom: 12px; }
.card-summary { font-size: 0.9rem; color: #555; line-height: 1.5; margin-bottom: 12px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex-grow: 1;}
.card-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eee; padding-top: 10px;}
.tag { font-size: 0.75rem; background: #e0e7ff; color: #4338ca; padding: 3px 8px; border-radius: 4px; }
.date { font-size: 0.75rem; color: #999; }

/* 右侧详情 */
.detail-pane { width: 0; background: #fff; border-left: 1px solid #e1e4e8; overflow-y: auto; transition: width 0.3s ease; display: flex; flex-direction: column; }
.detail-pane.open { width: 45%; } /* 打开时占据右侧一半多一点 */
.detail-header { padding: 15px 20px; border-bottom: 1px solid #e1e4e8; display: flex; justify-content: space-between; align-items: center;}
.detail-header button { border: none; background: transparent; cursor: pointer; color: #666; font-size: 1rem; }
.detail-header button:hover { color: #000; }
.detail-content { padding: 30px; }
.detail-content h1 { font-size: 1.5rem; margin-bottom: 10px; line-height: 1.4; }
.meta-info { margin-bottom: 20px; font-size: 0.9rem; color: #666; display: flex; gap: 15px;}
.keyword-tags { margin-bottom: 20px; }
.keyword-tags span { display: inline-block; background: #f1f3f5; padding: 4px 10px; border-radius: 15px; font-size: 0.8rem; margin-right: 8px; margin-bottom: 8px; color: #495057;}
.detail-summary { background: #f8f9fa; border-left: 4px solid #adb5bd; padding: 15px; margin-bottom: 20px; font-size: 0.95rem; line-height: 1.6; color: #333;}
.original-link { display: inline-block; margin-top: 20px; padding: 10px 20px; background: #0056b3; color: white; text-decoration: none; border-radius: 5px; font-size: 0.9rem;}
.original-link:hover { background: #004494; }

/* 搜索框样式 */
.list-header { display: flex; justify-content: space-between; align-items: center; }
.search-box { display: flex; gap: 8px; }
.search-box input { padding: 6px 12px; border: 1px solid #e1e4e8; border-radius: 4px; outline: none; font-size: 0.9rem; width: 200px; transition: border-color 0.2s;}
.search-box input:focus { border-color: #0056b3; }
.search-box button { padding: 6px 15px; background: #0056b3; color: white; border: none; border-radius: 4px; cursor: pointer; transition: background 0.2s; }
.search-box button:hover { background: #004494; }

/* 调整卡片容器高度，为底部分页留出空间 */
.cards-container { flex: 1; height: auto; margin-bottom: 0; }

/* 分页组件样式 */
.pagination { padding: 15px 20px; display: flex; justify-content: center; align-items: center; gap: 8px; border-top: 1px solid #e1e4e8; background: #fff; }
.page-btn { padding: 6px 12px; border: 1px solid #e1e4e8; background: #fff; cursor: pointer; border-radius: 4px; color: #555; transition: all 0.2s;}
.page-btn:hover:not(:disabled) { background: #f0f4f8; border-color: #c0c4c8; }
.page-btn.active { background: #0056b3; color: #fff; border-color: #0056b3; font-weight: bold;}
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-info { font-size: 0.85rem; color: #888; margin-left: 10px; }

/* 响应式手机端适配 */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar li { padding: 15px; text-align: center; font-size: 0; }
    .sidebar li::before { content: '●'; font-size: 1rem; }
    .logo { font-size: 0; padding: 15px; }
    .detail-pane.open { width: 100%; position: absolute; right: 0; height: 100vh; z-index: 10;}
}