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

body {
    min-width: 1540px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #202122;
    background: #fff;
}

.sidebar {
    position: fixed;
    top: 50px;
    left: -260px;
    width: 260px;
    height: calc(100vh - 50px);
    background: #f8f9fa;
    border-right: 1px solid #a2a9b1;
    padding: 20px;
    transition: left 0.6s ease;
    overflow-y: auto;
    z-index: 99;
}

.sidebar-trigger {
    position: fixed;
    top: 50px;
    left: 0;
    width: 30px;
    height: calc(100vh - 50px);
    z-index: 98;
}

.sidebar-trigger:hover + .sidebar,
.sidebar:hover,
.sidebar.active,
.sidebar.locked {
    left: 0;
}

.sidebar.locked ~ .container {
    margin-left: 260px;
}

.nav-section {
    margin: 8px 0;
}

.nav-section-title {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #202122;
    padding: 6px 0;
    font-weight: 500;
}

.nav-toggle {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    position: relative;
}

.nav-toggle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid #72777d;
    border-bottom: 2px solid #72777d;
    transform: translate(-75%, -50%) rotate(45deg);
    transition: transform 0.2s;
}

.nav-section.collapsed .nav-toggle::before {
    transform: translate(-75%, -75%) rotate(-45deg);
}

.nav-section.collapsed .nav-items {
    display: none;
}

.nav-items {
    margin-left: 24px;
}

.nav-link {
    color: #3366cc;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    font-size: 14px;
}

.nav-link:hover {
    text-decoration: underline;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #fff;
    border-bottom: 1px solid #a2a9b1;
    display: flex;
    align-items: center;
    padding: 0;
    z-index: 100;
    justify-content: space-between;
}

.header-title {
    font-size: 1.5em;
    font-weight: 500;
    margin-left: 20px;
}

.header-links {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-right: 20px;
}

.header-link {
    color: #3366cc;
    text-decoration: none;
    font-size: 14px;
}

.header-link:hover {
    text-decoration: underline;
}

.container {
    width: 1000px;
    min-width: 1000px;
    max-width: none;
    margin: 0 auto;
    padding: 10px 20px 40px;
    transition: margin-left 0.6s ease;
}

.title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
    color: #000;
}

.authors {
    text-align: center;
    margin: 20px 0 10px;
    line-height: 1.8;
}

.author-link {
    color: #3366cc;
    text-decoration: none;
}

.author-link:hover {
    text-decoration: underline;
}

.affiliations {
    text-align: center;
    margin: 10px 0;
    color: #666;
}

.links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 12px 0 30px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
    color: #202122;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.button:hover {
    background: #f0f0f0;
}

.button i {
    margin-right: 8px;
}

.video-container {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    /* 移除了固定的 padding-bottom 和 height: 0 */
}

.video-container video {
    width: 100%;
    height: auto; /* 高度会根据视频比例自动调整 */
    display: block; /* 防止底部可能出现的小空隙 */
}

.video-container-body-wide {
    width: 90vw;
    max-width: 90vw;
    margin-left: 50%;
    margin-right: 0;
    transform: translateX(-50%);
}

.video-container-wide {
    width: 90vw;
    max-width: 90vw;
    margin-left: 50%;
    margin-right: 0;
    transform: translateX(-50%);
}

.video-caption {
    max-width: 92%;
    margin: -8px auto 28px;
    color: #54595d;
    font-size: 0.94rem;
    line-height: 1.55;
    text-align: left;
}

/* Markdown and HTML section styles */
.markdown-section, .html-section {
    margin: 40px 0;
    scroll-margin-top: 70px;
}

.markdown-section h1, .html-section h1 {
    font-size: 1.8em;
    margin-bottom: 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid #a2a9b1;
    color: #000;
    font-family: 'Linux Libertine','Georgia','Times',serif;
    position: relative;
}

.markdown-section h2, .html-section h2 {
    font-size: 1.5em;
    margin: 1em 0;
    padding-bottom: 0.2em;
    border-bottom: 1px solid #c8ccd1;
    color: #162441;
    position: relative;
}

.markdown-section h3, .html-section h3 {
    font-size: 1.2em;
    margin: 0.8em 0;
    color: #162441;
    position: relative;
}

/* 标题锚点链接样式 */
.markdown-section .header-link,
.html-section .header-link {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    text-decoration: none;
    color: #666;
    font-weight: normal;
}

.markdown-section h1:hover .header-link,
.markdown-section h2:hover .header-link,
.markdown-section h3:hover .header-link,
.markdown-section h4:hover .header-link,
.markdown-section h5:hover .header-link,
.markdown-section h6:hover .header-link,
.html-section h1:hover .header-link,
.html-section h2:hover .header-link,
.html-section h3:hover .header-link,
.html-section h4:hover .header-link,
.html-section h5:hover .header-link,
.html-section h6:hover .header-link {
    opacity: 1;
}

.markdown-section .header-link:hover,
.html-section .header-link:hover {
    color: #3366cc;
    text-decoration: none;
}

/* Cite 按钮样式适配 */
.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5,
.markdown-section h6,
.html-section h1,
.html-section h2,
.html-section h3,
.html-section h4,
.html-section h5,
.html-section h6 {
    position: relative;
    scroll-margin-top: 70px;
}

.markdown-section .cite-button,
.html-section .cite-button {
    position: absolute;
    right: -55px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    text-decoration: none;
    color: #666;
    font-weight: normal;
    font-size: 11px;
    padding: 2px 6px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.markdown-section h1:hover .cite-button,
.markdown-section h2:hover .cite-button,
.markdown-section h3:hover .cite-button,
.markdown-section h4:hover .cite-button,
.markdown-section h5:hover .cite-button,
.markdown-section h6:hover .cite-button,
.html-section h1:hover .cite-button,
.html-section h2:hover .cite-button,
.html-section h3:hover .cite-button,
.html-section h4:hover .cite-button,
.html-section h5:hover .cite-button,
.html-section h6:hover .cite-button {
    opacity: 1;
}

.markdown-section .cite-button:hover,
.html-section .cite-button:hover {
    color: #3366cc;
    border-color: #3366cc;
    text-decoration: none;
}

.markdown-section p, .html-section p {
    margin: 1em 0;
    line-height: 1.6;
}

.markdown-section pre, .html-section pre {
    margin: 1em 0;
    padding: 16px;
    background: #f6f8fa;
    border-radius: 4px;
    overflow-x: auto;
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
}

.markdown-section code, .html-section code {
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: #f6f8fa;
    border-radius: 3px;
}

.markdown-section img, .html-section img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
}

/* Demo section specific styles */
.pipeline-demo-scroll {
    width: 1386px;
    min-width: 1386px;
    margin: 1.2rem 0 2.5rem 50%;
    transform: translateX(-50%);
}

.pipeline-demo-table {
    width: 1386px;
    min-width: 1386px;
    max-width: none;
    margin: 0 auto;
    color: #202122;
}

.pipeline-demo-head,
.pipeline-demo-videos {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.pipeline-demo-head {
    align-items: end;
    margin-bottom: 10px;
    color: #162441;
    font-family: 'Linux Libertine','Georgia','Times',serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.22;
    text-align: center;
}

.pipeline-demo-head > div {
    position: relative;
    display: grid;
    grid-template-rows: 18px 40px;
    row-gap: 3px;
    align-items: center;
    justify-items: center;
    align-content: center;
    height: 72px;
    padding: 0 8px;
    box-sizing: border-box;
}

.pipeline-column-title {
    display: block;
    grid-row: 2;
    grid-column: 1;
    align-self: center;
}

.pipeline-speed-badge {
    position: relative;
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    justify-self: end;
    min-width: 58px;
    padding: 1px 6px;
    border: 1px solid #e07a7a;
    border-radius: 999px;
    color: #c62828;
    background: #fff5f5;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 9.5px;
    font-weight: 750;
    line-height: 1.2;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pipeline-speed-sparkline {
    position: absolute;
    left: 8px;
    top: 8px;
    width: calc(100% - 83px);
    height: 15px;
    overflow: visible;
    pointer-events: none;
}

.pipeline-speed-line {
    fill: none;
    stroke: #d51f2b;
    stroke-width: 1.35;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.pipeline-speed-dot {
    fill: #d51f2b;
}
/* Keep the five synchronized panels on one fixed-width comparison canvas.
 * Browser zoom therefore enlarges the actual videos without changing text
 * wrapping or column placement. Any overflow is handled by the fixed page canvas. */
.pipeline-demo-head,
.pipeline-demo-row {
    min-width: 1386px;
}

.pipeline-demo-row {
    margin-bottom: 22px;
    padding: 10px;
    border: 1px solid #d8dee8;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 3px 12px rgba(22, 36, 65, 0.06);
}

.pipeline-demo-videos video,
.refiner-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #080b12;
    object-fit: contain;
}

.refiner-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 1px dashed #8ea1bf;
    color: #c7d6ee;
    background: linear-gradient(145deg, #101827, #1d2d49);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.5;
    text-align: center;
}

.pipeline-input-box {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 9px;
    margin-top: 10px;
}

.pipeline-input-box > div {
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid #d5dcea;
    border-radius: 7px;
    background: #f7f9fc;
    color: #26364f;
    font-size: 13px;
    line-height: 1.38;
}

.pipeline-input-box span {
    display: inline-block;
    margin-right: 9px;
    padding: 2px 7px;
    border-radius: 999px;
    color: #fff;
    background: #315b9a;
    font-size: 0.72em;
    font-weight: 750;
    letter-spacing: 0.06em;
}

/* Optional source-RGB ground truth. The sixth column is removed from layout
 * until explicitly requested, so the default five-column demo is unchanged. */
.pipeline-gt-toggle {
    display: inline-flex;
    grid-row: 1;
    grid-column: 1;
    align-self: end;
    justify-self: center;
    align-items: center;
    height: 16px;
    padding: 1px 7px;
    border: 1px solid #b9c7dd;
    border-radius: 999px;
    color: #213b67;
    background: #f7f9fd;
    box-shadow: none;
    cursor: pointer;
    font: 750 9.5px/1.2 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.pipeline-gt-toggle:hover,
.pipeline-gt-toggle[aria-pressed="true"] {
    border-color: #315b9a;
    color: #fff;
    background: #315b9a;
}

.pipeline-gt-column { display: none !important; }

.pipeline-demo-scroll.pipeline-show-gt .pipeline-demo-head,
.pipeline-demo-scroll.pipeline-show-gt .pipeline-demo-videos {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.pipeline-demo-scroll.pipeline-show-gt .pipeline-demo-head > .pipeline-gt-column { display: grid !important; }
.pipeline-demo-scroll.pipeline-show-gt .pipeline-demo-videos > .pipeline-gt-column { display: block !important; }

.pipeline-demo-head .pipeline-column-kicker {
    display: block;
    grid-row: 1;
    align-self: end;
    justify-self: end;
    padding: 2px 7px;
    border-radius: 999px;
    color: #fff;
    background: #315b9a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.05em;
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0px;
    margin: 0px 0;
}

.demo-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.demo-item:hover {
    transform: translateY(-5px);
}

.demo-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.demo-content {
    padding: 15px;
}

.demo-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #162441;
}

.demo-description {
    font-size: 0.9em;
    color: #666;
}

.lock-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    padding: 5px;
    z-index: 100;
}

footer {
    text-align: center;
    padding: 0px;
    margin-top: 0px;
    border-top: 1px solid #a2a9b1;
    font-size: 14px;
    color: #666;
}

footer a {
    color: #3366cc;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Unordered lists style */
.markdown-section ul, .html-section ul {
    padding-left: 40px; /* Consistent with main content padding */
    margin: 1em 0;      /* Same margin as paragraphs */
}

/* Ordered lists style */
.markdown-section ol, .html-section ol {
    padding-left: 40px; /* Consistent with main content padding */
    margin: 1em 0;      /* Same margin as paragraphs */
}

.footnote {
    color: #3366cc;
    position: relative;
    cursor: help;
}
.footnote:hover::after {
    content: attr(data-note);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: #333;
    color: white;
    padding: 8px 10px;
    border-radius: 4px;
    white-space: normal;
    max-width: 300px;
    min-width: 200px;
    font-size: 0.9em;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    word-wrap: break-word;
}

/* 当脚注靠近右边缘时，让提示框向左显示 */
.footnote:hover::after {
    left: 50%;
    transform: translateX(-50%);
}

/* 添加小三角形指向脚注 */
.footnote:hover::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
    z-index: 1001;
}

/* 标题区域背景横幅 —— 全宽，紧贴导航栏 */
.hero-banner {
    position: relative;
    width: 100%;
    margin-top: 50px;
    padding: 0;
}

/* Background gallery disabled for the Stable Signer V3 project page.
.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('./images/background_gallery_big.gif');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.25;
    z-index: 0;
}
*/

.hero-inner {
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px 16px;
}

/* 醒目说明样式 */
.highlight-notice {
    color: blue;
    font-family: 'Times New Roman', Times, serif;
    font-weight: bold;
    display: block;
    text-align: center;
}

/* Dismissible announcement below the fixed navigation; no video/animation cost. */
.announcement-banner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 64px;
    box-sizing: border-box;
    background: #fff6ed;
    border-bottom: 1px solid #f2dcc7;
    color: #34302c;
    text-align: center;
    font-size: 15px;
    line-height: 1.6;
}
.announcement-banner[hidden] { display: none; }
.announcement-banner p { margin: 0; }
.announcement-emoji { margin-right: 8px; }
.announcement-award { color: #d00000; }
.announcement-close {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #65564c;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
}
.announcement-close:hover { background: #f5e5d5; }
.announcement-close:focus-visible { outline: 2px solid #a54222; outline-offset: 2px; }
