/** landing page logo **/
#landing-page-logo {
    background: none;
}

/** Add a counter before subsections **/
h1:not(.rubric) {
    counter-reset: subsection;
    text-decoration: underline;
}

/** MyST examples */
.myst-example {
    border: 1px solid var(--pst-color-border);
    border-left-color: var(--pst-color-info);
    border-left-width: .2em;
    box-shadow: rgba(0, 0, 0, 0.25) 0px 5px 15px;
    margin-bottom: 1rem;
}
.myst-example-source > div[class*="highlight-"]{
    margin: 0;
}
.myst-example-render {
    padding: 0.5rem;
}
.myst-example-render > :first-child {
    margin-top: 0.5rem;
}

/** No icon for admonitions with no-icon class */
div.admonition.no-icon > .admonition-title::before {
    content: "";
}
div.admonition.no-icon > .admonition-title {
    padding-left: .6rem;
}

/* Live preview page */
@media (min-width: 768px) {
    .preview-input-tabs {
        height: 100%;
    }
    textarea.pyscript.input {
        height: 100%;
    }
}
textarea.pyscript {
    width: 100%;
    min-height: 300px;
    padding: 30px 20px 20px;
    border-radius: 8px;
    resize: vertical;
    font-size: 16px;
    font-family: monospace;
}
textarea.pyscript.output {
    height: 100%;
}
div.pyscript {
    min-height: 300px;
}

.display-flex {
    display: flex;
}
.display-inline-block {
    display: inline-block;
    margin-right: 1rem;
    margin-bottom: 0;
}
span.label {
    /* pyscript changes this and it messes up footnote labels */
    all: unset;
}

.tippy-box {
    background-color:var(--pst-color-surface);
    color:var(--pst-color-text-base);
    border: 1px solid var(--pst-color-border);
}

/* ================================= 响应式设计优化 ================================= */

/* 移动设备通用样式 */
@media (max-width: 768px) {
    /* 优化字体大小和行间距 */
    body {
        font-size: 16px;
        line-height: 1.8;
    }
    
    /* 优化标题样式 */
    h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.75rem;
        line-height: 1.4;
    }
    
    h3 {
        font-size: 1.5rem;
        line-height: 1.5;
    }
    
    h4 {
        font-size: 1.25rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    h6 {
        font-size: 1rem;
    }
    
    /* 优化内容容器宽度 */
    .bd-content {
        padding: 0 1rem;
    }
    
    /* 优化侧边栏行为 */
    .bd-sidebar-primary {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* 增大点击区域 */
    a, button {
        min-height: 44px;
        min-width: 44px;
        padding: 0.5rem;
    }
    
    /* 优化代码块显示 */
    pre {
        font-size: 0.9rem;
        line-height: 1.6;
        overflow-x: auto;
        padding: 1rem;
    }
    
    code {
        font-size: 0.9rem;
    }
    
    /* 优化表格显示 */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        max-width: 100%;
    }
    
    /* 优化列表样式 */
    ul, ol {
        padding-left: 1.5rem;
    }
    
    /* 优化引用样式 */
    blockquote {
        margin: 1rem 0;
        padding: 0.5rem 1rem;
    }
    
    /* 优化 admonition样式 */
    .admonition {
        margin: 1rem 0;
        padding: 1rem;
    }
    
    /* 优化图片显示 */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* 优化导航元素 */
    .navbar-nav {
        font-size: 1rem;
    }
    
    /* 优化搜索框 */
    .search-button {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 优化页脚样式 */
    .bd-footer {
        padding: 1rem;
    }
}

/* 平板设备样式 */
@media (min-width: 769px) and (max-width: 1024px) {
    /* 优化字体大小 */
    body {
        font-size: 17px;
        line-height: 1.7;
    }
    
    /* 优化容器宽度 */
    .bd-content {
        padding: 0 1.5rem;
    }
    
    /* 优化代码块 */
    pre {
        font-size: 0.95rem;
    }
}

/* 小屏幕手机样式 */
@media (max-width: 480px) {
    /* 进一步优化字体大小 */
    body {
        font-size: 15px;
        line-height: 1.9;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
    
    h3 {
        font-size: 1.3rem;
    }
    
    /* 优化内容边距 */
    .bd-content {
        padding: 0 0.75rem;
    }
    
    /* 优化代码块 */
    pre {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
    
    /* 优化表格 */
    table {
        font-size: 0.85rem;
    }
}

/* 优化代码块滚动 */
.highlight {
    overflow-x: auto;
}

/* 优化长文本换行 */
p, li, dd {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 优化链接样式 */
a {
    text-decoration-thickness: 2px;
}

/* 优化按钮样式 */
.btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

/* 优化表单元素 */
input, select, textarea {
    min-height: 44px;
    padding: 0.5rem;
    font-size: 1rem;
}

/* 优化代码复制按钮 */
.copybtn {
    min-height: 36px;
    min-width: 36px;
    padding: 0.25rem;
}

/* 优化图片容器 */
.figure {
    margin: 1.5rem 0;
}

/* 优化figcaption样式 */
figcaption {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

/* 优化视频容器 */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
}

.video-container iframe, .video-container object, .video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* 优化响应式图片 */
.responsive-img {
    max-width: 100%;
    height: auto;
}
