html,
body {
    width: 100%;
    margin: 0;
    padding: 0 0;
    min-height: 100vh;
}

body {
    max-width: 100% !important;
    display: flex;
    flex-direction: column;
}

.page-content-wrap {
    margin: 0;
    padding: 0 1rem;
}

.hero-section {
    width: 100%;
    max-width: 1200px;
    margin: 4em auto;
    padding: 3em 2em;
    min-height: 600px;
    display: flex;
    align-items: center;
    gap: 3em;
}

.intro-text {
    flex: 0 0 35%;
    text-align: left;
}

.app-icon {
    width: 96px;
    height: 96px;
    margin: 0 0 1em 0;
    display: block;
}

.intro-text h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--subheading-color);
}

.intro-text h2.hero-main-title {
    font-size: 3.2rem !important;
    font-weight: 700 !important;
}

.intro-text p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--base-color);
}

.macbook-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.macbook-screen {
    width: 120%;
    max-width: none;
    height: auto;
    display: block;
}

@media all and (max-width: 736px) {
    .hero-section {
        margin: 2em auto;
        padding: 0 1em;
        flex-direction: column;
        gap: 2em;
    }

    .intro-text {
        flex: none;
        text-align: center;
        margin-bottom: 0;
        width: 100%;
        padding: 1.5em;
        border-radius: 16px;
    }

    .app-icon {
        width: 96px;
        height: 96px;
        margin: 0 auto 1em;
    }

    .intro-text h2 {
        font-size: 1.5rem;
    }

    .intro-text h2.hero-main-title {
        font-size: 3.2rem !important;
        font-weight: 700 !important;
    }

    .intro-text p {
        font-size: 1rem;
    }

    .macbook-container {
        flex: none;
        width: 100%;
    }

    .macbook-screen {
        width: 100%;
    }
}

/* Header styles */
header.Hero {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--hero-background-start);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

header.Hero nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1em 1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header.Hero h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    position: relative;
}

/* 小屏幕显示缩写 */
@media all and (max-width: 736px) {
    header.Hero h1 {
        font-size: 0;
    }

    header.Hero h1::before {
        content: "SCL";
        font-size: 1.5rem;
        font-weight: 600;
    }
}

header.Hero .nav-links {
    display: flex;
    gap: 2em;
    align-items: center;
}

header.Hero .nav-links a {
    text-decoration: none;
    color: var(--link-color);
    font-size: 0.9rem;
}

header.Hero .nav-links .docs-link {
    text-decoration: none;
    color: var(--base-color) !important;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.docs-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* GitHub icon */
.github-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--base-color) !important;
}

.github-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

.github-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* 默认（亮色模式）显示黑色图标，隐藏白色图标 */
.github-icon-light {
    display: block !important;
}

.github-icon-dark {
    display: none !important;
}

/* 暗色模式显示白色图标，隐藏黑色图标 */
@media (prefers-color-scheme: dark) {
    .dark-mode-enabled .github-icon-light {
        display: none !important;
    }

    .dark-mode-enabled .github-icon-dark {
        display: block !important;
    }
}

/* Download button container */
.download-container {
    margin: 2em 0;
}

.download-button {
    text-decoration: none;
    color: #ffffff !important;
    background: var(--link-color);
    padding: 0.5em 1.5em;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
    margin-bottom: 1.5em;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.download-button:hover {
    opacity: 0.9;
    text-decoration: none;
    color: #ffffff !important;
}

/* Footer styles */
footer.footer {
    margin-top: auto;
    display: flex;
    min-height: 240px;
}

footer.footer > div {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    flex: 1;
    display: flex;
}

footer.footer .footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 2em;
    width: 100%;
    align-items: start;
    padding: 2em 0;
}

footer.footer .footer-content > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

footer.footer h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.5;
    min-height: 3em;
    display: flex;
    align-items: center;
    color: var(--subheading-color);
}

footer.footer p {
    margin: 0;
    line-height: 1.5;
    min-height: 3em;
    display: flex;
    align-items: center;
}

footer.footer p + p {
    margin-top: 0;
}

footer.footer a {
    color: var(--footer-link-color);
    text-decoration: none;
    font-size: 0.9rem;
}

/* Contributor avatars */
.contributors-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 1em;
    margin-top: 0.5em;
    flex-wrap: wrap;
}

.contributors-avatars {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5em;
    flex-shrink: 0;
}

.contributor-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.contributor-avatar:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.contributor-avatar-emoji {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: var(--hero-background-start);
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.contributor-avatar-emoji:hover {
    transform: scale(1.1);
    opacity: 0.9;
}

.contributor-ellipsis {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--footer-link-color);
    flex-shrink: 0;
    cursor: default;
}

.contributor-more-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    text-decoration: underline;
    flex-shrink: 0;
    border-radius: 50%;
    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.contributor-more-link:hover {
    transform: scale(1.1);
    opacity: 0.9;
    text-decoration: underline;
}

/* Footer responsive styles */
@media all and (max-width: 736px) {
    footer.footer > div {
        align-items: center;
        justify-content: center;
    }

    footer.footer .footer-content {
        grid-template-columns: 1fr;
        align-items: center;
        justify-items: center;
        text-align: center;
    }

    footer.footer .footer-content > div {
        width: 100%;
        align-items: center;
    }

    .contributors-wrapper {
        justify-content: center;
    }

    .contributors-avatars {
        max-width: 100%;
    }

    .contributors-more {
        width: 100%;
        text-align: center;
        margin-top: 0.5em;
    }

    .copyright > div {
        padding: 1.4em 2em;
        min-height: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .copyright p {
        text-align: center;
        white-space: normal;
    }
}

/* Copyright section */
.copyright {
    width: 100%;
    background: var(--hero-background-start);
    margin-bottom: 0;
}

.copyright > div {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1em 0;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.copyright p {
    color: var(--footer-color);
    font-size: 0.85rem;
    margin: 0;
    text-align: center;
    white-space: nowrap;
}

/* Version history page: two-column layout (keep header unchanged) */
.history-two-col {
    max-width: 1200px;
    margin: 4em auto;
    padding: 1em;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2em;
    align-items: start;
}

.history-sidebar {
    position: sticky;
    top: 84px;
}

.history-sidebar .toc-list {
    border-top: none;
    padding-top: 0;
}

.history-sidebar .toc-list li p {
    margin: 0;
}

.history-sidebar .toc-list .history-loading-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.history-sidebar .toc-list .history-loading-item::marker {
    content: "";
}

.history-sidebar .toc-list li p a {
    display: block;
    width: 100%;
    padding: 0.4em 0.5em;
    border-radius: 6px;
}

.history-detail .HIStrings {
    margin-top: 0;
    margin-bottom: 0.5em;
}

.history-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1em;
}

.history-release-heading {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35em 0.65em;
    min-width: 0;
    flex: 1;
}

.history-release-heading #releaseTitleLink {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.history-title-row > a {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.history-title-row .back-to-index {
    font-size: 0.95em;
    white-space: nowrap;
}

.history-detail .HIStrings p {
    margin: 0;
}

.history-detail #releaseTitle {
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.history-detail #releaseTitleLink {
    color: var(--base-color) !important;
    text-decoration: none !important;
}

.history-detail #releaseTitleLink:visited {
    color: var(--base-color) !important;
    text-decoration: none !important;
}

.history-detail #releaseTitleLink * {
    text-decoration: none !important;
}

.history-detail #releaseTitleLink:hover {
    text-decoration: underline !important;
}

.history-detail #releaseDownloadCount {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--footer-color);
    line-height: 1.2;
}

.history-detail #releaseDownloadCount[hidden] {
    display: none !important;
}

.history-content {
    border-top: 1px solid var(--border-color);
    margin-top: 0.4em;
    padding-top: 0.6em;
}

.history-content > :first-child {
    margin-top: 0;
}

.history-mobile-tasks {
    display: none;
}

.history-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.7em;
    min-height: 2rem;
    color: var(--footer-color);
    font-size: 0.95rem;
}

.history-loading-label {
    line-height: 1.4;
}

.mac-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: conic-gradient(
        from 0deg,
        rgba(127, 127, 127, 0.18) 0deg,
        rgba(127, 127, 127, 0.28) 120deg,
        rgba(127, 127, 127, 0.9) 300deg,
        rgba(127, 127, 127, 1) 360deg
    );
    -webkit-mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 2px),
        #000 calc(100% - 1px)
    );
    mask: radial-gradient(
        farthest-side,
        transparent calc(100% - 2px),
        #000 calc(100% - 1px)
    );
    animation: mac-spinner-rotate 0.75s linear infinite;
}

.history-content .history-loading,
.history-mobile-tasks .history-loading,
.history-sidebar .history-loading {
    display: flex;
    justify-content: center;
    padding: 2.5em 0;
}

.history-sidebar .history-loading {
    display: flex;
    padding: 0.4em 0.5em;
}

@keyframes mac-spinner-rotate {
    to {
        transform: rotate(360deg);
    }
}

.toc-list a[aria-current="page"] {
    font-weight: 700;
}

@media all and (max-width: 900px) {
    .history-two-col {
        grid-template-columns: 1fr;
        margin: 2em auto;
        padding: 0 1em;
    }

    .history-sidebar {
        position: relative;
        top: auto;
    }
}

@media all and (max-width: 736px) {
    .history-two-col {
        margin: 1.25em auto;
        gap: 1.25em;
    }

    .history-detail #releaseTitle {
        font-size: 1.2rem;
    }

    .history-title-row {
        align-items: flex-start;
        flex-wrap: wrap;
        row-gap: 0.5em;
    }

    .history-title-row .back-to-index {
        margin-left: auto;
        font-size: 0.9em;
    }

    .history-sidebar {
        display: none;
    }

    .history-detail {
        position: relative;
        padding-top: 2.25em;
    }

    .history-detail .back-to-index {
        position: absolute;
        top: 0;
        left: 0;
        z-index: 1;
        margin: 0;
        font-size: 0.9em;
        line-height: 1.4;
    }

    .history-detail #releaseTitleLink {
        display: none;
    }

    .history-detail #releaseDownloadCount {
        display: none !important;
    }

    .history-detail .HIStrings {
        display: block;
        margin-bottom: 0;
    }

    .history-detail .history-content {
        display: none;
    }

    .history-mobile-tasks {
        display: block;
    }

    .history-mobile-tasks .TaskButtonName {
        display: flex;
        align-items: baseline;
        gap: 0.5em;
        flex-wrap: wrap;
    }

    .history-mobile-tasks .task-download-count {
        font-size: 0.85rem;
        font-weight: 400;
        color: var(--footer-color);
    }
}
