/* ===================== 基础样式设置 开始 ===================== */

/* 该样式为基础配置，不可更改，如果和页面冲突，修改页面对应的样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f6f6f6;
}

a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #3498db;
    text-decoration: none;
}

ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

img {
    max-width: 100%;
    height: auto;
}

/* 网站主题色彩 */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --text-color: #333;
    --text-light: #666;
    --text-muted: #8590a6;
    --bg-color: #f6f6f6;
    --bg-light: #f8f9fa;
    --border-color: #eee;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* 基础布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-container {
    max-width: 1200px;
    margin: 20px auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    padding: 0 20px;
}

/* ===================== 基础样式设置 结束 ===================== */

/* ===================== 头部导航样式 开始 ===================== */
/* 顶部导航栏容器 */
.top-nav {
    background-color: var(--primary-color);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px var(--shadow-color);
}

/* 导航栏内容容器 */
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    height: 60px;
}

/* 导航栏左侧区域 */
.nav-left {
    display: flex;
    align-items: center;
}

/* Logo样式 */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.9;
    text-decoration: none;
}

/* Logo图片样式 */
.logo-image {
    height: 28px;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s;
}

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

/* Logo文字样式 */
.logo-text {
    white-space: nowrap;
    color: inherit;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-weight: 600;
    font-size: 20px;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

/* 导航栏中间搜索区域 */
.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    max-width: 500px;
    margin: 0 40px;
}

/* 搜索框样式 - 针对PC端右侧小型搜索框 */
.search-box {
    display: flex;
    position: relative;
    /* PC端在右侧时的紧凑样式 */
    width: 240px;
    max-width: 240px;
}

.search-box input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 20px 0 0 20px;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

.search-box input:focus {
    background: rgba(255, 255, 255, 0.25);
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 0 20px 20px 0;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s;
    min-width: 40px;
}

.search-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

.search-btn i {
    font-size: 12px;
}

/* 移动端搜索图标 */
.mobile-search {
    display: none;
}

/* 导航栏右侧区域 */
.nav-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 导航图标样式 */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #ffffff;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.nav-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    text-decoration: none;
}

/* 通知数量徽章 */
.notification-count {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

/* 登录注册链接容器 */
.auth-links {
    display: flex;
    gap: 20px;
}

/* 登录注册链接样式 */
.auth-links a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 5px;
    transition: background-color 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.auth-links a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    text-decoration: none;
}

/* 用户信息样式 */
.user-info {
    position: relative;
    cursor: pointer;
}

/* 顶栏用户头像样式 - 使用更高优先级 */
.top-nav .user-info .user-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
}

.top-nav .user-info:hover .user-avatar {
    border-color: rgba(255, 255, 255, 0.5);
}

/* 用户下拉菜单样式 */
.user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0;
    min-width: 240px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}

.user-dropdown.active {
    display: block;
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 下拉菜单用户信息 */
.user-profile {
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    gap: 12px;
}

.dropdown-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.user-details .username {
    font-weight: 600;
    color: #333;
    font-size: 15px;
    margin-bottom: 2px;
}

.user-details .user-email {
    color: #666;
    font-size: 13px;
}

/* 下拉菜单分隔线 */
.dropdown-divider {
    height: 1px;
    background: #e9ecef;
    margin: 0;
}

/* 下拉菜单项 */
.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    font-size: 14px;
    text-decoration: none;
    transition: background-color 0.2s;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
}

.dropdown-item i {
    width: 16px;
    color: #666;
    font-size: 14px;
}

.logout-btn {
    color: #e74c3c !important;
}

.logout-btn:hover {
    background-color: #fff5f5;
}

/* 左侧悬浮菜单样式 */
.float-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 10px;
    border-radius: 8px;
    box-shadow: 2px 0 8px var(--shadow-color);
    z-index: 1000;
}

.float-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 12px;
    gap: 4px;
    transition: all 0.2s ease;
}

.float-menu-item:hover {
    color: var(--primary-color);
    transform: translateX(-2px);
    text-decoration: none;
}

.float-menu-item.active {
    color: var(--primary-color);
    font-weight: 500;
}

.float-menu-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

/* 用户积分显示样式 */
.user-score-display {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-right: 16px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.score-item, .coin-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #ffd700;
    font-size: 14px;
    font-weight: 500;
}

.score-item i, .coin-item i {
    font-size: 12px;
}

.level-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

/* 用户等级颜色 */
.level-badge.newbie {
    background: #6c757d;
    color: white;
}

.level-badge.active {
    background: #28a745;
    color: white;
}

.level-badge.senior {
    background: #007bff;
    color: white;
}

.level-badge.core {
    background: #fd7e14;
    color: white;
}

.level-badge.honor {
    background: linear-gradient(45deg, #ff6b6b, #ffd93d);
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ===================== 头部导航样式 结束 ===================== */

/* ===================== 响应式设计 开始 ===================== */
@media screen and (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 0 15px;
        margin: 15px 0 65px;
        gap: 15px;
    }

    .container {
        padding: 0 15px;
    }

    .float-menu {
        flex-direction: row;
        justify-content: space-around;
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        transform: none;
        border-radius: 0;
        padding: 8px 0;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 -2px 10px var(--shadow-color);
    }

    .float-menu-item {
        padding: 8px 12px;
    }

    .float-menu-item:hover {
        transform: none;
    }

    .nav-container {
        padding: 0 15px;
        height: 56px;
    }

    /* 移动端隐藏PC搜索框，显示搜索图标 */
    .desktop-search {
        display: none;
    }

    .mobile-search {
        display: flex;
    }

    .nav-center {
        display: none;
    }

    .nav-right {
        gap: 15px;
    }

    .logo {
        font-size: 18px;
        gap: 8px;
    }

    .auth-links {
        gap: 10px;
    }

    .auth-links a {
        padding: 6px 12px;
        font-size: 13px;
    }

    .nav-icon {
        width: 36px;
        height: 36px;
    }

    /* 移动端顶栏头像尺寸 */
    .top-nav .user-info .user-avatar {
        width: 32px !important;
        height: 32px !important;
    }

    /* 移动端下拉菜单调整 */
    .user-dropdown {
        right: -15px;
        min-width: 200px;
    }

    .user-profile {
        padding: 12px;
    }

    .dropdown-avatar {
        width: 40px;
        height: 40px;
    }

    /* 移动端logo图片调整 */
    .logo-image {
        height: 26px;
    }
    
    .logo-text {
        font-size: 18px;
        letter-spacing: -0.4px;
    }
}

@media screen and (max-width: 480px) {
    .main-container {
        padding: 0 0px;
        margin: 12px 0 15px;
        gap: 12px;
    }

    .nav-container {
        height: 50px;
        padding: 0 10px;
    }

    .logo {
        font-size: 16px;
        gap: 4px;
    }
    
    /* 小屏幕logo图片调整 */
    .logo-image {
        height: 28px;
    }

    .nav-right {
        gap: 12px;
    }

    .auth-links a {
        padding: 4px 8px;
        font-size: 12px;
    }

    .nav-icon {
        width: 32px;
        height: 32px;
    }

    /* 小屏幕顶栏头像尺寸 */
    .top-nav .user-info .user-avatar {
        width: 28px !important;
        height: 28px !important;
    }
}

/* 在极小屏幕上调整logo样式，保持文字显示 */
@media screen and (max-width: 360px) {
    .logo-text {
        font-size: 14px;
        letter-spacing: -0.2px;
    }
    
    .logo-image {
        height: 24px;
    }
    
    .logo {
        gap: 6px;
    }
}
/* ===================== 响应式设计 结束 ===================== */


/* 码桶按钮样式 - 与其他nav-icon保持一致 */
.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    min-width: 0;
}

.logo {
    flex-shrink: 0;
}

.product-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    color: #666;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 400;
    white-space: nowrap;
    flex-shrink: 0;
}

.product-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.product-btn i {
    font-size: 14px;
}

.nav-icon-text {
    font-size: 13px;
    font-weight: 400;
}

/* 响应式搜索功能控制 */
@media screen and (min-width: 769px) {
    /* PC端：显示搜索框，隐藏搜索图标 */
    .desktop-search {
        display: flex !important;
    }
    .mobile-search {
        display: none !important;
    }
    
    /* PC端nav-right元素间距调整 */
    .nav-right {
        gap: 15px;
    }
    
    /* PC端搜索框融合样式 */
    .nav-right .search-box {
        margin-right: 5px;
    }
}

@media screen and (max-width: 768px) {
    /* 移动端：显示搜索图标，隐藏搜索框 */
    .desktop-search {
        display: none !important;
    }
    .mobile-search {
        display: flex !important;
    }
    
    /* 移动端nav-right元素间距 */
    .nav-right {
        gap: 15px;
    }
    
    /* 移动端码桶按钮样式 */
    .product-btn .nav-icon-text {
        display: none;
    }
    
    .product-btn {
        padding: 8px;
        min-width: 40px;
        justify-content: center;
    }
    
    .nav-left {
        gap: 10px;
    }
}
