/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* scroll-snap-type: y mandatory; */
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #ffffff;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

/* 深色渐变背景 */
body {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #533483 75%, #8b5cf6 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* 首页背景图片 */
.home-page {
    background-image: url('../images/backgrounds/home-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 多元兼容页面背景图片 */
.compatibility-page {
    background-image: url('../images/backgrounds/compatibility-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 免费开源页面背景图片 */
.opensource-page {
    background-image: url('../images/backgrounds/opensource-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* FAQ页面背景图片 */
.faq-page {
    background-image: url('../images/backgrounds/faq-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    /* scroll-snap-align: none; */
}

.nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 100%;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.125rem;
    transition: color 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 确保button元素也继承nav-link样式 */
button.nav-link {
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: #8b5cf6;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(246deg) brightness(104%) contrast(97%);
}

/* GitHub链接样式 */
.github-link {
    padding: 10px !important;
    min-width: 44px;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
}

.github-link .nav-icon {
    width: 24px;
    height: 24px;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 2px;
    background: #8b5cf6;
}

.nav-icon {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
    transition: filter 0.3s ease;
}

.download-dropdown {
    position: relative;
    display: inline-block;
}

.download-btn {
    background: #8b5cf6;
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    line-height: 1;
    height: auto;
    min-height: 40px;
}

.download-btn:hover {
    background: #7c3aed;
    /*transform: translateY(-2px);*/
}

.download-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 10px 0;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.download-dropdown:hover .download-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.download-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    justify-content: flex-start;
    white-space: nowrap;
}

.download-option:hover {
    background: rgba(139, 92, 246, 0.2);
    color: #ffffff;
}

.download-option img {
    width: 20px;
    height: 20px;
}

.download-option span {
    font-size: 1.3rem;
    font-weight: 500;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: #ffffff;
    transition: 0.3s;
}

/* 页面区域 */
.page-section {
    width: 100%;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 70px;
    padding-bottom: 20px;
    box-sizing: border-box;
    margin: 0 auto;
    max-width: 100%;
    overflow-x: hidden;
    /* scroll-snap-align: start; */
    /* scroll-snap-stop: always; */
}

/* 首页样式 */
.hero-section {
    position: relative;
    width: 100%;
    max-width: 1920px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
    margin-bottom: 40px;
}

.hero-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.title-icon {
    width: 48px;
    height: 48px;
}

.hero-title h1 {
    font-size: 3.8rem;
    font-weight: bold;
    color: #ffffff;
}

.hero-description {
    font-size: 1.4rem;
    line-height: 1.8;
    margin-bottom: 40px;
    color: #e5e7eb;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-content .dropdown-button {
    background-color: #fff;
    color: #333;
    padding: 12px 24px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    font-weight: 500;
}

.hero-content .download-button-group {
    position: relative;
}

.hero-content .download-button-group:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    z-index: 1;
}

.hero-content .dropdown-button:hover {
    background-color: #f0f0f0;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.hero-content .dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background-color: #fff;
    min-width: 200px;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.hero-content .download-button-group:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.hero-content .dropdown-item {
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    font-size: 14px;
}

.hero-content .dropdown-item:last-child {
    border-bottom: none;
}

.hero-content .dropdown-item:hover {
    background-color: #667eea;
    color: #fff;
}

.download-btn-platform {
    background: transparent;
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
}

.download-btn-platform:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    color: #ffffff;
    text-decoration: none;
}

.download-btn-platform img {
    width: 20px;
    height: 20px;
}

/* 产品展示区域 */
.product-showcase {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    overflow: hidden;
    box-sizing: border-box;
}

.laptop-mockup {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

.laptop-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    max-height: 500px;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* 多元兼容页面样式 */
.compatibility-page {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    box-sizing: border-box;
}

.compatibility-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    padding: 0 20px;
    box-sizing: border-box;
}

.feature-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 50px;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
    gap: 0;
    padding: 0 20px;
    box-sizing: border-box;
}

.feature-nav-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(26, 26, 46, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    height: 48px;
    position: relative;
    border-right: none;
}

/* 强制覆盖所有可能的样式 */
.feature-nav .feature-nav-item {
    gap: 10px !important;
}

.compatibility-container .feature-nav-item {
    gap: 10px !important;
}

.feature-nav-item:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.feature-nav-item:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.feature-nav-item.active {
    background: rgba(139, 92, 246, 0.2);
}

.feature-nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #8b5cf6;
}

.feature-nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.feature-nav-item span {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 400;
}

.feature-icon {
    width: 14px !important;
    height: 14px !important;
    max-width: 14px !important;
    max-height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    margin: 0 !important;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

.feature-nav-item.active .feature-icon {
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(246deg) brightness(104%) contrast(97%);
}

.compatibility-content {
    text-align: center;
    margin-bottom: 40px;
}

.content-title {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    margin-bottom: 30px;
}

/* 强制覆盖所有可能的样式 */
.compatibility-content .content-title {
    gap: 10px !important;
}

.tab-content .content-title {
    gap: 10px !important;
}

/* 最强制性的覆盖 */
div.content-title {
    gap: 10px !important;
}

div.feature-nav-item {
    gap: 10px !important;
}

/* 针对具体元素 - 使用负margin强制减少间距 */
.feature-nav-item img + span {
    margin-left: -5px !important;
}

.content-title img + h1 {
    margin-left: -8px !important;
}

/* 更极端的方法 - 直接设置负margin */
.feature-nav-item span {
    margin-left: -10px !important;
}

.content-title h1 {
    margin-left: -15px !important;
}

/* 强制设置图标和文字的间距为0或负数 */
.feature-nav-item {
    gap: -5px !important;
}

.content-title {
    gap: -10px !important;
}

.title-icon {
    width: 60px !important;
    height: 60px !important;
    max-width: 60px !important;
    max-height: 60px !important;
    min-width: 60px !important;
    min-height: 60px !important;
    margin: 0 !important;
    filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(246deg) brightness(104%) contrast(97%);
}

.content-title h1 {
    font-size: 3.2rem;
    font-weight: bold;
    color: #8b5cf6;
}

.content-description {
    font-size: 1.3rem;
    line-height: 1.8;
    color: #b0b0b0;
    max-width: 800px;
    margin: 0 auto;
}

/* 免费开源页面样式 */
.opensource-page {
    width: 100%;
    max-width: 1920px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.opensource-container {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
    width: 100%;
    max-width: 800px;
    box-sizing: border-box;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* 免费开源页面宽度控制 - 分屏幕尺寸精确控制 */
@media (min-width: 1200px) {
    .opensource-container {
        max-width: 800px;
        padding: 40px;
    }
}

@media (max-width: 1199px) and (min-width: 992px) {
    .opensource-container {
        max-width: 85%;
        padding: 35px 30px;
    }
}

@media (max-width: 991px) and (min-width: 769px) {
    .opensource-container {
        max-width: 90%;
        padding: 30px 25px;
    }
}

@media (max-width: 768px) {
    .opensource-container {
        max-width: 95%;
        padding: 25px 20px;
        grid-template-columns: 1fr;
        gap: 25px;
    }
}


.opensource-content {
    text-align: left;
}

.opensource-title {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.opensource-title h1 {
    font-size: 2.8rem;
    font-weight: bold;
    color: #ffffff;
}

.opensource-description {
    font-size: 1.4rem;
    line-height: 1.8;
    color: #e5e7eb;
}

.opensource-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}


.grid-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.grid-item {
    background: rgba(26, 26, 46, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-sizing: border-box;
}

.grid-item:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    transform: translateY(-2px);
    text-decoration: none;
}

.grid-icon {
    width: 32px;
    height: 32px;
}

.grid-item span {
    font-size: 1.1rem;
    color: #ffffff;
}

.grid-item:hover span {
    color: #ffffff;
}

/* FAQ页面样式 */
.faq-page {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding-top: 100px;
    padding-bottom: 50px;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
}

.faq-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    flex: 1;
    margin-bottom: 100px;
    padding: 0 20px;
    padding-bottom: 80px;
    box-sizing: border-box;
}

.faq-list {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

.faq-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
}

.faq-title h1 {
    font-size: 3.2rem;
    font-weight: bold;
    color: #ffffff;
}


.faq-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    margin-bottom: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
}

.faq-item.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
}

.faq-question {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 1.3rem;
    font-weight: 500;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
}

.faq-question span {
    flex: 1;
    text-align: left;
}

.faq-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 15px;
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    color: #e5e7eb;
    line-height: 1.6;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    text-align: left;
    word-wrap: break-word;
    /* 确保滚动条被隐藏 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.faq-answer::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.faq-item.active .faq-answer {
    max-height: 300px;
    padding: 10px 20px 15px;
    text-align: left;
    overflow: hidden;
}

.copyright {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: #9ca3af;
    font-size: 1.1rem;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.9);
    padding: 12px 24px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* scroll-snap-align: none; */
}

.visitor-counter {
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #8b5cf6;
}

.counter-icon {
    font-size: 1rem;
}

.counter-text {
    color: #9ca3af;
}

#visitor-count {
    color: #8b5cf6;
    font-weight: 600;
}

/* 免费开源页面图标样式覆盖 */
.opensource-page .title-icon {
    width: 60px;
    height: 60px;
    filter: brightness(0) invert(1) !important;
}

/* 社群按钮样式 */
.community-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.125rem !important;
}

.community-btn:hover,
.community-btn:focus {
    outline: none;
}

/* 强制设置社群按钮字体大小 */
button.nav-link.community-btn {
    font-size: 1.125rem !important;
}

/* 文档按钮样式 */
.nav-link[onclick*="window.open"] {
    background: none !important;
    border: none !important;
    color: #ffffff !important;
    text-decoration: none !important;
    font-size: 1.125rem !important;
    transition: color 0.3s ease !important;
    position: relative !important;
    cursor: pointer !important;
    font-family: inherit !important;
    padding: 0 !important;
    margin: 0 !important;
}

.nav-link[onclick*="window.open"]:hover {
    color: #8b5cf6 !important;
}

.nav-link[onclick*="window.open"]:focus {
    outline: none !important;
}

/* 二维码模态框样式 */
.qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.qr-modal-content {
    background: rgba(26, 26, 46, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.qr-image {
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.qr-close-btn {
    background: #8b5cf6;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.qr-close-btn:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

.qr-close-btn:active {
    transform: translateY(0);
}

/* Tab内容区域样式 */
.tab-content {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    height: auto;
    min-height: 0;
}

.tab-content.active {
    display: block;
    opacity: 1;
    overflow: hidden;
}

/* Tab切换动画 */
.tab-content {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 防止tab切换时出现滚动条 */
.tab-content {
    overflow: hidden !important;
}

.tab-content * {
    overflow: hidden;
}

.tab-content.active {
    overflow: hidden !important;
}

.tab-content.active * {
    overflow: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .qr-modal-content {
        padding: 20px;
        max-width: 350px;
    }
    
    .qr-image {
        max-width: 250px;
    }
}



/* ======= 语言切换滑块样式 ======= */
.lang-toggle {
  position: relative;
  width: 70px;
  height: 30px;
  border-radius: 30px;
  background: linear-gradient(145deg, #2f2f52, #1f1f3a);
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 15px;
  user-select: none;
}

.lang-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 30px;
  overflow: hidden;
}

.lang-option {
  position: absolute;
  width: 50%;
  text-align: center;
  line-height: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  z-index: 2;
  transition: color 0.3s ease;
}

.lang-option.zh {
  left: 0;
  color: #fff;
}

.lang-option.en {
  right: 0;
  color: #999;
}

.lang-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 32px;
  height: 26px;
  border-radius: 30px;
  background: #8b5cf6;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

/* 英文状态 */
.lang-toggle.active .lang-slider {
  transform: translateX(36px);
  background: #4f46e5;
}

.lang-toggle.active .lang-option.zh {
  color: #999;
}

.lang-toggle.active .lang-option.en {
  color: #fff;
}

.lang-toggle:hover .lang-slider {
  filter: brightness(1.1);
}

/* 禁止语言切换器出现下划线 */
.lang-toggle.nav-link::after {
  content: none !important;
}
/* =========================================================
   🟣 OpenChat 文档页完整样式（整合优化版）
   ========================================================= */

/* === 页面整体布局 === */
.docs-layout {
  display: flex;
  height: 100vh;
  background: linear-gradient(180deg, #1a1a3a 0%, #3a1a5a 100%) !important;
  overflow: hidden;
}

/* === 左侧侧边栏 === */
.docs-sidebar {
  width: 240px;
  background: linear-gradient(180deg, #19133a, #241352);
  border-right: 1px solid rgba(255,255,255,0.1);
  padding: 20px 16px;
  color: #fff;
  overflow-y: auto;
  backdrop-filter: blur(8px);
}

.docs-sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 15px;
  color: #c4b5fd;
}

/* === 返回首页按钮 === */
.docs-sidebar .back-home-btn {
  display: block;
  width: 85%;
  margin: 5px auto 15px;
  background: linear-gradient(135deg, #7c3aed, #8b5cf6);
  color: #fff;
  border: none;
  padding: 6px 0;
  border-radius: 6px;
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.docs-sidebar .back-home-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  transform: scale(1.03);
}

/* === 文档导航 === */
.docs-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}
.docs-link {
  display: block;
  color: #d1d5db;
  padding: 8px 10px;
  border-radius: 6px;
  margin-bottom: 6px;
  transition: all 0.2s;
}
.docs-link:hover {
  background: rgba(139,92,246,0.2);
  color: #c4b5fd;
}
.docs-link.active {
  background: rgba(139,92,246,0.3);
  color: #fff;
  font-weight: 600;
}

/* === 右侧主内容容器 === */
.docs-container {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 40px 48px;
  background: linear-gradient(180deg, #1a1438, #2a1658);
  color: #e5e7eb;
  scroll-behavior: smooth;
}

/* =========================================================
   📖 Markdown 内容渲染区
   ========================================================= */

.docs-content,
.markdown-content {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 30px;
  color: #E6E8F0;
  font-size: 15px;
  line-height: 1.8;
  word-break: break-word;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
}

/* 标题层次与间距 */
.docs-content h1, .markdown-content h1 { font-size: 1.875rem; margin: 1.2em 0 0.6em; color: #F5F7FB; }
.docs-content h2, .markdown-content h2 { font-size: 1.5rem;   margin: 1.1em 0 0.6em; color: #F1F4FA; }
.docs-content h3, .markdown-content h3 { font-size: 1.25rem;  margin: 1.0em 0 0.5em; color: #EDEFF7; }

/* 段落与行距 */
.docs-content p, .markdown-content p {
  margin: 0.85rem 0 1rem;
  line-height: 1.85;
}

/* 列表与缩进 */
.docs-content ul,
.docs-content ol,
.markdown-content ul,
.markdown-content ol {
  margin: 0.5rem 0 1rem 1.5rem;
}
.docs-content li, .markdown-content li {
  margin: 0.35rem 0;
  line-height: 1.8;
}

/* 引用块 */
.docs-content blockquote,
.markdown-content blockquote {
  margin: 1.2rem 0;
  padding: 0.85rem 1rem;
  border-left: 4px solid #a78bfa;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  color: #D5D9E6;
}

/* 代码块 */
.docs-content pre, .markdown-content pre {
  background: rgba(0,0,0,0.45);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  margin: 1.1rem 0;
  overflow-x: auto;
}
.docs-content code, .markdown-content code {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 0.15rem 0.35rem;
  font-family: "JetBrains Mono", monospace;
  color: #ffb4b4;
}

/* 链接颜色优化 */
.docs-content a, .markdown-content a {
  color: #93c5fd;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.docs-content a:hover, .markdown-content a:hover {
  color: #bfdbfe;
  text-decoration-thickness: 2px;
}

/* 分割线 */
.docs-content hr, .markdown-content hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.18);
  margin: 1.5rem 0;
}

/* 表格 */
.markdown-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
}
.markdown-content th, .markdown-content td {
  border: 1px solid #4b5563;
  padding: 0.5em 1em;
}
.markdown-content th {
  background: rgba(255,255,255,0.05);
  color: #e5e7eb;
}

/* =========================================================
   🌈 滚动条样式（文档页 + 首页）
   ========================================================= */

/* 文档页滚动条 */
body.docs-mode .docs-container::-webkit-scrollbar {
  width: 10px;
}
body.docs-mode .docs-container::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
  border-radius: 8px;
  border: 2px solid #1a1438;
}
body.docs-mode .docs-container::-webkit-scrollbar-track {
  background: #1a1438;
}

/* 左侧导航栏滚动条 */
body.docs-mode .docs-sidebar::-webkit-scrollbar {
  width: 8px;
}
body.docs-mode .docs-sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #8b5cf6);
  border-radius: 8px;
}
body.docs-mode .docs-sidebar::-webkit-scrollbar-track {
  background: #19133a;
}

/* Firefox 兼容 */
body.docs-mode .docs-container {
  scrollbar-width: thin;
  scrollbar-color: #8b5cf6 #1a1438;
}

/* 全局滚动条（首页） */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
  width: 10px;
}
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #a78bfa, #7c3aed);
  border-radius: 10px;
  border: 2px solid #1a1438;
}
html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track {
  background: #1a1438;
}
html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #c4b5fd, #8b5cf6);
}

/* =========================================================
   🧭 文档模式布局逻辑
   ========================================================= */

/* 首页可滚动 */
html, body {
  height: auto;
  overflow: auto;
}

/* 文档模式禁用主滚动条 */
body.docs-mode {
  overflow: hidden;
  height: 100vh;
}

/* 文档页容器 */
body.docs-mode .docs-layout {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* 返回顶部按钮层级 */
.scroll-to-top {
  z-index: 3000 !important;
}

/* =========================================================
   📱 响应式布局
   ========================================================= */
@media (max-width: 768px) {
  .docs-layout { flex-direction: column; }
  .docs-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
}


/* ✅ 强制文档模式布局接管 */
body.docs-mode {
  overflow: hidden !important;
  height: 100vh !important;
}

body.docs-mode .docs-layout {
  display: flex !important;
  height: 100vh !important;
  overflow: hidden !important;
}

body.docs-mode .docs-container {
  overflow-y: auto !important;
}

body.docs-mode .docs-sidebar {
  overflow-y: auto !important;
}

:root {
  --navbar-h: 36px; /* 按你的导航实际高度改，56/64/72 */
}

/* 文档模式下整体往下错开导航的高度，并同步修正高度计算 */
body.docs-mode .docs-layout {
  /* ⬅︎ 关键：让文档区整体下移，避免被导航遮挡 */
  margin-top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow: hidden;
}

/* 左侧栏与右侧内容都以“导航高度”作为可视高度 */
body.docs-mode .docs-sidebar,
body.docs-mode .docs-container {
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
}

/* 让左侧“返回首页”按钮不要贴边顶住导航，留一点上内边距即可 */
body.docs-mode .docs-sidebar {
  padding-top: 12px; /* 你可以调成 16/20 视视觉情况 */
}

/* 右侧内容也可微调上内边距，让第一行不贴边 */
body.docs-mode .docs-container {
  padding-top: 12px; /* 可按需调小/去掉 */
}

/* 统一所有顶部导航项的布局（a 与 button 都适用） */
.navbar .nav-menu .nav-link{
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;      /* 和现有保持一致即可 */
  line-height: 1;         /* 关键：统一基线，避免下划线位置不一致 */
}

/* 统一的“下划线”效果（hover 或 active 才出现） */
.navbar .nav-menu .nav-link::after{
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;           /* 下划线与文字间距，想更近改为 -6px/-4px */
  height: 2px;
  background: transparent;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease, background .2s ease;
}

/* 显示下划线 */
.navbar .nav-menu .nav-link:hover::after,
.navbar .nav-menu .nav-link.active::after{
  background: #a78bfa;
  transform: scaleX(1);
}

/* 图标按钮不需要下划线 */
.navbar .nav-menu .github-link::after{
  display: none;
}


/* === 仅修两个问题：文档字号 & 下划线作用域 === */

/* 1) 让 button.nav-link 的字号与 a.nav-link 完全一致（修复“文档”变小） */
.navbar .nav-menu button.nav-link {
  font-size: 1.125rem;           /* 与 .nav-link 保持一致 */
  font-weight: inherit;        /* 不改粗细，跟随现有样式 */
  line-height: inherit;        /* 跟随现有行高，避免与其它项不齐 */
}

/* 2) 下划线效果只给“真正的文本导航项”，不影响语言开关/图标按钮 */
.navbar .nav-menu a.nav-link,
.navbar .nav-menu button.nav-link[data-target] {   /* 只匹配像“文档”这类有 data-target 的按钮 */
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 统一的下划线（hover/active 才出现） */
.navbar .nav-menu a.nav-link::after,
.navbar .nav-menu button.nav-link[data-target]::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -8px;                /* 下划线与文字间距，想更近可调成 -6px/-5px */
  height: 2px;
  background: transparent;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .2s ease, background .2s ease;
}
.navbar .nav-menu a.nav-link:hover::after,
.navbar .nav-menu a.nav-link.active::after,
.navbar .nav-menu button.nav-link[data-target]:hover::after,
.navbar .nav-menu button.nav-link[data-target].active::after {
  background: #a78bfa;
  transform: scaleX(1);
}

/* ======= 文档侧边栏样式优化：更简洁大方 ======= */

/* “文档导航”标题 */
.docs-sidebar h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #c4b5fd;
  letter-spacing: 0.3px;
  margin: 20px 0 14px;
}

/* 导航项整体放大一点 */
.docs-nav .docs-link {
  display: block;
  font-size: 1rem;
  color: #d1d5db;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;        /* ✅ 间距变大 */
  transition: all 0.2s ease;
}

/* hover 效果轻柔一点，不改背景色 */
.docs-nav .docs-link:hover {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  transform: translateX(3px);
}

/* 选中项保持统一风格，不再整块变紫 */
.docs-nav .docs-link.active {
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
  font-weight: 600;
  transform: none;
  box-shadow: none;
}

/* 让 markdown 第一行标题顶格，不留白 */
.markdown-content h1:first-child,
.markdown-content h2:first-child,
.markdown-content h3:first-child {
  margin-top: 0 !important;
}

/* 同时去掉 markdown 容器默认上内边距 */
.docs-container,
.markdown-content {
  padding-top: 5 !important;
  margin-top: 5 !important;
}
