/* css/layout.css - Header, Footer, and Main Layout */

/* --- 导航 --- */
.top-nav {
    background: var(--p5-black);
    padding: 20px 40px 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 5px solid var(--p5-red);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.marquee-wrap {
    background: var(--p5-red);
    color: white;
    padding: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    font-family: 'Bangers';
    font-size: 0.9rem;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1001;
    transform: skewX(0deg);
    border-bottom: none;
}

.brand-logo {
    font-family: 'Bangers';
    color: var(--p5-yellow);
    font-size: 2rem;
    text-decoration: none;
    text-shadow: 2px 2px 0 var(--p5-red);
    cursor: pointer;
}

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

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

.menu-list {
    display: flex;
    gap: 12px;
    align-items: center;
}

.menu-btn {
    background: transparent;
    color: var(--p5-white);
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.65rem;
    font-style: italic;
    font-weight: 900;
    letter-spacing: 0.5px;
    padding: 9px 20px;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.2s;
    position: relative;
    border: 2px solid transparent;
    transform: skewX(-14deg);
    line-height: 1;
}

.menu-btn:hover {
    background: var(--p5-red);
    color: var(--p5-white);
    border-color: var(--p5-red);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

.menu-btn.active {
    background: var(--p5-yellow);
    color: var(--p5-black);
    border-color: var(--p5-yellow);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.6);
}

/* --- 搜索框 --- */
.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

#search-input {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1rem;
    font-style: italic;
    font-weight: 700;
    padding: 10px 42px 10px 15px;
    border: 3px solid var(--p5-white);
    background: rgba(0, 0, 0, 0.68);
    color: var(--p5-white);
    outline: none;
    transition: all 0.3s;
    width: 260px;
    border-radius: 8px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.55);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.66);
}

#search-input:focus {
    background: var(--p5-white);
    color: var(--p5-black);
    border-color: var(--p5-yellow);
    width: 300px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.6);
}

#search-input:focus::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.search-icon {
    position: absolute;
    right: 14px;
    color: var(--p5-yellow);
    font-size: 1.15rem;
    pointer-events: none;
    transition: color 0.3s;
}

#search-input:focus + .search-icon {
    color: var(--p5-black);
}

/* --- 布局 --- */
.container {
    max-width: 1440px;
    width: 100%;
    margin: 40px auto;
    margin-top: 120px;
    display: flex;
    gap: 40px;
    padding: 0 20px;
    box-sizing: border-box;
    flex: 1;
    position: relative;
    z-index: 10;
}

.content-area {
    flex: 3;
    min-height: 500px;
}

.sidebar-area {
    flex: 1;
    min-width: 250px;
    position: -webkit-sticky;
    position: sticky;
    top: 130px;
    height: fit-content;
    z-index: 100;
}

/* --- Post Reading Mode --- */
.container.post-reading-mode {
    justify-content: flex-start; 
}

.container.post-reading-mode .sidebar-area {
    flex: 1;
    min-width: 250px;
    width: auto; 
}

.container.post-reading-mode .content-area {
    flex: 3;
    max-width: none; 
    margin: 0;
}

/* --- Footer --- */
.footer-bar {
    background: var(--p5-black);
    color: var(--p5-white);
    position: relative;
    z-index: 100;
    overflow: hidden;
    border-top: 5px solid var(--p5-yellow);
}

.marquee-content {
    display: inline-block;
    padding-left: 50%;
    animation: marquee 20s linear infinite;
}

@keyframes marquee {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(-100%);
    }
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
}

.footer-column {
    min-width: 200px;
}

.footer-brand {
    margin-bottom: 20px;
}

.brand-logo-footer {
    font-family: 'Bangers';
    color: var(--p5-yellow);
    font-size: 2rem;
    text-decoration: none;
    text-shadow: 2px 2px 0 var(--p5-red);
    margin-bottom: 10px;
    display: block;
}

.brand-tagline {
    color: #aaa;
    font-size: 1rem;
    margin-bottom: 20px;
}

.footer-about {
    color: #aaa;
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-heading {
    color: var(--p5-white);
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--p5-yellow);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.footer-links a {
    color: #aaa;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--p5-yellow);
    transform: translateX(5px);
}

.footer-contact {
    color: #aaa;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: #aaa;
}

.footer-bottom-inner a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
}

.footer-bottom-inner a:hover {
    color: var(--p5-yellow);
}

.footer-divider {
    color: #666;
    margin: 0 4px;
}

.footer-beian-link {
    display: inline-flex !important;
    align-items: center;
    gap: 5px;
}

.footer-copyright {
    white-space: nowrap;
}

.footer-version {
    color: var(--p5-yellow);
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* --- 移动端适配 --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 0 10px;
    }

    .sidebar-area {
        order: 1;
    }

    .top-nav {
        padding: 15px 15px 30px 15px;
    }

    .nav-right {
        flex-wrap: wrap;
        gap: 10px;
    }

    .menu-list {
        gap: 4px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .menu-btn {
        padding: 5px 10px;
        font-size: 0.9rem;
    }

    .brand-logo {
        font-size: 1.5rem;
    }

    #search-input {
        width: 120px;
        font-size: 0.85rem;
    }

    #search-input:focus {
        width: 150px;
    }

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

    .footer-column {
        text-align: center;
    }

    .footer-heading::after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links a:hover {
        transform: translateX(0);
    }

    .footer-bottom {
        padding: 15px 10px;
    }

    .footer-bottom-inner {
        font-size: 0.75rem;
        gap: 6px;
    }

    .footer-divider {
        display: none;
    }

    .footer-bottom-inner {
        flex-direction: column;
        gap: 8px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}
