/* MacOS 风格全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "San Francisco", Arial, sans-serif;
    background-color: #f5f5f7;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* MacOS 风格窗口 */
.container {
    width: 90%;
    max-width: 900px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid #d6d6d6;
    padding: 20px;
}

/* 标题栏 */
h2 {
    display: flex;
    align-items: center;
    font-size: 18px;
    color: #333;
    margin: 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #ddd;
}

/* Notebook 内容区域 */
.notebook-content {
    padding: 15px;
    background: #ffffff;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    color: #444;
    overflow-x: auto; /* 允许整个区域滚动 */
}

/* 代码块外层容器 */
.code-block {
    position: relative;
    width: 100%;
    overflow-x: auto; /* 代码块允许滚动 */
    background: #1e1e1e;
    border-radius: 8px;
    padding: 10px;
}

/* 代码高亮 */
.code-block pre {
    background: #1e1e1e;
    color: #dcdcdc;
    font-family: "SF Mono", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 14px;
    padding: 15px;
    border-radius: 8px;
    white-space: pre; /* 绝对不换行 */
    overflow-x: auto; /* 代码溢出时可滚动 */
    display: block;
}

/* 代码块内的 span 防止换行 */
.code-block pre span {
    white-space: nowrap !important; /* 强制所有 span 内的文本不换行 */
}

/* 代码块在小屏幕时仍可滚动 */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 15px;
    }

    h2 {
        font-size: 16px;
    }

    .code-block {
        overflow-x: auto !important;
        max-width: 100%;
    }

    .code-block pre {
        font-size: 13px;
        padding: 12px;
        white-space: pre !important; /* 强制单行显示 */
        overflow-x: auto !important; /* 确保可以左右滚动 */
    }
}
