/* ========== 全局重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #8b5cf6;
    --secondary: #06b6d4;
    --accent: #f59e0b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-section: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #334155;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.4);
    --radius: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

img {
    max-width: 100%;
    height: auto;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(99, 102, 241, 0.1);
    transition: var(--transition);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo i {
    font-size: 1.8rem;
    -webkit-text-fill-color: var(--primary);
}

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

.nav-links a {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 8px 0;
    position: relative;
    transition: var(--transition);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: var(--transition);
}

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

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

.admin-link {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white !important;
    padding: 8px 20px !important;
    border-radius: 8px;
    font-weight: 600 !important;
}

.admin-link::after {
    display: none !important;
}

.admin-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

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

.mobile-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    z-index: 999;
}

.mobile-menu a {
    display: block;
    padding: 12px 15px;
    color: var(--text-secondary);
    font-size: 1rem;
    border-radius: 8px;
    transition: var(--transition);
}

.mobile-menu a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-primary);
}

/* ========== Hero区域 ========== */
.hero {
    padding: 140px 0 80px;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(99, 102, 241, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 50%, rgba(6, 182, 212, 0.06) 0%, transparent 50%);
    animation: heroGlow 10s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-5%, 5%); }
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
}

.hero-content h1 {
    font-size: 3.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 50%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 35px;
}

.search-box {
    max-width: 550px;
    margin: 0 auto;
}

.search-box form {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    transition: var(--transition);
}

.search-box form:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-box input {
    flex: 1;
    padding: 16px 25px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    padding: 16px 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.hero-stats {
    position: relative;
    display: flex;
    justify-content: center;
    gap: 60px;
    padding-top: 40px;
    border-top: 1px solid var(--border-color);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* ========== 主要内容 ========== */
.main-content {
    padding: 60px 0;
}

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

/* ========== 分类导航 ========== */
.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 35px;
}

.category-nav a {
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.category-nav a:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.category-nav a.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-color: transparent;
}

/* ========== 文章卡片 ========== */
.articles-grid {
    display: grid;
    gap: 25px;
}

.article-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(99, 102, 241, 0.3);
}

.article-image {
    position: relative;
    height: 220px;
    overflow: hidden;
}

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

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

.article-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    background: rgba(99, 102, 241, 0.9);
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.article-content {
    padding: 25px;
}

.article-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.article-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-summary {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    line-height: 1.6;
}

.article-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.article-author {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.article-author i {
    margin-right: 5px;
}

.read-more {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.read-more:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 20px;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

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

.sidebar-widget {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.widget-title i {
    color: var(--primary);
}

.hot-articles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hot-article-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px;
    border-radius: 10px;
    transition: var(--transition);
}

.hot-article-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.hot-rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    flex-shrink: 0;
}

.hot-article-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
    line-height: 1.4;
}

.hot-views {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.latest-articles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-article-item {
    padding: 12px;
    border-radius: 10px;
    transition: var(--transition);
}

.latest-article-item:hover {
    background: rgba(99, 102, 241, 0.08);
}

.latest-article-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.latest-article-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    padding: 6px 16px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.tag:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

/* ========== 文章详情弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 10;
}

.modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.modal-body {
    padding: 0;
}

.modal-image {
    width: 100%;
    height: 350px;
    background-size: cover;
    background-position: center;
}

.modal-info {
    padding: 30px;
}

.modal-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.modal-summary {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius);
    border-left: 3px solid var(--primary);
}

.modal-full-content {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ========== 页脚 ========== */
.footer {
    background: var(--bg-dark);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: 60px;
}

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

.footer-brand i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.footer-brand h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.footer-links h4,
.footer-social h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links a {
    display: block;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.footer-links a:hover {
    color: var(--primary-light);
    transform: translateX(3px);
}

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

.social-icons a {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: var(--transition);
}

.social-icons a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

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

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .mobile-menu.active {
        display: block;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content p {
        font-size: 1rem;
    }
    
    .hero-stats {
        gap: 30px;
        flex-wrap: wrap;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .article-image {
        height: 180px;
    }
    
    .sidebar {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .social-icons {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .hero {
        padding: 120px 0 50px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .search-box input {
        padding: 14px 18px;
    }
    
    .search-box button {
        padding: 14px 20px;
    }
    
    .article-content {
        padding: 18px;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .modal-image {
        height: 200px;
    }
    
    .modal-info {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 1.4rem;
    }
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}