body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #000;
    /* 防止因侧边栏出现滚动条导致页面跳动 */
    overflow-x: hidden;
}

.hero-section {
    position: relative; /* 相对定位，作为内部绝对定位元素的基准 */
    height: 100vh;
    width: 100%;
    overflow: hidden;
    display: flex; /* 使用 Flexbox 居中内容 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}

.background-carousel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* 最底层 */
}

.background-carousel .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 2; /* 在背景容器之上 */
}

.background-carousel .slide.active {
    opacity: 1;
    z-index: 3; /* 活动 slide 在普通 slide 之上 */
}

/* 半透明黑色遮罩层，覆盖在背景之上，文字之下 */
.hero-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3); /* 调整透明度 */
    z-index: 4; /* 在活动 slide 之上 */
}

.overlay-content {
    position: relative; /* 使 z-index 生效 */
    z-index: 5; /* 在遮罩层之上 */
    color: white;
    padding: 20px;
    text-align: center; /* 确保内部 inline-block 文字居中 */
}

#typewriter-text {
    font-size: 3.5em;
    font-weight: bold;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.8);
    min-height: 1.2em;
    border-right: 0.08em solid white; /* 光标 */
    white-space: nowrap;
    overflow: hidden;
    display: inline-block;
    animation: blink-caret .75s step-end infinite;
    max-width: 90%;
    box-sizing: border-box;
    padding-right: 2em; /* 确保最后一个字不被截断 */
    /* 移除之前的位移样式 */
}

/* 光标闪烁动画 */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: white; }
}

/* --- Header 样式 --- */
.site-header {
    position: fixed; /* 固定在顶部 */
    top: 0;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 100; /* 较高层级，覆盖在 hero-section 之上 */
    padding: 10px 0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-image {
    max-height: 35px;
    width: auto;
    display: block;
}

.main-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    text-decoration: none;
    color: #333;
    font-size: 0.95em;
    font-weight: 500;
    transition: color 0.2s ease;
}

.main-nav a:hover {
    color: #8e44ad; /* 示例紫色 */
}

/* --- 页脚样式 --- */
footer {
    position: absolute; /* 相对于 .hero-section 定位 */
    bottom: 20px;
    left: 0;
    width: 100%;
    text-align: center;
    z-index: 10; /* 在 overlay-content 之上，但低于 header */
}

footer p {
    margin: 0;
    color: rgba(255, 255, 255, 0.7); /* 稍微调亮一点 */
    font-size: 0.85em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
}

/* --- 右侧滑出面板样式 --- */
.side-panel {
    position: fixed;
    top: 0;
    right: -350px; /* 初始隐藏 */
    width: 350px;
    height: 100vh;
    background-color: white;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.15);
    z-index: 1001; /* 最高层级 */
    transition: right 0.4s ease-in-out;
    overflow-y: auto;
    padding: 60px 30px 30px 30px;
    box-sizing: border-box;
}

.side-panel.open {
    right: 0; /* 滑入 */
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2.5em;
    color: #888;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.close-btn:hover {
    color: #333;
}

.panel-content h2 {
    margin-top: 0;
    color: #333;
}

.panel-content p {
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap; /* 保留换行符 */
}

/* --- 面板遮罩层样式 --- */
.panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000; /* 在 header 之上，panel 之下 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0s 0.4s linear;
}

.panel-overlay.visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease;
}

/* --- 响应式调整 --- */
@media (max-width: 768px) {
    #typewriter-text {
        font-size: 2.5em;
    }
    .header-container {
        padding: 0 15px;
    }
    .logo-image {
        max-height: 30px;
    }
    .main-nav li {
        margin-left: 15px;
    }
    .main-nav a {
        font-size: 0.9em;
    }
    footer {
        bottom: 15px;
    }
    footer p {
        font-size: 0.75em;
    }
    .side-panel {
        width: 85%;
        right: -85%;
        padding: 50px 20px 20px 20px;
    }
    .close-btn {
        font-size: 2.2em;
        top: 10px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    #typewriter-text {
        font-size: 1.8em;
    }
    .logo-image {
        max-height: 25px;
    }
     /* 可以考虑在超小屏幕隐藏文字导航，换成汉堡菜单 */
    .main-nav {
        /* display: none; */ /* 示例：隐藏 */
    }
}