/* ================================
   Home page only
   ================================ */

/* 隐藏首页正文默认标题 */
body.home-page .md-content__inner > h1 {
    display: none !important;
}

/* 隐藏滚动后左上角出现的页面标题，例如 Index */
body.home-page .md-header__topic[data-md-component="header-topic"] {
    display: none !important;
}

/* 首页桌面端隐藏左右侧边栏，移动端保留抽屉导航 */
@media screen and (min-width: 76.25em) {
    body.home-page .md-sidebar--primary {
        display: none !important;
    }

    body.home-page .md-sidebar--secondary {
        display: none !important;
    }
}

body.home-page .md-footer {
    display: none !important;
}

/* 首页布局清理 */
body.home-page {
    overflow-x: hidden;
}

body.home-page .md-main {
    margin: 0 !important;
    padding: 0 !important;
}

body.home-page .md-main__inner {
    margin: 0 !important;
    padding: 0 !important;
}

body.home-page .md-content {
    margin: 0 !important;
    padding: 0 !important;
}

body.home-page .md-content__inner {
    margin: 0 !important;
    padding: 0 !important;
}

body.home-page .md-grid {
    max-width: 100% !important;
    padding-left: 2rem;
    padding-right: 2rem;
    padding-top: 0.3rem;
    box-sizing: border-box;
}

body.home-page .md-content__inner:before {
    display: none !important;
}


/* ================================
   Header
   ================================ */

body.home-page .md-header {
    box-shadow: none !important;
    border-bottom: none !important;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

body.home-page .md-header__inner {
    display: flex;
    align-items: center;
    width: 100%;
}

body.home-page .md-search {
    margin-left: auto;
}

/* header 左右边距 */
body.home-page .md-header__inner,
body.home-page .md-tabs__inner {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    box-sizing: border-box;
}

/* 深色模式 header */
body.home-page[data-md-color-scheme="slate"] .md-header {
    background-color: rgba(7, 10, 17, 0);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* 浅色模式 header */
body.home-page[data-md-color-scheme="default"] .md-header {
    background-color: rgba(255, 255, 255, 0);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}


/* ================================
   Hero section
   ================================ */

body.home-page .hero {
    min-height: 108vh;
    margin-top: calc(-1 * var(--md-header-height, 0px));
    padding-top: var(--md-header-height, 0px);

    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;

    position: relative;
    overflow: hidden;

    text-align: center;
    padding-left: 2rem;
    padding-right: 2rem;
    box-sizing: border-box;
}

body.home-page .hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

body.home-page .hero > * {
    position: relative;
    z-index: 1;
}

body.home-page .hero h1 {
    font-size: 5rem;
    line-height: 1;
    margin: 0 0 1.5rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

body.home-page .hero h3 {
    font-size: 2rem;
    color: var(--md-default-fg-color--light);
}


/* ================================
   Hero text
   ================================ */

body.home-page .subtitle {
    font-size: 1.5rem;
    line-height: 1.5;
    margin: 0 0 2.5rem;

    background: linear-gradient(90deg, #ffffff, #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.home-page .description {
    max-width: 700px;
    font-size: 1.25rem;
    line-height: 1.8;
    margin: 0 0 2rem;
    color: rgba(255, 255, 255, 0.75);
}


/* ================================
   Buttons
   ================================ */

body.home-page .hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

body.home-page .hero-buttons .md-button {
    border-radius: 999px;
    padding: 0.6rem 1.3rem;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: #9b41f043;
}

body.home-page .hero-buttons .md-button--primary {
    border-radius: 999px;
    padding: 0.6rem 1.3rem;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: #773cddc1;
}


/* ================================
   Dark mode
   ================================ */

body.home-page[data-md-color-scheme="slate"] .hero::before {
    background:
        radial-gradient(circle at 18% 24%, rgba(124, 58, 237, 0.18), transparent 38%),
        radial-gradient(circle at 82% 30%, rgba(20, 184, 166, 0.16), transparent 40%),
        linear-gradient(
            180deg,
            rgba(18, 9, 31, 1) 0%,
            rgba(15, 23, 42, 0.96) 38%,
            rgba(4, 47, 46, 0.45) 72%,
            rgba(15, 23, 42, 0) 100%
        );
}

body.home-page[data-md-color-scheme="slate"] .hero h1 {
    color: #ffffff;
}

body.home-page[data-md-color-scheme="slate"] .subtitle {
    background: linear-gradient(90deg, #ffffff, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.home-page[data-md-color-scheme="slate"] .description {
    color: rgba(255, 255, 255, 0.75);
}


/* ================================
   Light mode
   ================================ */

body.home-page[data-md-color-scheme="default"] .hero::before {
    background:
        radial-gradient(circle at 18% 26%, rgba(155, 65, 240, 0.16), transparent 38%),
        radial-gradient(circle at 82% 30%, rgba(20, 184, 166, 0.16), transparent 40%),
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(238, 242, 255, 0.95) 38%,
            rgba(236, 254, 255, 0.55) 72%,
            rgba(255, 255, 255, 0) 100%
        );
}

body.home-page[data-md-color-scheme="default"] .hero h1 {
    color: #0f172a;
}

body.home-page[data-md-color-scheme="default"] .subtitle {
    background: linear-gradient(90deg, #0f172a, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

body.home-page[data-md-color-scheme="default"] .description {
    color: rgba(15, 23, 42, 0.75);
}


/* ================================
   Main background fallback
   ================================ */

body.home-page[data-md-color-scheme="slate"] .md-main {
    background: #0f172a;
}

body.home-page[data-md-color-scheme="default"] .md-main {
    background: #ffffff;
}


/* ================================
   Login button
   ================================ */

.header-login-btn {
    margin-left: 0.75rem;
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* 深色模式 */
[data-md-color-scheme="slate"] .header-login-btn {
    background-color: rgba(255, 255, 255, 0.08);
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

[data-md-color-scheme="slate"] .header-login-btn:hover {
    background-color: rgba(255, 255, 255, 0.14);
}

/* 浅色模式 */
[data-md-color-scheme="default"] .header-login-btn {
    background-color: rgba(15, 23, 42, 0.06);
    color: #0f172a !important;
    border: 1px solid rgba(15, 23, 42, 0.08);
}

[data-md-color-scheme="default"] .header-login-btn:hover {
    background-color: rgba(15, 23, 42, 0.1);
}

body.home-page .md-header__inner {
    display: flex;
    align-items: center;
    width: 100%;
}

body.home-page .md-search {
    margin-left: auto;
}

.header-login-btn {
    margin-left: 0.75rem;
}


/* ================================
   Footer copyright
   ================================ */

.md-copyright {
    font-size: 0;
}

.md-copyright .md-copyright__highlight {
    display: block;
    font-size: 0.6rem;
}

.md-copyright a[href*="zensical"] {
    display: none !important;
}


/* ================================
   Home sections
   ================================ */

body.home-page .home-section-title {
    text-align: center;
    font-size: 2.5rem;
    line-height: 1.2;
    margin: 6rem 0 1rem;
}

body.home-page .home-section-description {
    max-width: 720px;
    margin: 0 auto 3rem;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
}

body.home-page .feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
    max-width: 1100px;
    margin: 0 auto 6rem;
}

body.home-page .feature-card {
    border-radius: 1.25rem;
    padding: 1.5rem;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.home-page .feature-card:hover {
    transform: translateY(-4px);
}

body.home-page .feature-card h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

body.home-page .feature-card p {
    margin: 0;
    line-height: 1.7;
}

body.home-page[data-md-color-scheme="slate"] .home-section-title {
    color: #ffffff;
}

body.home-page[data-md-color-scheme="slate"] .home-section-description {
    color: rgba(255, 255, 255, 0.72);
}

body.home-page[data-md-color-scheme="slate"] .feature-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
}

body.home-page[data-md-color-scheme="slate"] .feature-card h3 {
    color: #ffffff;
}

body.home-page[data-md-color-scheme="slate"] .feature-card p {
    color: rgba(255, 255, 255, 0.72);
}

body.home-page[data-md-color-scheme="default"] .home-section-title {
    color: #0f172a;
}

body.home-page[data-md-color-scheme="default"] .home-section-description {
    color: rgba(15, 23, 42, 0.72);
}

body.home-page[data-md-color-scheme="default"] .feature-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body.home-page[data-md-color-scheme="default"] .feature-card h3 {
    color: #0f172a;
}

body.home-page[data-md-color-scheme="default"] .feature-card p {
    color: rgba(15, 23, 42, 0.72);
}


/* ================================
   Mobile sidebar / drawer
   ================================ */

@media screen and (max-width: 76.24em) {
    body.home-page .md-sidebar--primary,
    body.home-page .md-sidebar--secondary {
        display: block !important;
    }

    body.home-page .md-sidebar {
        z-index: 1002 !important;
    }

    body.home-page .md-overlay {
        z-index: 1001 !important;
    }
}


/* ================================
   Responsive
   ================================ */

@media screen and (max-width: 1100px) {
    body.home-page .feature-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 1rem !important;
    }
}

@media screen and (max-width: 768px) {
    body.home-page .hero {
        min-height: 100vh;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    body.home-page .hero h1 {
        font-size: 3.5rem !important;
    }

    body.home-page .subtitle {
        font-size: 1.25rem !important;
    }

    body.home-page .description {
        font-size: 1.05rem !important;
        line-height: 1.7 !important;
    }

    body.home-page .hero-buttons {
        flex-direction: column !important;
        width: 100%;
    }

    body.home-page .hero-buttons .md-button,
    body.home-page .hero-buttons .md-button--primary {
        width: 100% !important;
        max-width: 240px !important;
        text-align: center;
    }

    body.home-page .md-header__inner,
    body.home-page .md-tabs__inner {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    body.home-page .home-section-title {
        font-size: 2rem !important;
        margin: 4rem 0 1rem !important;
    }

    body.home-page .home-section-description {
        font-size: 1rem !important;
        line-height: 1.7 !important;
        margin: 0 auto 2rem !important;
        padding: 0 1rem !important;
    }

    body.home-page .feature-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        max-width: 100% !important;
        margin: 0 auto 4rem !important;
    }

    body.home-page .feature-card {
        width: 100% !important;
        padding: 1.25rem !important;
    }

    body.home-page .feature-card h3 {
        font-size: 1.1rem !important;
    }

    body.home-page .feature-card p {
        font-size: 0.98rem !important;
        line-height: 1.7 !important;
    }
}

@media screen and (max-width: 480px) {
    body.home-page .hero {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    body.home-page .hero h1 {
        font-size: 2.75rem !important;
    }

    body.home-page .subtitle {
        font-size: 1.1rem !important;
        margin-bottom: 2rem !important;
    }

    body.home-page .description {
        font-size: 1rem !important;
    }

    body.home-page .hero-buttons .md-button,
    body.home-page .hero-buttons .md-button--primary {
        max-width: 100% !important;
    }

    body.home-page .home-section-title {
        font-size: 1.75rem !important;
        margin: 3rem 0 0.75rem !important;
    }

    body.home-page .home-section-description {
        font-size: 0.95rem !important;
        margin-bottom: 1.75rem !important;
        padding: 0 0.5rem !important;
    }

    body.home-page .feature-grid {
        margin-bottom: 3rem !important;
    }

    body.home-page .feature-card {
        padding: 1rem !important;
        border-radius: 1rem !important;
    }

    body.home-page .feature-card h3 {
        font-size: 1rem !important;
    }

    body.home-page .feature-card p {
        font-size: 0.95rem !important;
    }
}