/* ========== 基础样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --primary-dark: #2563eb;
    --secondary-color: #f59e0b;
    --text-dark: #1a1a1a;
    --text-medium: #4b5563;
    --text-light: #9ca3af;
    --bg-light: #f3f4f6;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --radius: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
}

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

/* ========== 导航栏 ========== */
.navbar {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 1.8rem;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-menu a {
    font-weight: 500;
    color: var(--text-medium);
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary-color);
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: var(--transition);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    width: 100%;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 200px;
    padding: 10px 40px 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    width: 250px;
}

.search-btn {
    position: absolute;
    right: 5px;
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px 10px;
}

.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-top: 5px;
    box-shadow: var(--shadow-lg);
    display: none;
    z-index: 1001;
}

.search-suggestions.show {
    display: block;
}

.user-actions {
    display: flex;
    gap: 10px;
}

.btn-login,
.btn-register {
    padding: 8px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-login {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-medium);
}

.btn-login:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-register {
    background: var(--primary-color);
    border: 1px solid var(--primary-color);
    color: white;
}

.btn-register:hover {
    background: var(--primary-dark);
}

/* ========== 轮播图 ========== */
.hero-section {
    padding: 20px 0;
}

.carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
    position: relative;
}

.carousel-item img {
    width: 100%;
    height: 500px;
    object-fit: cover;
}

.carousel-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 40px 40px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
}

.carousel-content .category-tag {
    display: inline-block;
    padding: 5px 15px;
    background: var(--primary-color);
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.carousel-content h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.carousel-content p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 20px;
    max-width: 600px;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-weight: 500;
    transition: var(--transition);
}

.read-more:hover {
    color: var(--secondary-color);
}

.read-more i {
    transition: var(--transition);
}

.read-more:hover i {
    transform: translateX(5px);
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(255, 255, 255, 0.4);
}

.carousel-prev {
    left: 20px;
}

.carousel-next {
    right: 20px;
}

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition);
}

.indicator.active {
    background: white;
    width: 30px;
    border-radius: 5px;
}

/* ========== 主内容区域 ========== */
.main-content {
    padding: 40px 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

/* 新闻板块通用样式 */
.news-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-light);
}

.section-header h3 {
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h3 i {
    color: var(--primary-color);
}

.view-all {
    color: var(--text-light);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
}

.view-all:hover {
    color: var(--primary-color);
}

/* 新闻网格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.news-grid .news-card.featured {
    grid-column: span 2;
    grid-row: span 2;
}

.news-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.news-image {
    position: relative;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

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

.news-image .category-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 12px;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    border-radius: 15px;
}

.news-content {
    padding: 15px;
}

.news-content h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.news-content p {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 10px;
}

.news-meta {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.news-meta i {
    margin-right: 5px;
}

/* 新闻列表 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.news-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--bg-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.news-item:hover {
    background: #e5e7eb;
}

.news-item.small {
    padding: 10px 0;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

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

.news-thumb {
    flex-shrink: 0;
}

.news-thumb img {
    width: 150px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--radius);
}

.news-info h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.news-info p {
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
}

.category.domestic {
    background: #dbeafe;
    color: #1e40af;
}

.category.international {
    background: #fce7f3;
    color: #9d174d;
}

/* 科技卡片 */
.news-grid.tech-grid {
    grid-template-columns: repeat(2, 1fr);
}

.tech-card {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.tech-card h4 {
    color: white;
    margin: 10px 0;
}

.tech-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    font-size: 0.75rem;
}

.tech-card .news-meta {
    color: rgba(255, 255, 255, 0.8);
}

/* 财经板块 */
.finance-header {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.stock-item {
    background: var(--bg-light);
    padding: 15px;
    border-radius: var(--radius);
    text-align: center;
}

.stock-name {
    display: block;
    font-size: 0.85rem;
    color: var(--text-medium);
    margin-bottom: 5px;
}

.stock-value {
    display: block;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.stock-change {
    font-size: 0.85rem;
}

.stock-item.up .stock-change {
    color: #10b981;
}

.stock-item.down .stock-change {
    color: #ef4444;
}

.finance-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.finance-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.finance-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.finance-title a {
    font-weight: 500;
}

.finance-title a:hover {
    color: var(--primary-color);
}

.finance-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.tag {
    display: inline-block;
    padding: 3px 10px;
    background: var(--bg-light);
    border-radius: 3px;
    font-size: 0.75rem;
}

.tag.red {
    background: #fee2e2;
    color: #dc2626;
}

.tag.green {
    background: #d1fae5;
    color: #059669;
}

/* 体育比赛 */
.sports-matches {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.match-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 15px;
    text-align: center;
}

.match-card.live {
    border: 2px solid #ef4444;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

.match-league {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.match-card.live .match-league {
    color: #ef4444;
    font-weight: 600;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.team img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.team span {
    font-size: 0.85rem;
    font-weight: 500;
}

.match-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.match-score .score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.match-score .time {
    font-size: 0.8rem;
    color: #ef4444;
    font-weight: 600;
}

.news-list.compact .news-item.small h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
}

.meta {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 娱乐板块 */
.ent-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.ent-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.ent-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.ent-image {
    position: relative;
}

.ent-image img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.ent-tag {
    position: absolute;
    bottom: 10px;
    left: 10px;
    padding: 3px 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    border-radius: 12px;
}

.ent-card h4 {
    font-size: 0.9rem;
    padding: 12px;
    line-height: 1.4;
}

/* ========== 侧边栏 ========== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-section {
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.sidebar-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--bg-light);
}

.sidebar-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-header h3 i {
    color: var(--primary-color);
}

/* 热榜 */
.hot-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hot-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rank {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-medium);
    flex-shrink: 0;
}

.rank.top {
    background: var(--primary-color);
    color: white;
}

.hot-item a {
    flex: 1;
    font-size: 0.9rem;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-item a:hover {
    color: var(--primary-color);
}

.heat {
    font-size: 0.75rem;
    color: #ef4444;
    flex-shrink: 0;
}

.heat i {
    margin-right: 3px;
}

/* 推荐订阅 */
.subscribe-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.subscribe-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: var(--radius);
    transition: var(--transition);
}

.subscribe-item:hover {
    background: #e5e7eb;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.subscribe-info {
    flex: 1;
}

.subscribe-info h4 {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.subscribe-info p {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 2px;
}

.followers {
    font-size: 0.75rem;
    color: var(--primary-color);
}

.btn-subscribe {
    padding: 6px 15px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-subscribe:hover {
    background: var(--primary-dark);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud .tag {
    padding: 5px 12px;
    background: var(--bg-light);
    border-radius: 15px;
    font-size: 0.85rem;
    transition: var(--transition);
}

.tag-cloud .tag:hover {
    background: var(--primary-color);
    color: white;
}

.tag-cloud .tag.large {
    font-size: 1rem;
    padding: 6px 15px;
}

.tag-cloud .tag.medium {
    font-size: 0.9rem;
}

/* ========== 页脚 ========== */
.footer {
    background: var(--text-dark);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: white;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 15px;
}

.footer-section ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-section ul li {
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-section ul li a {
    color: var(--text-light);
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-bottom a {
    color: var(--text-light);
    transition: var(--transition);
}

.footer-bottom a:hover {
    color: var(--primary-color);
}

/* ==================== 响应式设计 ==================== */

/* 平板端 (768px - 1024px) */
@media (max-width: 1024px) {
    .nav-menu {
        gap: 20px;
    }

    .search-box input {
        width: 150px;
    }

    .search-box input:focus {
        width: 180px;
    }

    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 平板竖屏 (768px以下) */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-center {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 80%;
        max-width: 300px;
        height: calc(100vh - 70px);
        background: var(--bg-white);
        box-shadow: var(--shadow-lg);
        transition: var(--transition);
        z-index: 999;
    }

    .nav-center.active {
        left: 0;
    }

    .nav-menu {
        flex-direction: column;
        padding: 20px;
        gap: 5px;
    }

    .nav-menu a {
        padding: 15px;
        width: 100%;
        border-radius: var(--radius);
    }

    .nav-menu a:hover,
    .nav-menu a.active {
        background: var(--bg-light);
    }

    .nav-menu a::after {
        display: none;
    }

    .search-box {
        display: none;
    }

    .user-actions {
        gap: 5px;
    }

    .btn-login,
    .btn-register {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .carousel-item img {
        height: 350px;
    }

    .carousel-content {
        padding: 40px 20px 20px;
    }

    .carousel-content h2 {
        font-size: 1.3rem;
    }

    .carousel-content p {
        font-size: 0.9rem;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .news-grid {
        grid-template-columns: 1fr;
    }

    .news-grid .news-card.featured {
        grid-column: span 1;
        grid-row: span 1;
    }

    .news-grid.tech-grid {
        grid-template-columns: 1fr;
    }

    .news-thumb img {
        width: 100px;
        height: 70px;
    }

    .finance-header {
        grid-template-columns: repeat(2, 1fr);
    }

    .sports-matches {
        grid-template-columns: 1fr;
    }

    .ent-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* 手机端 (480px以下) */
@media (max-width: 480px) {
    .nav-container {
        height: 60px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo i {
        font-size: 1.4rem;
    }

    .carousel-item img {
        height: 250px;
    }

    .carousel-content h2 {
        font-size: 1.1rem;
    }

    .carousel-content p {
        display: none;
    }

    .carousel-prev,
    .carousel-next {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }

    .carousel-prev {
        left: 10px;
    }

    .carousel-next {
        right: 10px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .news-section {
        padding: 15px;
    }

    .news-item {
        flex-direction: column;
    }

    .news-thumb img {
        width: 100%;
        height: 150px;
    }

    .finance-header {
        grid-template-columns: 1fr;
    }

    .ent-grid {
        grid-template-columns: 1fr;
    }

    .hot-item {
        flex-wrap: wrap;
    }

    .hot-item a {
        width: calc(100% - 40px);
    }

    .subscribe-item {
        flex-wrap: wrap;
    }

    .btn-subscribe {
        margin-left: 62px;
    }
}

/* 通用适配 */
@media (max-width: 768px) {
    .carousel-indicators {
        bottom: 10px;
    }

    .indicator {
        width: 8px;
        height: 8px;
    }

    .indicator.active {
        width: 20px;
    }
}
