/* ===== 公共样式 ===== */
/* 基础重置与布局 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: #f9fafb;
    color: #333;
    line-height: 1.6;
}

.main-content {
    margin-top: 100px;
    padding: 20px 0;
}

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

/* 导航栏样式 */
.navbar {
    background-color: #f9fafb;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar.scrolled {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    border-bottom: 1px solid #e5e7eb;
}

.logo {
    display: flex;
    align-items: center;
}

.logo-text {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-image {
    width: 50px;
    height: 50px;
    margin-right: 12px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.logo-text-content {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-top-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e1e5e9;
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.search-input {
    border: none;
    padding: 8px 15px;
    width: 200px;
    outline: none;
    background: transparent;
}

.search-button {
    background: transparent;
    border: none;
    color: #6b7280;
    padding: 8px 12px;
    cursor: pointer;
    transition: color 0.3s;
}

.search-button:hover {
    color: #3b82f6;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-login {
    color: #333;
    border: 1px solid #333;
}

.btn-login:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-register {
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    color: #fff;
}

.btn-register:hover {
    opacity: 0.9;
}

.user-logged-in {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: transparent;
    border: 1px solid transparent;
}

.user-logged-in:hover {
    background: #f8f9fa;
    border-color: #e9ecef;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3498db, #9b59b6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.username {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.user-status {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 1px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 160px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    margin-top: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid #e9ecef;
}

.user-logged-in:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    color: #2c3e50;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 13px;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #3498db;
}

.dropdown-item i {
    margin-right: 8px;
    width: 14px;
    text-align: center;
    font-size: 12px;
}

.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 4px 0;
}

/* 主导航菜单 */
.navbar-bottom {
    padding: 10px 5%;
    position: relative;
}

.nav-menu {
    display: flex;
    list-style: none;
    justify-content: space-between;
    flex-wrap: nowrap;
    width: 100%;
}

.nav-item {
    position: relative;
    flex: 1;
    text-align: center;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 8px;
    display: block;
    transition: all 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    border-right: 1px solid #e5e7eb;
}

.nav-item:last-child .nav-link {
    border-right: none;
}

.nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #3b82f6;
}

.submenu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.nav-item:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu-item {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.submenu-item:hover {
    background-color: #f3f4f6;
    color: #3b82f6;
}

/* 移动端菜单 */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
    padding: 5px;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 1002;
    overflow-y: auto;
    padding: 20px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: none;
}

.mobile-nav-menu.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-nav-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: #333;
}

.mobile-nav-list {
    list-style: none;
}

.mobile-nav-item {
    border-bottom: 1px solid #e5e7eb;
}

.mobile-nav-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    color: #333;
    text-decoration: none;
    font-weight: 500;
}

.mobile-nav-link i {
    transition: transform 0.3s;
}

.mobile-nav-item.active .mobile-nav-link i {
    transform: rotate(180deg);
}

.mobile-submenu {
    display: none;
    padding-left: 15px;
    background: #f9fafb;
    border-radius: 8px;
    margin-bottom: 10px;
}

.mobile-nav-item.active .mobile-submenu {
    display: block;
}

.mobile-submenu-item {
    display: block;
    padding: 12px 15px;
    color: #666;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
}

.mobile-submenu-item:last-child {
    border-bottom: none;
}

.mobile-submenu-item:hover {
    color: #3b82f6;
}

/* 底部样式 */
.footer {
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    background: linear-gradient(to right, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}

.footer-desc {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 20px;
    max-width: 250px;
}

.social-links {
    display: flex;
    gap: 10px;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.3s ease;
    text-decoration: none;
}

.social-link:hover {
    background: #3b82f6;
    color: #fff;
    transform: translateY(-3px);
}

.footer-column h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.footer-link {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.3s;
    display: flex;
    align-items: center;
}

.footer-link:hover {
    color: #3b82f6;
}

.footer-link i {
    margin-right: 8px;
    font-size: 12px;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.contact-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0f2fe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
    margin-right: 15px;
    flex-shrink: 0;
}

.contact-info p:first-child {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 5px;
}

.contact-info p:last-child {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;  /* 保证左右两项分布 */
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

/* 在桌面端，保持两项左右排列 */
.footer-bottom .copyright {
    font-size: 14px;
    color: #6b7280;
}

/* 保证两个链接放到右边 */
.footer-links-bottom {
    display: flex;
    gap: 20px;
}

.footer-link-bottom {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-link-bottom:hover {
    color: #3b82f6;
}

/* 链接样式 */
.update-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.3s;
}

.update-item-link:hover {
    background-color: #f8f9fa;
}

.data-item-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    border-radius: 8px;
}

/* 公共响应式设计 */
@media (max-width: 1200px) {
    .nav-link {
        font-size: 13px;
        padding: 10px 6px;
    }
}

@media (max-width: 992px) {
    .nav-link {
        font-size: 12px;
        padding: 10px 4px;
    }
}

@media (max-width: 768px) {
    .navbar-top {
        flex-direction: column;
        gap: 15px;
    }

    .navbar-top-right {
        width: 100%;
        justify-content: space-between;
    }

    .search-box {
        flex: 1;
        margin-right: 10px;
    }

    .search-box form {
        flex: 1;
    }

    .search-input {
        width: 100%;
        text-align: center;
    }

    .search-button {
        width: 100%;
    }

    .navbar-bottom {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-nav-menu {
        display: block;
    }

    .main-content {
        margin-top: 130px;
    }

    .footer-bottom {
        flex-direction: column; /* 在手机端显示为纵向布局 */
        align-items: flex-start;  /* 左对齐 */
    }

    .footer-bottom .copyright {
        margin-bottom: 10px;  /* 增加版权和链接间的间隔 */
    }
    
    .footer-links-bottom {
        justify-content: flex-start; /* 保证链接部分左对齐 */
        gap: 10px;
    }
}

@media (min-width: 768px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-content {
        grid-template-columns: repeat(4, 1fr);
        gap: 40px;
    }
}