/* 电脑端样式 */
/* 通用样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

nav {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: #333;
}

.nav-logo img {
    width: 32px;
    height: 32px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

footer {
    position: relative;
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    background: white;
    z-index: 1;
}

.language-switch {
    position: relative;
    display: inline-block;
    margin-left: 1rem;
}

.language-switch-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
}

.language-switch-btn img {
    width: 20px;
    height: 20px;
}

.language-switch-btn:hover::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #333;
    opacity: 0.2;
    border-radius: 6px;
}

.language-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 0.5rem 0;
    min-width: 120px;
}

.language-switch:hover .language-dropdown {
    display: block;
}

.language-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: #666;
    transition: background-color 0.3s ease;
}

.language-dropdown a:hover {
    background-color: #f5f5f5;
}

.loading-language [data-i18n],
.loading-language [data-i18n-img] {
    opacity: 0;
    transition: opacity 0.2s ease;
}

[data-i18n],
[data-i18n-img] {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* index 页面特定样式 */
.section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 60px 0;
    gap: 40px;
}

.section:nth-child(even) {
    flex-direction: row-reverse;
}

.content {
    flex: 1;
    max-width: 640px;
}

.content h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.content p {
    color: #666;
    margin-bottom: 15px;
    text-align: justify;
    text-justify: inter-ideograph;
    word-break: break-word;
    hyphens: auto;
}

.image {
    flex: 1;
    text-align: center;
}

.image img {
    max-width: 300px;
    height: auto;
}

.download-section {
    text-align: center;
    margin-top: 60px;
    padding: 40px 0;
    background-color: #f0f0f0;
}

.download-section h2 {
    font-size: 24px;
    margin-bottom: 20px;
}

.qr-codes {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.qr-code {
    text-align: center;
}

.qr-code img {
    width: 150px;
    height: 150px;
    margin-bottom: 10px;
}

.download-section2 {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
}

.download-item {
    position: relative;
	max-width: 206px;
}

.download-button {
    padding: 12px 24px;
    background-color: #333;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    text-align: center;
    gap: 8px;
    transition: background-color 0.3s ease;
}

.download-button:hover {
    background-color: #555;
}

.qr-popup {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    text-align: center;
}

.qr-popup img {
    width: 150px;
    height: 150px;
    margin-bottom: 8px;
}

.qr-popup p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

/* 非移动端显示二维码 */
@media (min-width: 769px) {
    /* 显示二维码 */
    .qr-codes {
        display: flex;
    }

    /* 隐藏下载按钮 */
    .download-section .download-section2 {
        display: none;
    }

    /* 保持二维码悬浮显示 */
    .download-item:hover .qr-popup {
        display: block;
    }
}

/* about、contact、404 页面共同样式 */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
    margin: 0 auto;
}

.content-section {
    display: flex;
    padding: 120px 100px;
    flex-direction: column;
    align-items: center;
	min-width: 50vw;
    justify-content: center;
}

.content-section h1 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.content-section p {
    font-size: 1.1rem;
    color: #666;
    max-width: 500px;
    margin-bottom: 2rem;
    text-align: justify;
    text-justify: inter-ideograph;
    word-break: break-word;
    hyphens: auto;
}

/* about、contact 页面特定样式 */
.about.image-section,
.contact.image-section {
    min-height: 100vh;
}

/* 为每个页面添加特定的背景图片 */
.about.image-section {
    background: url('../img/about.webp?height=1080&width=1080') center/cover;
}

.contact.image-section {
    background: url('../img/c.webp?height=1080&width=1080') center/cover;
}

/* 404 页面特定样式 */
.error404.image-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: none;
}

.error404.image-section img {
    width: 300px;
    height: auto;
    object-fit: contain;
}

/* 移动端样式 */
/* 通用样式 */
@media (max-width: 768px) {
    nav {
        position: relative;
        padding-top: 0;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 10px;
        position: relative;
    }

    .nav-links {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }

    .nav-links a {
        font-size: 14px;
        padding: 5px 10px;
    }

    .language-switch {
        position: absolute;
        top: 10px;
        right: 10px;
        margin: 0;
        z-index: 1001;
        background-color: white;
        padding: 5px;
        border-radius: 4px;
        box-shadow: none;
    }

    .language-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        transform: none;
        margin-top: 5px;
    }

    .nav-logo {
        margin-top: 0;
        align-self: center;
    }
}

/* index 页面特定样式 */
@media (max-width: 768px) {
    .section {
        flex-direction: column;
    }
    
    .section h2 {
        flex-direction: column;
        text-align: center;
    }

    .section:nth-child(even) {
        flex-direction: column;
    }
    
    .content {
        max-width: 100%;
    }
    
    .qr-codes {
        display: none;
    }
    
    .download-buttons {
        display: flex;
    }
}

/* about、contact、404 页面共同样式 */
@media (max-width: 768px) {
    .split-layout {
        grid-template-columns: 1fr;
    }

    .content-section {
        padding: 20px;
        margin-top: 20px;
    }

    .image-section {
        width: 100vw;
        height: 50vh;
        background-size: cover;
        background-position: center;
        margin: 0;
        padding: 0;
    }

    .about.image-section,
    .contact.image-section {
        width: 100vw;
        min-height: 50vh;
        background-size: cover;
        background-position: center;
    }

    footer {
        position: relative;
    }
}

/* index 页面特定样式 */
.home-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    margin-top: -200px;
    position: relative;
    z-index: 2;
}

.home-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    gap: 0;
}

.typing-text {
    color: #333;
    padding-right: 4px;
    margin: 0;
    white-space: nowrap;
    font-size: 30px;
    min-height: 1.2em;
    line-height: 1.2;
    display: block;
    visibility: visible !important;
    border-right: none;
    animation: none;
}

/* 屏幕宽度大于1000px */
@media screen and (min-width: 1000px) {
    .typing-text {
        font-size: 30px;
        min-height: 1.2em;
    }
}

/* 屏幕宽度大于1500px */
@media screen and (min-width: 1500px) {
    .typing-text {
        font-size: 48px;
        min-height: 1.2em;
    }
}

/* 屏幕宽度大于2000px */
@media screen and (min-width: 2000px) {
    .typing-text {
        font-size: 120px;
        min-height: 1.2em;
    }
}

/* 屏幕宽度大于3000px */
@media screen and (min-width: 3000px) {
    .typing-text {
        font-size: 190px;
        min-height: 1.2em;
    }
}

/* 光标动画 */
@keyframes cursor-blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

.typing-text::after {
    content: '';
    position: relative;
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #333;
    margin-left: 2px;
    vertical-align: middle;
    animation: cursor-blink 0.75s step-end infinite;
}



.learn-more-btn {
    padding: 15px 40px;
    font-size: 18px;
    color: white;
    background-color: #333;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.learn-more-btn:hover {
    background-color: #555;
}
.home-image {
    position: fixed;
    bottom: 55px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    width: 100vw;
    height: auto;
    object-fit: cover;
}
@media (min-aspect-ratio: 2096/1000) {
    .home-image {
        width: 100%;
        height: auto;
    }
}
@media (max-aspect-ratio: 2096/1000) {
    .home-image {
        width: auto;
        height: 100%;
    }
}

@media (max-width: 768px) {
    .home-image {
        width: auto;
        height: 100vh;
        object-fit: cover;
    }

    /* 移动端打字机文本样式 */
    .typing-text {
        width: calc(100% - 40px) !important; /* 两边20px边距 */
        margin: 0 20px;
        font-size: 30px; /* 初始字号 */
    }
}

/* readao 页面下载区域优化 */
@media (max-width: 768px) {
    .qr-codes {
        display: none;
    }

    .download-section {
        padding: 20px 10px;
        width: 100%;
    }

    .download-section2 {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        align-items: center;
    }

    .download-item {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
    }

    .download-button {
        width: calc(100% - 20px);
        margin: 0 10px;
        justify-content: center;
        max-width: 600px;
    }

    /* 显示移动端下载按钮 */
    .download-section .download-section2 {
        display: flex;
        margin-top: 20px;
    }

    .download-section h2 {
        margin-bottom: 20px;
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    /* 隐藏二维码 */
    .qr-codes {
        display: none;
    }

    /* 显示下载按钮 */
    .download-section .download-section2 {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        align-items: center;
        margin-top: 20px;
    }

    .download-section {
        padding: 20px 10px;
        width: 100%;
    }

    .download-item {
        width: 100%;
        max-width: 100%;
        display: flex;
        justify-content: center;
    }

    .download-button {
        width: calc(100% - 20px);
        margin: 0 10px;
        justify-content: center;
        max-width: 600px;
    }

    .download-section h2 {
        margin-bottom: 20px;
    }
}

/* 移动端适配 */
@media (max-width: 768px) {
    .content p,
    .content-section p {
        text-align: justify;
        text-justify: inter-ideograph;
        padding: 0 5px;
    }
}

/* 背景图样式 */
.home-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../img/home.webp');
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    margin-top: var(--nav-height); /* 导航栏高度 */
    margin-bottom: var(--footer-height); /* 页脚高度 */
}

/* 非移动端样式 */
@media (min-width: 769px) {
    .home-background {
        background-size: 100% auto; /* 宽度100%，高度自适应 */
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    :root {
        --nav-height: 120px; /* 导航栏实际高度 */
        --footer-height: 60px; /* 页脚实际高度 */
    }

    .home-background {
        background-size: auto calc(100vh - var(--nav-height) - var(--footer-height));
        height: calc(100vh - var(--nav-height) - var(--footer-height));
        position: absolute;
    }

    .home-container {
        margin-top: 0;
    }
}

/* 修改打字机容器样式 */
.typing-container {
    width: calc(100vw - 40px);
    margin: 0 auto;
    text-align: center;
    overflow-wrap: break-word;
    word-wrap: break-word;
    min-height: calc(1.2em * 2 + 20px); /* 两行文本高度加20px */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 60px;
}

/* 修改打字机文本样式 */
.typing-text {
    display: inline-block;
    position: relative;
    margin: 0;
    white-space: pre-wrap;
    max-width: 100%;
    line-height: 1.2;
    min-height: 1.2em;
    border-right: none;
}

/* 只有在启用打字机效果时才显示光标 */
.typing-text.typing-cursor::after {
    content: '';
    position: relative;
    display: inline-block;
    width: 2px;
    height: 1em;
    background-color: #333;
    margin-left: 2px;
    vertical-align: middle;
    animation: cursor-blink 0.75s step-end infinite;
}

/* 添加新的光标闪烁动画 */
@keyframes cursor-blink {
    from, to { opacity: 1; }
    50% { opacity: 0; }
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .typing-container {
        width: calc(100vw - 20px);
        min-height: calc(1.2em * 2 + 20px); /* 移动端保持相同的最小高度 */
        margin-bottom: 60px;
    }
    
    .typing-text {
        font-size: 24px;
    }
}