/* ============================================
   GitHub趋势网站 - 自定义样式
   ============================================ */

/* 基础 */
body {
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 导航栏 */
.navbar-brand {
    font-size: 1.3rem;
}

/* 统计卡片 */
.stat-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 12px;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.1) !important;
}

/* 仓库卡片 */
.repo-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 10px;
}

.repo-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.12) !important;
}

.repo-card .card-title a {
    color: #0969da;
}

.repo-card .card-title a:hover {
    text-decoration: underline !important;
}

/* 开发者卡片 */
.dev-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 10px;
}

.dev-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0,0,0,0.12) !important;
}

.dev-card .card-title a {
    color: #0969da;
}

.dev-card .card-title a:hover {
    text-decoration: underline !important;
}

/* 语言徽章颜色 */
.language-badge {
    color: #fff;
    font-weight: 500;
}

/* 时间线样式 */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #dee2e6;
}

.timeline-item {
    position: relative;
    margin-bottom: 20px;
}

.timeline-marker {
    position: absolute;
    left: -26px;
    top: 8px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px #dee2e6;
}

.timeline-content {
    margin-left: 10px;
}

/* 表格 */
.table th {
    font-weight: 600;
    border-top: none;
}

/* 页脚 */
footer {
    margin-top: auto;
}

/* 分页 */
.pagination .page-link {
    color: #0969da;
}

.pagination .page-item.active .page-link {
    background-color: #0969da;
    border-color: #0969da;
}

/* 加载动画 */
.spinner-border {
    vertical-align: middle;
}

/* 空状态 */
#emptyState i {
    opacity: 0.3;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .display-5 {
        font-size: 1.8rem;
    }

    .timeline {
        padding-left: 20px;
    }

    .timeline-marker {
        left: -18px;
        width: 12px;
        height: 12px;
    }
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 链接样式统一 */
a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* 按钮焦点 */
.btn:focus {
    box-shadow: none;
}

/* 输入框焦点 */
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(9, 105, 218, 0.25);
    border-color: #0969da;
}

/* 卡片头部 */
.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 500;
}

/* 列表项悬停 */
.list-group-item-action:hover {
    background-color: #f8f9fa;
}

/* 修复文字溢出 */
.repo-card .card-text,
.dev-card .card-text,
.timeline-content .card-text,
.list-group-item small.text-muted {
    word-break: break-word;
    overflow-wrap: break-word;
}

.repo-card .card-title {
    max-width: 100%;
    overflow: hidden;
}

/* 翻译文本样式 */
.translated-text {
    color: #0969da;
    font-size: 0.85em;
    border-left: 3px solid #0969da;
    padding-left: 8px;
    margin-top: 4px;
    background: rgba(9, 105, 218, 0.05);
    padding: 4px 8px;
    border-radius: 0 4px 4px 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.translated-text .badge {
    font-size: 0.7em;
    vertical-align: middle;
}

/* 搜索框 */
#globalSearch {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

#globalSearch::placeholder {
    color: rgba(255,255,255,0.6);
}

#globalSearch:focus {
    background-color: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    color: #fff;
    box-shadow: none;
}
