/*!* EasyOfficeLab Main Styles *!*/
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #fff;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Header Styles */
.header {
    background: #000;
    color: #fff;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.header.scrolled {
    padding: 0.5rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

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

.logo {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo svg {
    width: 32px;
    height: 32px;
    margin-right: 10px;
    fill: #008aff;
    transition: fill 0.3s ease;
}

.logo:hover svg {
    fill: #38bdf8;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
    font-weight: bold;
}

.nav a {
    color: #fff;
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #008aff;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav a:hover::after,
.nav a.active::after {
    width: 100%;
}

.nav a:hover,
.nav a.active {
    color: #008aff;
}

/* 完全修复的下拉菜单 - 无缝hover */
.dropdown {
    position: relative;
}

.dropdown-toggle {
    background: transparent;
    color: #fff;
    border: none;
    padding: 0.5rem 0;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: color 0.3s ease;
    position: relative;
    font-weight: bold;
}

.dropdown-toggle:hover {
    color: #008aff;
}

.dropdown-toggle::after {
    content: '▼';
    font-size: 0.7rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle::after {
    transform: rotate(180deg);
}

/* 关键修复：完全消除间隙 */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 115%;  /* 紧贴按钮底部 */
    right: -25px;
    background: #fff;
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    border-radius: 8px;
    overflow: visible;  /* 改为visible以便伪元素生效 */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 1000;
    /* 移除所有margin和padding */
}

/* 使用伪元素在菜单上方创建一个透明的hover桥接区域 */
.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px;  /* 向上延伸10px */
    left: 0;
    right: 0;
    height: 10px;  /* 覆盖按钮和菜单之间的间隙 */
    background: transparent;
    z-index: -1;
}

/* 关键：同时监听dropdown和dropdown-menu的hover状态 */
.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* 菜单项容器，添加真正的内边距 */
.dropdown-menu-inner {
    padding: 8px 0;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

.dropdown-menu a {
    display: block;
    padding: 12px 10px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: #008aff;
    border-left-color: #008aff;
    padding-left: 25px;
}

/* 菜单项图标动画 */
.dropdown-menu a::before {
    content: '→';
    margin-right: 8px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
    display: inline-block;
}

.dropdown-menu a:hover::before {
    opacity: 1;
    transform: translateX(0);
}

/* 移动端菜单按钮 */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 6px;
    padding: 3px 6px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255,255,255,0.1);
    border-color: #008aff;
}

.mobile-menu-toggle.active {
    background: #008aff;
    border-color: #008aff;
}

/* Container Styles */
.container {
    max-width: 1200px;
    margin: 30px auto;
}

/* Main Content */
main {
    min-height: calc(100vh - 400px);
}

/* Footer Styles */
.footer {
    background: #1a1a1a;
    color: #fff;
    padding: 3rem 30px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: #008aff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #008aff;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #333;
    color: #888;
}

/* Scroll to Top Button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #008aff;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(14,165,233,0.3);
    z-index: 999;
}

.scroll-to-top:hover {
    background: #008aff;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(14,165,233,0.4);
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 移动端样式 */
@media (max-width: 1024px) {
    main {
        margin: 0 30px;
    }
    .toc-sidebar {
        display: none;
    }
    .nav {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 280px;
        background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 0 20px 0;
        gap: 0;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        box-shadow: -5px 0 25px rgba(0,0,0,0.5);
        overflow-y: auto;
        z-index: 999;
    }

    .nav.active {
        right: 0;
    }

    .nav > a {
        width: 100%;
        padding: 1rem 1.5rem;
        border-left: 3px solid transparent;
        transition: all 0.3s ease;
    }

    .nav > a:hover,
    .nav > a.active {
        background: rgba(14, 165, 233, 0.1);
        border-left-color: #008aff;
        padding-left: 2rem;
    }

    .nav > a::after {
        display: none;
    }

    /* 移动端下拉菜单样式 */
    .dropdown {
        width: 100%;
    }

    .dropdown-toggle {
        width: 100%;
        padding: 1rem 1.5rem;
        justify-content: space-between;
        text-align: left;
        border-left: 3px solid transparent;
        font-weight: bold;
    }

    .dropdown-toggle::after {
        transition: transform 0.3s ease;
    }

    .dropdown.mobile-open .dropdown-toggle {
        background: rgba(14, 165, 233, 0.1);
        border-left-color: #008aff;
        color: #008aff;
    }

    .dropdown.mobile-open .dropdown-toggle::after {
        transform: rotate(180deg);
    }

    .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        box-shadow: none;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.05);
        margin: 0;
        padding: 0;
        opacity: 1;
        transform: none;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }

    .dropdown-menu::before {
        display: none;
    }

    .dropdown.mobile-open .dropdown-menu {
        display: block;
        max-height: 500px;
    }

    .dropdown-menu-inner {
        padding: 0;
        background: transparent;
    }

    .dropdown-menu a {
        color: #ccc;
        padding: 0.875rem 1.5rem 0.875rem 2.5rem;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .dropdown-menu a:last-child {
        border-bottom: none;
    }

    .dropdown-menu a:hover {
        background: rgba(14, 165, 233, 0.15);
        color: #fff;
        padding-left: 3rem;
    }

    .mobile-menu-toggle {
        display: block;
        z-index: 1000;
    }

    .header-container {
        position: relative;
        padding: 0 30px;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }

    /* 移动端遮罩层 */
    .nav.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 280px;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: -1;
    }

    .footer-container {
        gap: unset;
        grid-template-columns: repeat(auto-fit, minmax(0px, 1fr));
    }
}

/* Loading animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}
.hero::before { position: absolute; width: 100%; height: 100%; }
.card, .article-item { min-height: 300px; }
.header { height: 70px; }
img { max-width: 100%; height: auto; }
.logo img {max-width: 80%}

@media (max-width: 768px) {
    main {
        margin: 0 15px;
    }
    .footer {
        padding: 3rem 15px;
    }
    .footer-section {
        margin-bottom: 20px;
        margin-right: 1px;
    }
    .header-container {
        padding: 0 15px;
    }
}
