/* GitHub 今日头条 - 科技感样式 */

:root {
    --primary-color: #2ea44f;
    --secondary-color: #0366d6;
    --bg-dark: #0d1117;
    --bg-card: #161b22;
    --bg-hover: #21262d;
    --border-color: #30363d;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-purple: #bc8cff;
    --accent-orange: #f0883e;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.github-icon {
    width: 32px;
    height: 32px;
    color: var(--text-primary);
}

.logo h1 {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-refresh {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-refresh:hover {
    background: #2c974b;
    transform: translateY(-1px);
}

.btn-refresh svg {
    width: 16px;
    height: 16px;
}

.update-time {
    font-size: 13px;
    color: var(--text-secondary);
}

/* 主内容区 */
.main-content {
    padding: 32px 0;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(88, 166, 255, 0.1);
}

.stat-icon {
    font-size: 32px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-hover);
    border-radius: 12px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 板块网格 */
.sections-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 20px;
}

.section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.section:hover {
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.section-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-hover);
}

.section-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-icon {
    font-size: 18px;
}

.section-badge {
    background: var(--accent-green);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.section-content {
    padding: 16px;
    max-height: 700px;
    overflow-y: auto;
}

/* 项目列表 */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.project-item {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    transition: all 0.2s;
    cursor: pointer;
}

.project-item:hover {
    border-color: var(--accent-blue);
    background: var(--bg-hover);
    transform: translateX(4px);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.project-rank {
    background: var(--gradient-1);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--accent-blue);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
}

.project-language {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
}

.project-docker {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #0db7ed;
    font-weight: 500;
}

.language-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.language-dot.python { background: #3572A5; }
.language-dot.javascript { background: #f1e05a; }
.language-dot.typescript { background: #2b7489; }
.language-dot.go { background: #00ADD8; }
.language-dot.rust { background: #dea584; }
.language-dot.cpp { background: #f34b7d; }
.language-dot.java { background: #b07219; }
.language-dot.csharp { background: #178600; }
.language-dot.unknown { background: var(--text-secondary); }

.project-stars {
    font-size: 12px;
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-left: 40px;
}

/* 特点图表 */
.features-chart {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-bar {
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border-color);
}

.feature-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.feature-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.feature-count {
    font-size: 12px;
    color: var(--accent-blue);
    font-weight: 600;
}

.feature-progress {
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    overflow: hidden;
}

.feature-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.feature-fill.ai { background: var(--gradient-1); }
.feature-fill.tools { background: var(--gradient-2); }
.feature-fill.infra { background: var(--gradient-3); }
.feature-fill.business { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.feature-fill.other { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }

/* 趋势列表 */
.trends-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trend-item {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 14px;
    transition: all 0.2s;
}

.trend-item:hover {
    border-color: var(--accent-purple);
    transform: scale(1.02);
}

.trend-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.trend-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.trend-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* 加载动画 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-blue);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 页脚 */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
}

.footer p {
    font-size: 13px;
    color: var(--text-secondary);
}

.footer a {
    color: var(--accent-blue);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .sections-grid {
        grid-template-columns: 1fr;
    }
    
    .section-projects {
        order: 1;
    }
    
    .section-features {
        order: 2;
    }
    
    .section-trends {
        order: 3;
    }
    
    .section-content {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 12px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .logo h1 {
        font-size: 18px;
    }
    
    .github-icon {
        width: 28px;
        height: 28px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn-refresh {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .update-time {
        font-size: 11px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px;
    }
    
    .stat-icon {
        width: 48px;
        height: 48px;
        font-size: 24px;
    }
    
    .stat-value {
        font-size: 22px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .section-header h2 {
        font-size: 14px;
    }
    
    .section-icon {
        font-size: 16px;
    }
    
    .section-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .project-item {
        padding: 12px;
    }
    
    .project-rank {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    .project-name {
        font-size: 13px;
    }
    
    .project-stars {
        font-size: 11px;
    }
    
    .project-description {
        font-size: 12px;
        margin-left: 32px;
    }
    
    .feature-bar {
        padding: 10px;
    }
    
    .feature-name {
        font-size: 12px;
    }
    
    .feature-count {
        font-size: 11px;
    }
    
    .trend-item {
        padding: 12px;
    }
    
    .trend-icon {
        font-size: 20px;
    }
    
    .trend-title {
        font-size: 13px;
    }
    
    .trend-description {
        font-size: 11px;
    }
    
    .footer p {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 12px;
    }
    
    .section-content {
        max-height: 400px;
        padding: 12px;
    }
    
    .project-header {
        gap: 8px;
    }
    
    .project-description {
        margin-left: 0;
        margin-top: 6px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.project-item, .feature-bar, .trend-item {
    animation: fadeIn 0.4s ease-out;
}

/* 脉冲效果 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.section-badge {
    animation: pulse 2s ease-in-out infinite;
}
