/* 通用样式 - 现代简约配色 */
:root {
    --primary-color: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --accent-light: #fbbf24;
    --background-light: #fafafa;
    --card-light: #ffffff;
    --text-light: #1f2937;
    --text-secondary-light: #6b7280;
    --background-dark: #0f172a;
    --card-dark: #1e293b;
    --text-dark: #f1f5f9;
    --text-secondary-dark: #94a3b8;
    --border-light: #e5e7eb;
    --border-dark: #334155;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    background-color: var(--background-light);
    color: var(--text-light);
    position: relative;
}

/* 防止加载时的布局跳动 */
body.loading {
    opacity: 0;
}

body:not(.loading) {
    opacity: 1;
    transition: opacity 0.2s ease-in;
}


body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0%, rgba(37, 99, 235, 0.02) 100%);
    z-index: -1;
}

body.dark-mode {
    background-color: var(--background-dark);
    color: var(--text-dark);
}

body.dark-mode::before {
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.05) 0%, transparent 100%);
}

/* 全局链接样式 */
a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    color: var(--primary-light);
}

main {
    padding-top: 70px;
    flex: 1;
    padding-bottom: 30px;
    width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Header container - 防止加载时布局跳动 */
#header-container {
    min-height: 72px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

/* 导航栏样式 - 简约现代 */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 72px;
    border-bottom: 1px solid var(--border-light);
}

.navbar::before {
    display: none;
}

body.dark-mode .navbar {
    background: rgba(15, 23, 42, 0.8);
    border-bottom: 1px solid var(--border-dark);
}

.nav-logo {
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.nav-logo a {
    font-weight: 700;
    font-size: 20px;
    color: var(--primary-color);
    transition: all 0.3s;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    position: relative;
    padding: 6px 10px;
    border-radius: 12px;
}

.nav-logo a:hover {
    transform: translateY(-1px);
    color: var(--primary-light);
}

.nav-logo a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 108, 247, 0.15) 0%, rgba(22, 219, 147, 0.15) 100%);
    border-radius: 12px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-logo a:hover::before {
    opacity: 1;
}

.nav-logo img {
    margin-right: 10px;
    height: 30px;
    width: auto;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin: 0 4px;
    position: relative;
}

.nav-links li a {
    position: relative;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    color: var(--text-secondary-light);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    z-index: 1;
}

.nav-links li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 10px;
    background-color: transparent;
    z-index: -1;
    transition: all 0.3s ease;
    opacity: 0;
}

.nav-links li a:hover::before {
    background-color: rgba(74, 108, 247, 0.08);
    opacity: 1;
}

.nav-links li a:hover {
    color: var(--primary-color);
}

.nav-links li a i {
    margin-right: 6px;
    font-size: 14px;
    color: var(--primary-color);
}

.nav-links li a.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(74, 108, 247, 0.08);
}

body.dark-mode .nav-links li a {
    color: var(--text-secondary-dark);
}

body.dark-mode .nav-links li a:hover {
    color: var(--primary-light);
}

body.dark-mode .nav-links li a:hover::before {
    background-color: rgba(74, 108, 247, 0.12);
}

body.dark-mode .nav-links li a.active {
    color: var(--primary-light);
    background-color: rgba(74, 108, 247, 0.12);
}

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

.search-box {
    position: relative;
    margin-right: 15px;
}

.search-box input {
    padding: 10px 38px 10px 18px;
    border-radius: 20px;
    border: 1px solid rgba(74, 108, 247, 0.2);
    outline: none;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
    width: 180px;
    font-size: 14px;
}

.search-box input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.15);
    width: 220px;
    background: rgba(255, 255, 255, 0.97);
}

.search-box i {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary-light);
    pointer-events: none;
    transition: all 0.3s;
}

.search-box input:focus+i {
    color: var(--primary-color);
}

body.dark-mode .search-box input {
    background: rgba(18, 20, 30, 0.6);
    border-color: rgba(74, 108, 247, 0.3);
    color: var(--text-dark);
}

body.dark-mode .search-box input:focus {
    background: rgba(30, 35, 50, 0.9);
}

body.dark-mode .search-box i {
    color: var(--text-secondary-dark);
}

.theme-switch {
    position: relative;
    margin-left: 5px;
}

.theme-switch label {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    background-color: transparent;
}

.theme-switch input {
    position: absolute;
    opacity: 0;
}

.theme-switch label:hover {
    background-color: rgba(74, 108, 247, 0.08);
}

.theme-switch i {
    font-size: 18px;
    color: var(--text-secondary-light);
    transition: all 0.3s;
}

.theme-switch input:checked+label i {
    color: var(--primary-color);
}

body.dark-mode .theme-switch i {
    color: var(--text-secondary-dark);
}

body.dark-mode .theme-switch input:checked+label i {
    color: var(--primary-light);
}

body.dark-mode .theme-switch label:hover {
    background-color: rgba(74, 108, 247, 0.12);
}

footer {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid rgba(74, 108, 247, 0.1);
    position: relative;
    color: var(--text-secondary-light);
    font-size: 14px;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.3;
}

footer .footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

footer .footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
}

footer .footer-links a {
    color: var(--text-secondary-light);
    transition: all 0.3s;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 8px;
}

footer .footer-links a:hover {
    color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.08);
}

footer .copyright {
    margin-top: 10px;
}

footer .love {
    color: var(--accent-color);
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

body.dark-mode footer {
    background: rgba(25, 30, 45, 0.97);
    border-top: 1px solid rgba(74, 108, 247, 0.15);
    color: var(--text-secondary-dark);
}

body.dark-mode footer .footer-links a {
    color: var(--text-secondary-dark);
}

body.dark-mode footer .footer-links a:hover {
    color: var(--primary-light);
    background-color: rgba(74, 108, 247, 0.12);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar {
        padding: 0 15px;
        height: auto;
        flex-direction: column;
        padding: 15px;
    }

    .navbar::before {
        height: 2px;
    }

    .nav-logo {
        margin-bottom: 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
        width: 100%;
        margin: 10px 0;
    }

    .nav-links li a {
        padding: 8px 12px;
        font-size: 14px;
    }

    .nav-right {
        width: 100%;
        justify-content: center;
        margin-top: 15px;
    }

    .search-box {
        width: 100%;
        max-width: 250px;
    }

    .search-box input,
    .search-box input:focus {
        width: 100%;
    }

    main {
        padding-top: 160px;
    }

    footer {
        padding: 20px 15px;
    }

    footer .footer-links {
        gap: 10px;
    }
}