/* src/style/main.css */

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', '微软雅黑', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #f0f2f5;
    line-height: 1.6;
    color: #333;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    height: 50px;
    border-radius: 8px;
    transition: transform 0.3s;
}

.logo:hover {
    transform: rotate(-5deg);
}

.neon {
    color: #fff;
    text-shadow: 0 0 5px #00f7ff,
                 0 0 10px #00f7ff,
                 0 0 20px #00f7ff;
    transition: text-shadow 0.3s;
}

/* 导航样式 */
.main-nav .nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.main-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.main-nav a:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-2px);
}

/* 搜索栏样式 */
.search-bar {
    position: relative;
    width: 300px;
}

.search-input {
    width: 100%;
    padding: 0.8rem 2.5rem;
    border: none;
    border-radius: 25px;
    background: rgba(255,255,255,0.1);
    color: white;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    background: rgba(255,255,255,0.2);
    box-shadow: 0 0 15px rgba(0,247,255,0.3);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255,255,255,0.7);
}

/* 主体布局 */
.main-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* 侧边栏样式 */
.sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.nav-group {
    margin-bottom: 2rem;
}

.nav-title {
    color: #1a1a2e;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

.sub-nav li {
    margin: 0.5rem 0;
}

.sub-nav a {
    color: #666;
    text-decoration: none;
    padding: 0.5rem;
    display: block;
    border-radius: 6px;
    transition: all 0.2s;
}

.sub-nav a:hover {
    background: #f8f9fa;
    color: #1a1a2e;
    transform: translateX(5px);
}

/* 新闻卡片样式 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.news-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid #1a1a2e;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
}

.card-tag {
    display: inline-block;
    background: #1a1a2e;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.card-content h3 {
    color: #1a1a2e;
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
}

.card-content p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 页脚样式 */
.footer {
    background: #1a1a2e;
    color: rgba(255,255,255,0.8);
    padding: 3rem 2rem;
    margin-top: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-links li {
    margin: 0.8rem 0;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-links a:hover {
    color: #00f7ff;
    transform: translateX(5px);
}

.beian-info {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: #ff4757;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .sidebar {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        width: 280px;
        height: calc(100vh - 80px);
        overflow-y: auto;
        z-index: 999;
    }

    .sidebar.active {
        display: block;
    }

    .header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .main-nav {
        order: 3;
        width: 100%;
        display: none;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
    }

    .search-bar {
        width: 100%;
        order: 2;
    }

    .menu-toggle {
        display: block;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
    }
}

@media (max-width: 768px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    .logo-text .letter {
        display: none;
    }

    .logo-text .letter:nth-child(1),
    .logo-text .letter:nth-child(2) {
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .card-image {
        height: 150px;
    }

    .modal-content {
        padding: 1.5rem;
    }

    .footer {
        padding: 2rem 1rem;
    }
}

/* 无结果提示样式 */
.no-results-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 6px rgba(0,0,0,0.1);
    margin-top: 2rem;
    color: #666;
}

.no-results-card i {
    font-size: 3rem;
    color: #1a1a2e;
    margin-bottom: 1rem;
    opacity: 0.8;
}

/* 搜索高亮效果 */
.news-card:not(.no-match) .card-content {
    position: relative;
}

.news-card:not(.no-match) .card-content::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 0 15px rgba(0,247,255,0.3);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.3s;
}

.news-card:not(.no-match):hover .card-content::after {
    opacity: 1;
}