* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.header {
    width: 100%;
    height: 60px;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}

.header-content {
    width: 1200px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
}

.logo img {
    width: 120px;
    height: auto;
}

.welcome-text {
    margin-left: 20px;
    color: #666;
    font-size: 14px;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
}

.nav-menu a:hover {
    color: #f00;
}

.main-content {
    padding: 20px 0;
    background-color: #f5f5f5;
}

.container {
    width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
}

.news-section {
    flex: 1;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}

.section-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f00;
}

.news-list {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.news-item {
    display: flex;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
}

.news-item:last-child {
    border-bottom: none;
}

.news-img {
    width: 180px;
    height: 120px;
    flex-shrink: 0;
}

.news-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.news-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    line-height: 1.5;
}

.news-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title a:hover {
    color: #1a73e8;
}

.news-excerpt {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 12px;
}

.news-meta {
    margin-top: auto;
    color: #999;
    font-size: 12px;
}

.news-meta span {
    margin-right: 15px;
}

.news-meta .comments {
    cursor: pointer;
}

.news-meta .comments:hover {
    color: #1a73e8;
}

.sidebar {
    width: 300px;
    background: #fff;
    padding: 20px;
    border-radius: 4px;
}

.hot-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.hot-img {
    width: 100px;
    height: 75px;
    overflow: hidden;
}

.hot-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-info {
    flex: 1;
}

.hot-title {
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 5px;
}

.hot-info .time {
    color: #999;
    font-size: 12px;
}

/* 轮播图样式 */
.slider {
    position: relative;
    width: 100%;
    height: 400px;
    margin-bottom: 20px;
    overflow: hidden;
    border-radius: 4px;
}

.slider-items {
    position: relative;
    height: 100%;
}

.slider-item {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slider-item.active {
    opacity: 1;
}

.slider-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slider-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 16px;
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 8px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.dot.active {
    background: #fff;
}

/* 搜索框样式优化 */
.search-box {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.search-wrapper:hover,
.search-wrapper:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26,115,232,0.1);
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    padding: 12px 45px 12px 16px;
    font-size: 14px;
    color: #333;
    outline: none;
    width: 100%;
}

.search-input::placeholder {
    color: #999;
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.search-btn:hover {
    background: rgba(26,115,232,0.1);
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: #1a73e8;
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding: 0 8px;
}

.tag {
    padding: 4px 12px;
    background: #f0f0f0;
    border-radius: 14px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag:hover {
    background: #e8f0fe;
    color: #1a73e8;
}

/* 确保搜索框在移动端也能正常显示 */
@media (max-width: 768px) {
    .search-wrapper {
        flex-direction: row;
    }
    
    .search-tags {
        justify-content: flex-start;
    }
}

/* 调整左侧内容区域结构 */
.left-content {
    flex: 1;
}

/* 确保container的样式保持不变 */
.container {
    width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 20px;
}

/* 分类导航样式 */
.category-nav {
    background: #fff;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
    padding: 0;
}

.nav-list li {
    margin: 0;
    padding: 0;
}

.nav-list a {
    text-decoration: none;
    color: #666;
    font-size: 14px;
    padding: 6px 15px;
    display: block;
    transition: all 0.3s ease;
}

.nav-list a:hover {
    color: #1a73e8;
}

/* 导航菜单激活状态 */
.nav-list a.active {
    color: #fff;
    background: #1a73e8;
    border-radius: 15px;
}

.nav-list a.active:hover {
    color: #fff;
}

/* 返回顶部按钮样式 */
.back-to-top {
    position: fixed;
    right: 50px;
    bottom: 50px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    display: none; /* 初始隐藏 */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.back-to-top:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.top-icon {
    width: 24px;
    height: 24px;
    fill: #666;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .nav-list {
        flex-direction: column;
        padding: 10px 0;
    }
    
    .nav-list li {
        width: 100%;
    }

    .nav-list a {
        padding: 12px 20px;
        border-bottom: 1px solid #eee;
    }
    
    .back-to-top {
        right: 20px;
        bottom: 20px;
    }
}

/* 底部样式优化 */
.footer {
    width: 100%;
    background: #fff;
    padding: 40px 0 20px;
    margin-top: 30px;
    border-top: 1px solid #eee;
}

.footer-content {
    width: 1200px;
    margin: 0 auto;
}

.footer-links {
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.links-title {
    color: #333;
    font-size: 14px;
    margin-bottom: 10px;
}

.links-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.links-list a {
    color: #666;
    font-size: 12px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.links-list a:hover {
    color: #1a73e8;
}

.footer-info {
    text-align: center;
}

.footer-info p {
    color: #999;
    font-size: 12px;
    line-height: 2;
}

.footer-info a {
    color: #666;
    text-decoration: none;
}

.footer-info a:hover {
    color: #1a73e8;
}

/* 文章链接样式 */
.img-link {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.img-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.img-link:hover img {
    transform: scale(1.05);
}

.title-link {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.news-title .title-link {
    font-size: 18px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hot-title .title-link {
    font-size: 14px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.title-link:hover {
    color: #1a73e8;
}

/* 平板端适配 (768px - 1200px) */
@media screen and (max-width: 1200px) {
    .container, .header-content, .footer-content {
        width: 95%;
        padding: 0 15px;
    }
    
    .news-section {
        margin-right: 15px;
    }
    
    .slider {
        height: 350px;
    }
}

/* 超小屏幕适配 (< 480px) */
@media screen and (max-width: 480px) {
    .logo img {
        width: 100px;
    }

    .welcome-text {
        font-size: 12px;
    }

    .slider {
        height: 160px;
    }

    .news-img {
        height: 160px;
    }

    .news-meta {
        font-size: 12px;
    }

    .news-excerpt {
        font-size: 13px;
    }

    .hot-img {
        width: 100px;
        height: 75px;
    }

    .search-input {
        font-size: 14px;
    }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
    }

    .header, .news-section, .category-nav, .sidebar, .footer {
        background: #2d2d2d;
    }

    .title-link, .links-title {
        color: #e0e0e0;
    }

    .news-excerpt, .news-meta span {
        color: #999;
    }

    .search-wrapper {
        background: #3d3d3d;
    }

    .search-input {
        color: #e0e0e0;
    }

    .search-input::placeholder {
        color: #888;
    }

    .back-to-top {
        background: #2d2d2d;
        border-color: #444;
    }

    .top-icon {
        fill: #e0e0e0;
    }
}