/* 全局样式 */
:root {
    --primary-color: #1e88e5;
    --secondary-color: #ff8f00;
    --accent-color: #ffcc80;
    --text-color: #333;
    --light-text: #666;
    --bg-color: #f5f5f5;
    --card-bg: #fff;
    --border-color: #eaeaea;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* 头部样式 */
header {
    background-color: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 随机一言样式 */
.daily-quote {
    background-color: rgba(30, 136, 229, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: 15px 20px;
    margin: 15px 0 0;
    border-radius: 4px;
    font-style: italic;
    position: relative;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%; /* 确保宽度固定 */
}

.daily-quote:hover {
    background-color: rgba(30, 136, 229, 0.1);
}

.daily-quote:hover::after {
    content: '点击刷新';
    position: absolute;
    right: 10px;
    bottom: 5px;
    font-size: 12px;
    color: var(--primary-color);
    font-style: normal;
    opacity: 0.7;
}

.daily-quote i {
    color: var(--primary-color);
    opacity: 0.5;
    font-size: 14px;
    margin: 0 5px;
}

.quote-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.quote-text {
    font-size: 16px;
    color: var(--text-color);
    word-wrap: break-word;
    white-space: normal;
    line-height: 1.5;
    max-width: 90%;
}

.quote-author {
    font-size: 14px;
    color: var(--light-text);
    margin-top: 8px;
    text-align: right;
    font-style: normal;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 28px;
    font-weight: 700;
}

.slogan {
    color: var(--light-text);
    font-size: 14px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    padding: 8px 12px;
    border-radius: 4px;
    font-weight: 500;
}

nav ul li a.active {
    background-color: var(--primary-color);
    color: white;
}

/* 主内容区域 */
main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

.news-section {
    display: none;
    margin-bottom: 40px;
}

.news-section.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.news-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.update-time {
    font-size: 14px;
    color: var(--light-text);
    font-weight: normal;
}

/* 新闻网格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.news-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.news-card .image {
    height: 180px;
    overflow: hidden;
}

.news-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover img {
    transform: scale(1.05);
}

.news-card .content {
    padding: 15px;
}

.news-card h3 {
    margin-bottom: 10px;
    font-size: 18px;
    line-height: 1.4;
}

.news-card .meta {
    display: flex;
    justify-content: space-between;
    color: var(--light-text);
    font-size: 14px;
    margin-top: 10px;
}

/* 热榜列表 */
.hot-list {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.hot-item {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.hot-item:last-child {
    border-bottom: none;
}

.hot-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.hot-item .rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 15px;
    font-weight: bold;
    flex-shrink: 0;
}

.hot-item .rank.top-1 {
    background-color: #ff4d4f;
    color: white;
}

.hot-item .rank.top-2 {
    background-color: #ff7a45;
    color: white;
}

.hot-item .rank.top-3 {
    background-color: #ffa940;
    color: white;
}

.hot-item .rank.normal {
    background-color: #f0f0f0;
    color: var(--light-text);
}

.hot-item .content {
    flex-grow: 1;
}

.hot-item h3 {
    font-size: 16px;
    margin-bottom: 5px;
}

.hot-item .meta {
    display: flex;
    color: var(--light-text);
    font-size: 14px;
}

.hot-item .meta span {
    margin-right: 15px;
    display: flex;
    align-items: center;
}

.hot-item .meta i {
    margin-right: 5px;
    font-size: 12px;
}







/* 页脚 */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 30px 0 15px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
    color: var(--accent-color);
}

.footer-section p {
    margin-bottom: 10px;
    font-size: 14px;
}

.footer-section a {
    color: var(--accent-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* 加载动画 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 0;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(58, 92, 64, 0.2);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    header .container {
        flex-direction: column;
    }
    
    nav {
        margin-top: 15px;
        width: 100%;
        overflow-x: auto;
    }
    
    nav ul {
        width: max-content;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
}