* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 页面布局样式 - 用于嵌入导航iframe */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: #f4f6f9;
    display: flex;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

/* 移动端目录切换按钮 */
.menu-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.1s;
}

.menu-toggle:hover {
    background: #1a252f;
}

.menu-toggle:active {
    transform: scale(0.95);
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
}

.menu-toggle.active {
    background: #e74c3c;
}

.menu-toggle.active:hover {
    background: #c0392b;
}

/* 导航框架 */
.nav-frame {
    width: 500px;
    height: 100vh;
    border: none;
    flex-shrink: 0;
    background-color: #f4f6f9;
    transition: transform 0.3s ease;
    z-index: 999;
}

.content-wrapper {
    flex: 1;
    overflow-y: auto;
    height: 100vh;
    background-color: #f4f6f9;
    transition: opacity 0.3s ease;
}

/* 确保page-container在滚动容器中正确显示 */
.content-wrapper .page-container {
    max-width: 880px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    background: #f4f6f9;
    min-height: 100vh;
}

/* ========== 标题行和分享按钮 ========== */
.title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.title-row h1 {
    flex: 1;
    margin-bottom: 0;
}

/* 分享按钮 */
.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #ffffff;
    color: #2c3e50;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.share-btn:hover {
    background: #f0f4f8;
    border-color: #2c3e50;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.share-btn:active {
    transform: scale(0.96);
    background: #e2e8f0;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

/* 提示消息 */
.toast-message {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #2c3e50;
    color: white;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
    white-space: nowrap;
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
}

.toast-message svg {
    width: 18px;
    height: 18px;
    color: #4ade80;
}

.toast-message.error svg {
    color: #f87171;
}

.toast-message.error {
    background: #991b1b;
}

h1 {
    font-size: 2.2rem;
    color: #2c3e50;
    padding-bottom: 15px;
    border-bottom: 3px solid #2c3e50;
}

.back-to-home {
    margin-bottom: 20px;
}

.back-to-home a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 14px;
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    transition: all 0.2s;
    display: inline-block;
}

.back-to-home a:hover {
    background: #e0e0e0;
}

.content {
    line-height: 1.8;
    color: #333;
}

.content p {
    margin: 15px 0;
    font-size: 16px;
}

.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #e0e0e0;
}

footer {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
    color: #999;
    font-size: 14px;
    text-align: center;
}

hr {
    margin: 1rem 0;
    border-top: 1px solid #e2e8f0;
    border-right: none;
    border-bottom: none;
    border-left: none;
}

/* 移动端样式 */
@media (max-width: 768px) {
    body {
        flex-direction: column;
    }

    /* 显示目录按钮 */
    .menu-toggle {
        display: flex;
    }

    /* 导航默认隐藏 */
    .nav-frame {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        transform: translateX(-100%);
        box-shadow: none;
        z-index: 998;
    }

    /* 导航打开状态 */
    .nav-frame.nav-open {
        transform: translateX(0);
        box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
    }

    .content-wrapper {
        width: 100%;
        height: 100vh;
        padding-top: 60px; /* 为固定按钮留出空间 */
    }

    /* 菜单打开时内容区域变暗 */
    .content-wrapper.nav-open::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 997;
        pointer-events: auto;
    }

    .content-wrapper .page-container {
        padding: 0 1rem 2rem 1rem;
    }

    h1 {
        font-size: 1.6rem;
        margin-top: 0;
        padding-top: 0.5rem;
    }

    /* 移动端标题行调整 */
    .title-row {
        flex-wrap: wrap;
        gap: 12px;
    }

    .share-btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    /* 移动端提示消息调整 */
    .toast-message {
        bottom: 20px;
        padding: 10px 20px;
        font-size: 14px;
        white-space: nowrap;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: 1.5rem;
    }

    .back-to-home {
        margin-bottom: 1.4rem;
    }

    .menu-toggle {
        top: 8px;
        left: 8px;
        padding: 8px 12px;
        font-size: 14px;
    }

    /* 移动端分享按钮 - 保留文字 */
    .share-btn {
        padding: 8px 12px;
        border-radius: 8px;
    }

    .share-btn span {
        display: inline;  /* 保留文字显示 */
    }

    .share-btn svg {
        width: 16px;
        height: 16px;
    }

    .toast-message {
        white-space: normal;
        max-width: 90%;
        text-align: center;
    }
}