/* 乐子人新闻网站样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background-color: #1a1a1a;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 页面头部 */
.header {
    background-color: #1a1a1a;
    padding: 20px 0;
    border-bottom: 1px solid #333;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
}

.header .subtitle {
    text-align: center;
    font-size: 14px;
    color: #888;
}

/* 更新按钮 */
.update-section {
    text-align: center;
    padding: 30px 0;
    border-bottom: 1px solid #333;
}

.update-btn {
    background-color: #ff6b35;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.update-btn:hover {
    background-color: #e55a2b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.update-btn:active {
    transform: translateY(0);
}

.update-btn:disabled {
    background-color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 新闻列表 */
.news-section {
    padding: 40px 0;
}

.news-section h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 30px;
    color: #ffffff;
}

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.news-item {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    border: 1px solid #333;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.news-item:hover {
    background-color: #333;
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: #ff6b35;
}

.news-item .title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #888;
}

.news-item .time {
    color: #ff6b35;
}

/* 新闻详情页 */
.detail-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    color: #ff6b35;
    text-decoration: none;
    font-size: 16px;
    margin-bottom: 30px;
    transition: color 0.3s ease;
}

.back-btn:hover {
    color: #e55a2b;
}

.back-btn::before {
    content: '← ';
    margin-right: 5px;
}

.news-detail {
    background-color: #2a2a2a;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #333;
}

.news-detail .title {
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 15px;
    line-height: 1.3;
}

.news-detail .meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #444;
}

.news-detail .time {
    color: #ff6b35;
    font-size: 16px;
}

.news-detail .body {
    font-size: 16px;
    line-height: 1.8;
    color: #e0e0e0;
    white-space: pre-wrap;
}

.news-detail .body p {
    margin-bottom: 15px;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #888;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

.empty-state p {
    font-size: 16px;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #888;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #333;
    border-top: 2px solid #ff6b35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误状态 */
.error {
    background-color: #4a1a1a;
    color: #ff6b6b;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #ff6b6b;
}

/* 成功状态 */
.success {
    background-color: #1a4a1a;
    color: #6bff6b;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid #6bff6b;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .news-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .news-item {
        padding: 15px;
    }
    
    .news-item .title {
        font-size: 16px;
    }
    
    .detail-container {
        padding: 20px 15px;
    }
    
    .news-detail {
        padding: 20px;
    }
    
    .news-detail .title {
        font-size: 24px;
    }
    
    .update-btn {
        padding: 10px 25px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 20px;
    }
    
    .news-detail .title {
        font-size: 20px;
    }
    
    .news-detail .body {
        font-size: 14px;
    }
    
    .news-item .meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}