/* 自定义样式优化 */
.hover-bg-light:hover {
    background-color: #f8f9fa;
}

/* 导航栏Logo样式 */
.navbar-logo {
    height: 80px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 导航栏内容容器 */
.navbar-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin: 0 15px;
}

.navbar-content-wrapper .navbar-nav {
    flex-shrink: 0;
}

.user-info-nav {
    flex-shrink: 0;
}

/* 搜索框区域样式 */
.search-section {
    flex: 0 0 80%;
    max-width: 500px;
    min-width: 280px;
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 20px;
}

.search-form {
    margin: 0;
    width: 100%;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.search-input-group:focus-within {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
    background: white;
}

.search-icon {
    display: none;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.85rem;
    padding: 4px 0;
}

.search-input::placeholder {
    color: #bbb;
}

.search-btn {
    background: #10b981;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85rem;
}

.search-btn:hover {
    background: #059669;
    transform: scale(1.05);
}

/* 搜索历史样式 */
.search-history {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    width: 100%;
    max-width: 500px;
    padding: 12px 15px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    z-index: 1000;
    display: none;
}

.search-history.active {
    display: block;
}

.history-label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 0.8rem;
    color: #666;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.history-label i {
    margin-right: 6px;
    font-size: 0.7rem;
}

.history-label span {
    flex: 1;
}

.clear-history {
    background: none;
    border: none;
    color: #999;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.clear-history:hover {
    background: #f5f5f5;
    color: #666;
}

.history-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-tag {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    background: #f8f9fa;
    border-radius: 16px;
    font-size: 0.78rem;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-tag:hover {
    background: #e8f5e9;
    color: #10b981;
}

.history-tag .tag-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 80px;
}

.history-tag .tag-remove {
    margin-left: 6px;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 0.7rem;
}

.history-tag:hover .tag-remove {
    opacity: 1;
}

.history-empty {
    color: #999;
    font-size: 0.8rem;
    text-align: center;
    padding: 10px 0;
}

/* 导航栏图标垂直排列 */
.nav-icons-vertical .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    text-align: center;
    min-width: 70px;
}

.nav-icons-vertical .nav-link i {
    font-size: 1.5rem;
    margin-bottom: 4px;
    color: #4a5568;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.nav-icons-vertical .nav-link span {
    font-size: 0.75rem;
    color: #4a5568;
    font-weight: 500;
}

.nav-icons-vertical .nav-item.active .nav-link i,
.nav-icons-vertical .nav-item.active .nav-link span {
    color: #10b981;
    font-weight: 600;
}

.nav-icons-vertical .nav-link:hover i,
.nav-icons-vertical .nav-link:hover span {
    color: #10b981;
}

.nav-icons-vertical .nav-item.active .nav-link {
    background-color: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
}

#userInfoTrigger:hover {
    opacity: 0.8;
}

#userInfoDropdown .modal-content {
    border-radius: 8px;
    border: none;
}

/* 搜索框聚焦样式 */
/* #navSearchForm input:focus {
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
    border-color: #28a745;
} */

/* 响应式优化 */
@media (max-width: 768px) {
    .navbar-collapse {
        padding-top: 0.5rem;
    }
    
    #navSearchForm {
        margin: 0.5rem 0;
    }
}

/* 头像和昵称点击样式 */
#userAvatarWrapper, #userNicknameWrapper {
    cursor: pointer;
    transition: opacity 0.2s;
}

#userAvatarWrapper:hover, #userNicknameWrapper:hover {
    opacity: 0.7;
}

/* 上传头像模态框 */
#avatarUploadModal .modal-body {
    padding: 2rem;
}

#avatarPreview {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto;
    display: block;
    border: 3px solid #e9ecef;
}

/* 修改信息模态框 - 横向布局 */
#profileEditModal .modal-dialog {
    max-width: 550px !important;
}

#profileEditForm .form-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    margin-bottom: 14px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

#profileEditForm .form-row:last-child {
    margin-bottom: 0 !important;
}

#profileEditForm .form-label {
    flex-shrink: 0 !important;
    width: 90px !important;
    padding-top: 7px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    text-align: right !important;
    padding-right: 15px !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    display: inline-block !important;
    white-space: nowrap !important;
}

#profileEditForm .form-field {
    flex-grow: 1 !important;
    min-width: 0 !important;
    margin-left: 0 !important;
}

#profileEditForm .form-field .form-control {
    font-size: 14px !important;
    width: 100% !important;
    display: block !important;
}

/* 右侧浮动功能框 */
.float-toolbar {
    position: fixed !important;
    right: 20px !important;
    bottom: 100px !important;
    z-index: 9998 !important;
    display: block !important;
    background: rgba(255, 255, 255, 0.95) !important;
    border-radius: 12px !important;
    padding: 12px 8px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15) !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.float-menu {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.float-item {
    position: relative !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 56px !important;
    height: 64px !important;
    margin: 4px 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    border-radius: 8px !important;
    padding: 4px !important;
}

.float-item:hover {
    background: #f0f5ff !important;
    transform: none !important;
}

.float-icon-wrapper {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #fff !important;
    font-size: 14px !important;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3) !important;
    transition: all 0.2s ease !important;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%) !important;
}

.float-item:hover .float-icon-wrapper {
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4) !important;
    transform: scale(1.05) !important;
}

/* 发布按钮 */
.float-icon-wrapper.publish {
    background: linear-gradient(135deg, #69c0ff 0%, #40a9ff 100%) !important;
}

/* 消息按钮 */
.float-icon-wrapper.message {
    background: linear-gradient(135deg, #69c0ff 0%, #40a9ff 100%) !important;
}

/* 留言按钮 */
.float-icon-wrapper.comment {
    background: linear-gradient(135deg, #69c0ff 0%, #40a9ff 100%) !important;
}

/* 小程序按钮 */
.float-icon-wrapper.app {
    background: linear-gradient(135deg, #69c0ff 0%, #40a9ff 100%) !important;
}

/* 客服按钮 */
.float-icon-wrapper.service {
    background: linear-gradient(135deg, #69c0ff 0%, #40a9ff 100%) !important;
}

/* 我买到的按钮 */
.float-icon-wrapper.bought {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%) !important;
}

/* 我卖出的按钮 */
.float-icon-wrapper.sold {
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%) !important;
}

/* 我在卖的按钮 */
.float-icon-wrapper.selling {
    background: linear-gradient(135deg, #531dab 0%, #2f0a80 100%) !important;
}

/* 我的收藏按钮 */
.float-icon-wrapper.favorite {
    background: linear-gradient(135deg, #fa541c 0%, #d4380d 100%) !important;
}

/* 回到顶部按钮 */
.backtop-float {
    position: fixed;
    right: 20px;
    bottom: 30px; /* 固定底距30px */
    width: 70px; /* 与float-toolbar相同宽度 */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    background: linear-gradient(135deg, #e3c61b 0%, #b5a608 100%);
    border-radius: 15px;
    /* box-shadow: 0 4px 16px rgba(114, 46, 209, 0.4); */
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
}

.backtop-float:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(114, 46, 209, 0.5);
}

.backtop-icon {
    width: 40px;
    /* height: 40px; */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    /* font-size: 22px; */
}

.backtop-label {
    font-size: 12px;
    color: #fff;
    margin-top: 2px;
    font-weight: 500;
}

/* 分割线 */
.float-divider {
    width: 80% !important;
    height: 1px !important;
    background: linear-gradient(to right, transparent, #e8e8e8, transparent) !important;
    margin: 8px 0 !important;
}

.float-label {
    font-size: 11px !important;
    color: #595959 !important;
    margin-top: 4px !important;
    white-space: nowrap !important;
    text-align: center !important;
}

.float-badge {
    position: absolute !important;
    top: -4px !important;
    right: -6px !important;
    min-width: 20px !important;
    height: 20px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
    padding: 0 6px !important;
    line-height: 20px !important;
    text-align: center !important;
    background-color: #dc3545 !important;
    color: #fff !important;
    font-weight: bold !important;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.4) !important;
    z-index: 10 !important;
}

/* 用户信息浮框中的计数徽章样式 */
#userInfoDropdown .badge {
    min-width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    font-size: inherit !important;
    padding: 0 0 0 8px !important;
    line-height: inherit !important;
    text-align: right !important;
    font-weight: normal !important;
    box-shadow: none !important;
    background: none !important;
    color: #6c757d !important;
    float: right !important;
}

/* 二维码悬浮层 */
.float-qrcode-wrapper {
    position: relative;
}

.qrcode-popup {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 9999;
}

.float-qrcode-wrapper:hover .qrcode-popup {
    display: block;
}

.qrcode-content {
    text-align: center;
}

.qrcode-content img {
    width: 240px;
    height: 240px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.qrcode-content p {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* 三角指示 */
.qrcode-popup::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #fff;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

/* 响应式调整 */
@media (max-width: 576px) {
    .float-toolbar {
        right: 10px;
        bottom: 80px;
    }
    
    .float-icon-wrapper {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .float-label {
        font-size: 11px;
    }
}

/* ==================== 发布物品表单横向布局 ==================== */
#itemCreateModal .modal-dialog {
    max-width: 700px !important;
}

#itemCreateForm .form-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    margin-bottom: 14px !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
}

#itemCreateForm .form-row:last-child {
    margin-bottom: 0 !important;
}

#itemCreateForm .form-label {
    flex-shrink: 0 !important;
    width: 90px !important;
    padding-top: 7px !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #495057 !important;
    text-align: right !important;
    padding-right: 15px !important;
    padding-left: 0 !important;
    margin-bottom: 0 !important;
    display: inline-block !important;
    white-space: nowrap !important;
}

#itemCreateForm .form-label .required {
    color: #dc3545 !important;
    margin-left: 2px !important;
}

#itemCreateForm .form-field {
    flex-grow: 1 !important;
    min-width: 0 !important;
    margin-left: 0 !important;
}

#itemCreateForm .form-field .form-control {
    font-size: 14px !important;
    width: 100% !important;
    display: block !important;
}

#itemCreateForm .form-field textarea.form-control {
    resize: vertical !important;
    min-height: 80px !important;
}

/* 图片上传区域 */
#itemCreateForm .image-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
}

#itemCreateForm .image-upload-area:hover {
    border-color: #10b981;
    background: #f0fdf4;
}

#itemCreateForm .image-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

#itemCreateForm .image-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    cursor: move;
    transition: all 0.3s ease;
}

#itemCreateForm .image-preview-item:hover {
    border-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

#itemCreateForm .image-preview-item.dragging {
    opacity: 0.5;
    border: 2px dashed #10b981;
}

#itemCreateForm .image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#itemCreateForm .image-preview-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

/* ==================== 页脚样式 ==================== */
.site-footer {
    background: #111827;
    color: #9ca3af;
    margin-top: 60px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* CTA 区域 */
.footer-cta {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    padding: 20px 0;
}

/* 品牌标语悬浮态：常规时悬浮于浏览器底部，半透明+毛玻璃；
   滚动到 site-footer 可见时由 JS 移除本类，归位到 footer-body 之前的原位置（恢复不透明） */
.footer-cta.is-floating {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    background: linear-gradient(135deg, rgba(5,150,105,0.88) 0%, rgba(16,185,129,0.88) 100%);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.10);
    opacity: 0.8;
}

.cta-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.cta-text h3 {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px;
}

.cta-text p {
    color: rgba(255,255,255,0.9);
    font-size: 15px;
    margin: 0;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #059669;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.cta-btn:hover {
    background: #f0fdf4;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    text-decoration: none;
    color: #059669;
}

/* 主体区域 */
.footer-body {
    padding: 50px 0 30px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 50px;
}

/* 品牌 */
.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.footer-brand .footer-logo img {
    height: 36px;
    width: auto;
    border-radius: 8px;
    object-fit: contain;
}

.footer-brand .footer-logo span {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.footer-brand .footer-desc {
    font-size: 14px;
    line-height: 1.7;
    color: #6b7280;
    margin: 0;
    max-width: 280px;
}

/* 列 */
.footer-column h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 18px;
    letter-spacing: 0.5px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column ul li {
    margin-bottom: 10px;
}

.footer-column ul li a {
    color: #9ca3af;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    display: inline-block;
}

.footer-column ul li a:hover {
    color: #10b981;
}

/* 底部栏 */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 20px 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-bottom .copyright {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.footer-bottom-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.footer-social {
    display: flex;
    gap: 14px;
}

.footer-social a {
    color: #6b7280;
    font-size: 16px;
    transition: color 0.2s ease;
    text-decoration: none;
}

.footer-social a:hover {
    color: #10b981;
}

.footer-legal {
    display: flex;
    gap: 16px;
}

.footer-legal a {
    color: #6b7280;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.footer-legal a:hover {
    color: #10b981;
}

/* 响应式 */
@media (max-width: 992px) {
    .cta-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 35px;
    }
    
    .footer-brand {
        grid-column: 1 / -1;
    }
    
    .footer-brand .footer-desc {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    .footer-cta {
        padding: 20px 0;
    }
    
    .cta-text h3 {
        font-size: 20px;
    }
    
    .cta-text p {
        font-size: 14px;
    }
    
    .footer-body {
        padding: 35px 0 20px;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
    
    .footer-bottom-inner {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-bottom-right {
        flex-direction: column;
        gap: 12px;
    }
}