/* 用户头像样式 */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    min-width: 180px;
}

.dropdown-item {
    padding: 8px 16px;
    font-size: 14px;
}

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

.dropdown-divider {
    margin: 5px 0;
}

/* 工具卡片登录提示样式 */
.tool-card.require-login {
    position: relative;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.tool-card.require-login::before {
    content: "🔒 需登录";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 193, 7, 0.9);
    color: #000;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    z-index: 2;
}

.tool-card.require-login:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.login-required-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    z-index: 1;
}

/* 抽屉导航样式 */
.drawer-nav {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 1099;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
}

.drawer-nav.open {
    left: 0;
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1098;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-header {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-brand {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.drawer-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
}

.drawer-body {
    padding: 20px;
}

.drawer-nav .nav-link {
    color: white !important;
    padding: 12px 15px;
    margin: 5px 0;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.drawer-nav .nav-link:hover,
.drawer-nav .nav-link.active {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.drawer-nav .dropdown-menu {
    background: rgba(0, 0, 0, 0.3);
    border: none;
    margin-left: 20px;
}

.drawer-nav .dropdown-item {
    color: white;
}

.drawer-nav .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 汉堡菜单按钮 */
.hamburger-btn {
    background: none;
    border: none;
    color: #333;
    font-size: 1.5rem;
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    color: #007bff;
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 991.98px) {
    .desktop-nav {
        display: none !important;
    }
    
    .hamburger-btn {
        display: block !important;
    }
}

@media (min-width: 992px) {
    .desktop-nav {
        display: flex !important;
    }
    
    .hamburger-btn {
        display: none !important;
    }
    
    .drawer-nav {
        display: none;
    }
}

/* 导航栏样式调整 */
.navbar-nav .nav-link {
    padding: 8px 15px;
}

/* 轮播广告样式保持不变 */
.ad-carousel {
    margin-top: 80px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.carousel-item {
    height: 320px;
    background: #f8f9fa;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-indicators {
    bottom: 15px;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    border: none;
    margin: 0 5px;
}

.carousel-indicators .active {
    background-color: #fff;
}

.carousel-control-prev, .carousel-control-next {
    width: 40px;
    height: 40px;
    background: rgba(0,0,0,0.2);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
}

.carousel-control-prev {
    left: 20px;
}

.carousel-control-next {
    right: 20px;
}

@media (max-width: 768px) {
    .carousel-item {
        height: 200px;
    }
    
    .carousel-control-prev, .carousel-control-next {
        width: 30px;
        height: 30px;
    }
    
    .carousel-control-prev-icon, 
    .carousel-control-next-icon {
        width: 1.2rem;
        height: 1.2rem;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .drawer-nav {
        width: 280px;
        left: -280px;
    }
}

/* 工具相关样式保持不变 */
.tool-title {
    font-size: 1.1rem;
}

.tool-desc {
    font-size: 0.9rem;
    min-height: 40px;
}

.category-title {
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 15px;
}

/* AI聊天窗口样式 */
.ai-float-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-float-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.ai-chat-window {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-close-button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.ai-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f8f9fa;
}

.ai-message {
    margin-bottom: 15px;
    display: flex;
}

.ai-message.user {
    justify-content: flex-end;
}

.ai-message.bot {
    justify-content: flex-start;
}

.ai-message-content {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.4;
}

.ai-message.user .ai-message-content {
    background: #007bff;
    color: white;
    border-bottom-right-radius: 5px;
}

.ai-message.bot .ai-message-content {
    background: white;
    color: #333;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ai-chat-input {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    background: white;
}

.ai-input-container {
    display: flex;
    gap: 10px;
}

.ai-input-field {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    outline: none;
    transition: border-color 0.3s;
}

.ai-input-field:focus {
    border-color: #007bff;
}

.ai-send-button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: background 0.3s;
}

.ai-send-button:hover {
    background: #0056b3;
}

.ai-loading-dots {
    display: flex;
    gap: 4px;
}

.ai-loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: ai-pulse 1.5s infinite ease-in-out;
}

.ai-loading-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-loading-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes ai-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .ai-chat-window {
        width: calc(100% - 40px);
        height: 70vh;
        right: 20px;
        bottom: 20px;
    }
    
    .ai-float-button {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}
