body {
    padding-top: 50px;
}

/* 初始化样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 头部样式 - 默认透明，通过JavaScript控制 */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 60px;
    /* 默认透明背景 */
    background: transparent;
    transition: all 0.3s ease;
}

/* 当header有背景时的毛玻璃效果 */
header:not([data-bg-color="clear"]) {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* 滚动时的毛玻璃效果 */
header.scrolled {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.1);
}

.menu {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 1001;
}

header nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    height: 60px;
    align-items: center;
    margin: 0;
    padding: 0;
}

header nav ul li {
    margin: 0 1rem;
}

header nav ul li a {
    text-decoration: none;
    font-weight: 600;
    line-height: 60px;
    color: #334155;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 15px;
}

/* 透明背景时的文字颜色 */
header[data-bg-color="clear"] nav ul li a {
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

header nav ul li a:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    text-decoration: none;
    transform: translateY(-1px);
}

/* 透明背景时的悬停效果 */
header[data-bg-color="clear"] nav ul li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
}

.menu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.menu li {
    margin-left: 10px;
}

.menu a {
    text-decoration: none;
    padding: 5px 10px;
    transition: background-color 0.3s ease;
}

.menu a:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

/* 汉堡菜单样式 */
.hamburger {
    display: none;
    position: fixed;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1002;
    top: 20px;
    left: 20px;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 3px;
    background: #334155;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

/* 透明背景时的汉堡菜单颜色 */
header[data-bg-color="clear"] .hamburger span {
    background: white;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 移动端样式 */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    .hamburger {
        display: flex;
    }

    header nav ul {
        list-style: none;
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        height: auto;
        min-height: 100vh;
        padding-top: 80px;
        padding-bottom: 20px;
        /* 移动端始终使用毛玻璃效果 */
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        margin: 0;
        border-bottom: none;
    }

    header nav ul li {
        margin: 0;
        padding: 0 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        width: 100%;
    }

    header nav ul li:last-child {
        border-bottom: none;
    }

    header nav ul li a {
        font-size: 18px;
        line-height: 1.4;
        padding: 20px 0;
        display: block;
        text-align: left;
        white-space: nowrap;
        color: #1e293b !important;
        font-weight: 500;
        border-radius: 0;
        text-shadow: none !important;
    }

    header nav ul li a:hover {
        background: rgba(59, 130, 246, 0.08) !important;
        color: #3b82f6 !important;
        transform: none;
        padding-left: 10px;
        text-shadow: none !important;
    }

    header nav ul.active {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }
}

/* 汉堡菜单动画 */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
    background: #3b82f6; /* 这里是蓝色 */
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
    background: #3b82f6; /* 这里也是蓝色 */
}

/* 菜单滑动动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 平板端适配 */
@media (max-width: 1024px) and (min-width: 769px) {
    header nav ul li {
        margin: 0 0.5rem;
    }

    header nav ul li a {
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    header nav ul li {
        margin: 0 1.5rem;
    }

    header nav ul li a {
        font-size: 16px;
        padding: 10px 20px;
    }
}
