/* Fonts - 使用国内镜像以确保正常加载 */
@import url('https://fonts.geekzu.org/css2?family=Nunito:wght@400;700;900&display=swap');

:root {
    --primary-yellow: #FFD04B;
    --primary-orange: #FF9E42;
    --accent-blue: #54C1FF;
    --accent-green: #7ED321;
    --text-dark: #4A3B2A;
    --text-light: #8D7B68;
    --bg-cream: #FFFDF5;
    --card-bg: #FFFFFF;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --shadow-soft: 0 8px 24px rgba(255, 158, 66, 0.15);
    --shadow-card: 0 4px 12px rgba(74, 59, 42, 0.08);
}

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

body {
    font-family: 'Nunito', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-cream);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout */
.main-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

/* Sidebar TOC */
.sidebar-toc {
    width: 260px;
    position: sticky;
    top: 40px;
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding-right: 20px;
    margin-top: 60px;
    z-index: 1001;
    /* Ensure higher than lightbox but below some UI if needed */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-toc::-webkit-scrollbar {
    width: 6px;
}

.sidebar-toc::-webkit-scrollbar-thumb {
    background: var(--primary-yellow);
    border-radius: 10px;
}

.toc-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
}

.toc-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toc-item {
    background: white;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    text-align: left;
    box-shadow: var(--shadow-card);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.toc-item:hover {
    border-color: var(--primary-yellow);
    transform: translateX(5px);
}

.toc-item .num {
    background: var(--primary-orange);
    color: white;
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 900;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toc-item span {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.9rem;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(2px);
}

/* Content Area */
.content-area {
    flex: 1;
    padding-bottom: 80px;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 900;
    color: var(--text-dark);
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    text-align: center;
}

h3 {
    font-size: 1.5rem;
    color: var(--primary-orange);
    margin-bottom: 16px;
    border-left: 5px solid var(--primary-yellow);
    padding-left: 12px;
}

p {
    font-size: 1.05rem;
    color: #555;
}

a {
    text-decoration: none;
}

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

/* Hero Section */
.hero {
    background: linear-gradient(180deg, #FFF8E1 0%, #FFFDF5 100%);
    padding: 80px 0 60px;
    text-align: center;
}

.hero h1 .version {
    background: var(--primary-yellow);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.5em;
    vertical-align: middle;
}

.download-area {
    background: #FFF;
    border: 4px solid var(--primary-yellow);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 500px;
    margin: 0 auto 40px;
    box-shadow: var(--shadow-soft);
}

/* Feature Rows */
.feature-row {
    display: flex;
    align-items: center;
    gap: 40px;
    margin-bottom: 60px;
    padding: 25px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    scroll-margin-top: 60px;
    /* Increased for better anchor spacing */
}

.feature-img-col {
    flex: 1.8;
}

.feature-img-col img {
    width: 100%;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft);
    cursor: zoom-in;
    transition: transform 0.2s;
}

.feature-img-col img:hover {
    transform: scale(1.02);
}

.feature-text-col {
    flex: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    padding: 16px 32px;
    font-weight: 900;
    color: white;
    background: var(--primary-orange);
    border-radius: 50px;
    border-bottom: 6px solid #E07C18;
    transition: all 0.1s;
    cursor: pointer;
}

.btn:active {
    transform: translateY(4px);
    border-bottom-width: 2px;
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border-bottom-color: #DDD;
}

.btn-block {
    width: 100%;
}

/* Lightbox */
#lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    /* Highest priority */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

#lightbox img {
    max-width: 95%;
    max-height: 95%;
    transform: scale(0.9);
    transition: transform 0.3s;
}

#lightbox.active img {
    transform: scale(1);
}

/* Floating Nav */
.floating-nav {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1002;
    /* Above sidebar */
}

.float-btn {
    width: 54px;
    height: 54px;
    background: var(--primary-yellow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: 3px solid white;
    cursor: pointer;
    font-weight: 900;
    color: var(--text-dark);
}

.float-btn:hover {
    background: var(--primary-orange);
    color: white;
    transform: scale(1.1);
}

/* Responsive */
@media (max-width: 1100px) {
    .sidebar-toc {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        background: var(--bg-cream);
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        padding: 30px 20px;
        margin-top: 0;
        transform: translateX(-105%);
        width: 300px;
    }

    .main-wrapper {
        display: block;
    }

    .sidebar-toc.active {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
}

@media (max-width: 900px) {
    .feature-row {
        flex-direction: column;
    }

    .hero {
        padding: 40px 0;
    }
}

/* Footer */
footer {
    background: #F0EDE4;
    padding: 60px 0 40px;
    margin-top: 80px;
    border-top: 2px solid var(--primary-yellow);
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.footer-logo img {
    width: 32px;
}

.disclaimer {
    font-size: 0.9rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
    padding: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-sm);
}

html {
    scroll-behavior: smooth;
}

.mobile-menu-btn {
    display: none;
}