/* General Styles */
body {
    margin: 0;
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #E0E0E0;
    background-color: #0A1931;
    /* 为固定页头增加顶部内边距，防止内容被遮挡 */
    padding-top: var(--header-height, 70px); /* 默认值，如果未设置 */
}

/* Header Styles */
.site-header {
    background-color: #0A1931;
    padding: 15px 0;
    border-bottom: 1px solid #1A2E44;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    /* 使页头悬浮 */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    /* 定义页头高度，供body padding和移动导航使用 */
    --header-height: 70px; /* 根据实际内容高度调整 */
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: var(--header-height, 70px); /* 确保容器有高度 */
}

.logo {
    color: #FFD700;
    font-size: 2.2em;
    font-weight: bold;
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.logo:hover {
    color: #E0E0E0;
}

.main-nav .nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 25px;
}

.main-nav .nav-list li a {
    color: #E0E0E0;
    text-decoration: none;
    font-size: 1.05em;
    font-weight: 600;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.main-nav .nav-list li a:hover,
.main-nav .nav-list li a.active {
    color: #FFD700;
}

/* 新增按钮样式 */
.header-actions {
    display: flex;
    gap: 15px;
    margin-left: 20px; /* 与导航的间距 */
}

.header-button {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1em;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap; /* 防止按钮文本换行 */
}

.register-button {
    background-color: #FFD700;
    color: #0A1931;
}

.register-button:hover {
    background-color: #E0B000;
    color: #0A1931;
}

.login-button {
    background-color: #1A2E44;
    color: #FFD700;
    border: 1px solid #FFD700;
}

.login-button:hover {
    background-color: #2A425A;
    color: #FFD700;
}

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1000;
}

.hamburger-menu .bar {
    width: 100%;
    height: 3px;
    background-color: #FFD700;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* Footer Styles */
.site-footer {
    background-color: #0A1931;
    color: #B0B0B0;
    padding: 40px 0 20px;
    border-top: 1px solid #1A2E44;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding: 0 20px;
    text-align: left;
}

.footer-section h3 {
    color: #FFD700;
    font-size: 1.4em;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-section p,
.footer-section a {
    font-size: 0.95em;
    color: #B0B0B0;
    text-decoration: none;
}

.footer-section a:hover {
    color: #FFD700;
}

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

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #1A2E44;
    text-align: center;
}

.copyright {
    font-size: 0.85em;
    color: #888;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .main-nav .nav-list {
        gap: 15px;
    }
    .main-nav .nav-list li a {
        font-size: 1em;
    }
    .header-actions {
        gap: 10px;
        margin-left: 15px;
    }
    .header-button {
        padding: 8px 15px;
        font-size: 0.95em;
    }
}

@media (max-width: 768px) {
    .site-header {
        --header-height: 110px; /* 调整移动端页头高度（两行） */
        padding: 10px 0; /* 移动端较小内边距 */
    }
    body {
        padding-top: var(--header-height, 110px); /* 调整body顶部内边距以适应新的页头高度 */
    }

    .header-container {
        display: grid;
        grid-template-columns: auto 1fr auto; /* 面包屑 | Logo | (空或其它元素) */
        grid-template-rows: auto auto; /* 顶部行, 按钮行 */
        gap: 0px 10px; /* 行间距, 列间距 */
        padding: 0 15px; /* 调整内边距 */
        height: auto; /* 让内容决定高度 */
    }

    .hamburger-menu {
        display: flex; /* 确保可见 */
        grid-column: 1;
        grid-row: 1;
        justify-self: start; /* 左对齐 */
        order: 1; /* 确保在布局流中是第一个 */
        margin-right: 0; /* 移除潜在的默认外边距 */
    }

    .logo {
        grid-column: 2;
        grid-row: 1;
        justify-self: center; /* 水平居中 */
        align-self: center; /* 垂直居中 */
        font-size: 1.8em;
        order: 2; /* 放在面包屑之后 */
    }

    .main-nav {
        position: fixed; /* 更改为fixed，使其与固定页头一起固定 */
        top: var(--header-height, 110px); /* 定位在页头下方 */
        left: 0;
        width: 100%;
        background-color: #0A1931;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
        padding: 20px 0;
        max-height: calc(100vh - var(--header-height, 110px)); /* 调整最大高度 */
        overflow-y: auto;
    }

    .main-nav.active {
        transform: translateX(0);
    }

    .main-nav .nav-list {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .main-nav .nav-list li {
        width: 100%;
        text-align: center;
        margin-bottom: 15px;
    }

    .main-nav .nav-list li a {
        display: block;
        padding: 15px 0;
        border-bottom: 1px solid #1A2E44;
        font-size: 1.1em;
    }

    .main-nav .nav-list li:last-child a {
        border-bottom: none;
    }

    .hamburger-menu.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger-menu.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* 移动端按钮布局 */
    .header-actions {
        display: flex;
        justify-content: center; /* 按钮居中 */
        gap: 15px;
        grid-column: 1 / -1; /* 跨越所有列 */
        grid-row: 2; /* 放置在第二行 */
        margin-top: 10px; /* Logo下方间距 */
        margin-left: 0; /* 重置桌面端外边距 */
        order: 3; /* 确保在Logo之后 */
    }

    .header-button {
        flex: 1; /* 允许按钮伸缩 */
        max-width: 150px; /* 限制按钮宽度 */
        padding: 12px 10px; /* 调整内边距 */
        font-size: 1em;
    }

    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section ul {
        text-align: center;
    }
    .footer-section ul li a {
        display: inline-block;
    }
}

@media (max-width: 480px) {
    .header-button {
        padding: 10px 8px; /* 针对更小屏幕进一步调整内边距 */
        font-size: 0.9em;
        max-width: 120px;
    }
    .site-header {
        --header-height: 100px; /* 针对极小屏幕略微调整 */
    }
    body {
        padding-top: var(--header-height, 100px);
    }
    .main-nav {
        max-height: calc(100vh - var(--header-height, 100px));
        top: var(--header-height, 100px);
    }
    .footer-section h3 {
        font-size: 1.2em;
    }
    .footer-section p, .footer-section a {
        font-size: 0.9em;
    }
}