/* Copyright (C) 2026 JSLY
 * SPDX-License-Identifier: AGPL-3.0-or-later */

/* 导航栏 */
header {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    width: 100%;
    z-index: 1000;
    transition: transform 0.3s ease;
}

header.nav-hidden {
    transform: translateY(-100%);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
}

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

.nav-links a {
    font-weight: 500;
    position: relative;
}

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

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

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

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.lang-switcher {
    position: relative;
}

.lang-toggle {
    font-size: 18px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.lang-toggle:hover {
    color: var(--primary);
}

.lang-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 110px;
    z-index: 100;
    overflow: hidden;
}

.lang-dropdown.show {
    display: block;
}

.lang-dropdown a {
    display: block;
    padding: 8px 14px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.lang-dropdown a:hover {
    background: var(--bg-hover);
}

.search-icon {
    font-size: 18px;
    cursor: pointer;
    color: var(--gray);
}

.menu-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--gray);
}

.dark-mode-toggle {
    font-size: 18px;
    cursor: pointer;
    color: var(--gray);
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    color: var(--primary);
}

/* 英雄区域 */
.hero {
    padding-top: 150px;
    padding-bottom: 80px;
    background: #e8f5e9;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--dark);
    margin-bottom: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* 博客内容 */
.blog-content {
    padding: 60px 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: var(--primary);
    bottom: 0;
    left: 0;
}

/* 让 main 撑满视口剩余高度，确保 footer 在内容不足时仍贴底 */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 页脚 */
footer {
    background: var(--dark);
    color: white;
    padding: 70px 0 30px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 50px;
}

.footer-col h3 {
    font-size: 1.3rem;
    margin-bottom: 25px;
    position: relative;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    width: 50px;
    height: 2px;
    background: var(--primary);
    bottom: -10px;
    left: 0;
}

.footer-col p {
    color: #aaa;
    margin-bottom: 20px;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a,
.footer-links li {
    color: #aaa;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
    padding-left: 5px;
}

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

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

.social-links a:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

.social-qzone,
.social-luogu,
.social-luogu-me,
.social-atcoder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
    color: #aaa;
}

.social-qzone:hover,
.social-luogu:hover,
.social-luogu-me:hover,
.social-atcoder:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-5px);
}

.social-qzone-text {
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    letter-spacing: 0.5px;
}

.social-luogu img,
.social-luogu-me img {
    display: block;
}

.social-luogu:hover img,
.social-luogu-me:hover img {
    filter: brightness(0) invert(1);
}

.social-atcoder-text {
    font-size: 9px;
    font-weight: bold;
    line-height: 1;
    white-space: nowrap;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

.dark-mode header {
    background: var(--light);
    border-bottom: 1px solid var(--border);
}

.dark-mode .hero {
    background: linear-gradient(135deg, #16213e, #1a1a2e);
}

.dark-mode footer {
    background: #0d0d1a;
}

/* Anchor scroll offset for fixed header */
#home,
#articles,
#about,
#subscribe {
    scroll-margin-top: 80px;
}
