/* ============================================================
   Shared layout components (Navigation / Footer / Buttons)
   导航、页脚与基础按钮的公共样式，结构模板见 templates/frontend/partials.html
   注意：:where() 为零特异度兜底，各页面内联样式可按需覆盖
   ============================================================ */

/* ---------- Layout container ---------- */
:where(.container) {
    max-width: var(--container-max);
    margin: 0 auto;
}

/* ---------- Base buttons ---------- */
:where(.btn) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 200ms ease;
    text-decoration: none;
    border: none;
}

:where(.btn-primary) {
    background: var(--color-accent-500);
    color: var(--color-white);
}

:where(.btn-primary):hover {
    background: var(--color-accent-600);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(34, 197, 94, 0.3);
}

/* ---------- Navigation ---------- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-neutral-200);
    height: var(--nav-height);
}

.nav-container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.nav-logo {
    font-family: var(--font-heading-condensed);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary-500);
    text-decoration: none;
    letter-spacing: -0.02em;
}

.nav-logo img {
    height: 52px;
    vertical-align: middle;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
    list-style: none;
}

.nav-link {
    position: relative;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-neutral-700);
    text-decoration: none;
    transition: color 200ms ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-primary-500);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary-500);
    transition: width 200ms ease;
}

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

/* Mobile Navigation Toggle */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--color-neutral-900);
    transition: all 200ms ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu (hidden on desktop) */
.nav-mobile {
    display: none;
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-mobile {
        display: none;
        position: fixed;
        top: var(--nav-height);
        left: 0;
        right: 0;
        z-index: 999;
        background: var(--color-white);
        padding: 24px;
        border-top: 1px solid var(--color-neutral-200);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    }

    .nav-mobile.active {
        display: block;
    }

    .nav-mobile a {
        display: block;
        padding: 16px 0;
        font-size: 18px;
        font-weight: 500;
        color: var(--color-neutral-900);
        text-decoration: none;
        border-bottom: 1px solid var(--color-neutral-100);
    }
}

/* ---------- Footer ---------- */
.footer {
    background: var(--color-neutral-900);
    color: var(--color-white);
    padding: 64px 24px 32px;
}

.footer .container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0;
}

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

.footer-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
}

.footer-text {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    transition: color 200ms ease;
}

.footer-links a:hover {
    color: var(--color-white);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 32px;
    text-align: center;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}
