/* ============================================================
   common.css — 所有页面共用样式
   包含：返回顶部按钮、下拉菜单、移动端菜单
   ============================================================ */

/* 返回顶部按钮 */
.back-to-top {
    transition: opacity 0.3s, visibility 0.3s, transform 0.3s;
}
.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

/* 下拉菜单样式 */
.dropdown {
    position: relative;
}
.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}
.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
    white-space: nowrap;
}
.dropdown-item:last-child {
    border-bottom: none;
}
.dropdown-item:hover {
    background: #f3f4f6;
    color: #1e88e5;
    padding-left: 1.25rem;
}
.dropdown-item-icon {
    display: inline-block;
    width: 20px;
    margin-right: 0.5rem;
    text-align: center;
}
.dropdown.active > a {
    color: #1e88e5;
    background: #eff6ff;
    font-weight: 600;
}

/* 移动端菜单样式 */
.mobile-menu-btn {
    display: block;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 100;
}
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 380px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    padding-top: 4rem;
}
.mobile-menu.active {
    right: 0;
}
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}
.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}
.mobile-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mobile-menu li {
    border-bottom: 1px solid #f3f4f6;
}
.mobile-menu a {
    display: block;
    padding: 1rem 1.5rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
}
.mobile-menu a:hover {
    background: #f3f4f6;
    color: #1e88e5;
}
.mobile-menu .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.mobile-menu .dropdown-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #f9fafb;
}
.mobile-menu .dropdown-submenu.active {
    max-height: 1000px;
}
.mobile-menu .dropdown-submenu a {
    padding-left: 2rem;
    font-size: 0.9rem;
    white-space: nowrap;
}
