/* DS随心转 AI聊天页面 - 侧边栏样式 */

/* 左侧边栏 - 基础样式 */
.chat-sidebar {
    height: 100vh;
    background: #FAF9F6;
    border-right: 1px solid rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    position: relative;
    padding-top: 80px;
    transition: width 0.3s ease, min-width 0.3s ease;
}

/* 展开状态的侧边栏 */
.chat-sidebar.expanded {
    width: 15vw;
    min-width: 260px;
    max-width: 320px;
}

/* 收起状态的侧边栏 */
.chat-sidebar.collapsed {
    width: 60px;
    min-width: 60px;
}

/* 侧边栏收起/展开按钮 */
.sidebar-toggle-btn {
    position: absolute;
    top: 15px;
    right: -15px;
    width: 30px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 50%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.sidebar-toggle-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-sidebar.collapsed .sidebar-toggle-btn {
    right: -15px;
    left: auto;
    top: 15px;
}

.sidebar-toggle-btn i {
    font-size: 14px;
    color: #666;
    transition: transform 0.3s ease;
}

/* 顶部导航区域 */
.chat-nav {
    padding: 20px 10px 4px;
    flex-shrink: 0;
}

.chat-logo {
    margin-bottom: 12px;
}

.chat-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.chat-logo .logo-img {
    width: 32px;
    height: 32px;
    margin-right: 12px;
}

.chat-logo .logo-text {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
}

.chat-navigation {
    width: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 全宽导航按钮样式 */
.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 6px 14px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 6px;
}

.nav-btn-main {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

.nav-btn-main .iconfont {
    font-size: 18px;
}

/* 格式转换按钮 */
.nav-btn-convert {
    background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.nav-btn-convert:hover {
    background: linear-gradient(135deg, #5a6dd8 0%, #6a408f 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    text-decoration: none;
}

/* 会员按钮 */
.nav-btn-vip {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.2);
}

.nav-btn-vip:hover {
    background: linear-gradient(135deg, #e09e10 0%, #d91f0b 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(245, 175, 25, 0.4);
    text-decoration: none;
}

/* 分隔线 */
.nav-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
}

/* 分组导航样式 */
.nav-group {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

.nav-group-label {
    color: #888;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-group-label .iconfont {
    font-size: 14px;
}

.nav-group-items {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-left: 0;
}

.nav-group-link {
    color: #555;
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-group-link:hover {
    color: #667eea;
    background-color: #f0f4ff;
    text-decoration: none;
}

.nav-group-sep {
    color: #d0d0d0;
    font-size: 12px;
    user-select: none;
}

.nav-new-badge {
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 600;
}

/* 用户头像 - 固定在左下角 */
.chat-user-profile {
    position: absolute;
    bottom: 0px;
    left: 20px;
    right: 20px;
    z-index: 200;
}

.chat-user-avatar {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    background: white;
    border-radius: 50px;
    text-decoration: none;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    cursor: pointer;
}

.chat-user-avatar:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: #333;
}

.chat-user-avatar img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 8px;
}

.chat-user-avatar .user-name {
    font-size: 14px;
    font-weight: 500;
    margin-right: 4px;
}

.chat-user-avatar .vip-badge {
    width: 20px;
    height: 20px;
    margin: 0 4px;
}

.chat-user-avatar .layui-icon {
    font-size: 12px;
    margin-left: 4px;
    transition: transform 0.2s ease;
}

.chat-user-dropdown.show+.chat-user-avatar .layui-icon {
    transform: rotate(180deg);
}

/* 用户下拉菜单 */
.chat-user-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    min-width: 120px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
    overflow: visible;
}

.chat-user-dropdown::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 12px;
}

.chat-user-dropdown.show,
.chat-user-profile:hover .chat-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-user-dropdown .dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

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

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

.chat-user-dropdown .dropdown-logout-btn {
    color: #dc3545;
}

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

/* Nav Item hover popups */
.nav-item-wrapper {
    position: relative;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.nav-item-wrapper:hover {
    background-color: #f0f4ff;
}

.nav-hover-qrcode,
.nav-hover-popup {
    position: absolute;
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.nav-hover-qrcode {
    text-align: center;
    min-width: 160px;
}

.nav-hover-popup {
    min-width: 360px;
    text-align: left;
}

.nav-item-wrapper:hover .nav-hover-qrcode,
.nav-item-wrapper:hover .nav-hover-popup {
    opacity: 1;
    visibility: visible;
}

/* QR Code Arrow */
.nav-hover-qrcode .qrcode-arrow,
.nav-hover-popup .popup-arrow {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

.nav-hover-qrcode img {
    width: 240px;
    height: 240px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 12px;
}

/* Popup content */
.nav-hover-popup .popup-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.nav-hover-popup .popup-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-hover-popup .popup-list li {
    font-size: 13px;
    color: #555;
    padding: 6px 0;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.nav-hover-popup .popup-tip {
    margin: 12px 0 0;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #888;
    text-align: center;
}

/* === 收起状态侧边栏样式 === */
.collapsed .chat-nav {
    margin-top: 30px;
}

.chat-sidebar.collapsed .chat-logo {
    justify-content: center;
    padding: 15px 0;
}

.chat-sidebar.collapsed .chat-logo .logo-img {
    margin: 0;
    width: 34px;
    height: 34px;
}

.collapsed-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
}

.collapsed-new-chat-btn {
    width: 40px;
    height: 40px;
    border: 1px solid #eee;
    background: #fff;
    color: black;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.collapsed-new-chat-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.collapsed-nav-item {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.2s ease;
    position: relative;
}

.collapsed-nav-item:hover {
    background-color: #f8f9fa;
    color: #495057;
}

.collapsed-nav-item.nav-item-convert {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.collapsed-nav-item.nav-item-vip {
    background: linear-gradient(135deg, #f5af19 0%, #f12711 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(245, 175, 25, 0.3);
}

.collapsed-user-profile {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.collapsed-user-avatar {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    text-decoration: none;
    transition: all 0.2s ease;
}

.collapsed-user-avatar:hover {
    transform: scale(1.05);
}

.collapsed-user-avatar img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #f0f0f0;
}

.collapsed-user-dropdown {
    position: absolute;
    bottom: 50%;
    left: 100%;
    transform: translateY(50%) translateX(-10px);
    margin-left: 8px;
    min-width: 120px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    overflow: hidden;
    z-index: 1000;
}

.collapsed-user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(50%) translateX(0);
}

/* Collapsed nav item hover qrcodes */
.collapsed-nav-item-wrapper {
    position: relative;
}

.collapsed-nav-hover-qrcode {
    position: absolute;
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    text-align: center;
    min-width: 160px;
}

.collapsed-nav-item-wrapper:hover .collapsed-nav-hover-qrcode {
    opacity: 1;
    visibility: visible;
}

.collapsed-nav-hover-qrcode .qrcode-arrow {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
}

.collapsed-nav-hover-qrcode img {
    width: 240px;
    height: 240px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 12px;
}