/* 左侧抽屉菜单 - drawer.css */

.side-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.side-drawer.open {
    pointer-events: all;
    opacity: 1;
}

.drawer-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.side-drawer.open .drawer-overlay {
    opacity: 1;
}

.drawer-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 25vw; /* 改为视口宽度的25%，自适应 */
    min-width: 360px; /* 设置最小宽度保持可用性 */
    height: 100%;
    background: linear-gradient(180deg, #FAFAFA 0%, #F5F5F7 100%);
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
}

.side-drawer.open .drawer-content {
    transform: translateX(0);
}

.drawer-content::-webkit-scrollbar {
    width: 0;
    display: none;
}

/* 用户信息区域 */
.drawer-user-section {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 252, 0.95) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 20px 18px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.2s ease;
}

.drawer-user-section:active {
    background: linear-gradient(135deg, rgba(245, 245, 247, 0.98) 0%, rgba(240, 240, 242, 0.95) 100%);
}

.user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    background: linear-gradient(135deg, #E8E5F0 0%, #F0EEF7 100%);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 3px 12px rgba(123, 107, 214, 0.15);
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    padding-top: 2px;
}

.user-name {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 6px;
    letter-spacing: 0.2px;
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

.user-actions:hover {
    color: #7B6BD6;
}

.user-actions span {
    transition: color 0.2s;
}

.user-actions .divider {
    color: #D0D0D0;
    margin: 0 -2px;
}

.user-actions svg {
    width: 12px;
    height: 12px;
    color: #999;
    transition: transform 0.2s;
}

.user-actions:hover svg {
    transform: translateX(2px);
}

.user-right-icons {
    display: flex;
    gap: 16px;
    padding-top: 2px;
}

.drawer-icon-btn {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
    border-radius: 10px;
    transition: all 0.2s;
}

.drawer-icon-btn:hover {
    background: rgba(123, 107, 214, 0.06);
}

.drawer-icon-btn:active {
    transform: scale(0.95);
}

.drawer-icon-btn svg {
    width: 22px;
    height: 22px;
    color: #666;
    transition: color 0.2s;
}

.drawer-icon-btn:hover svg {
    color: #7B6BD6;
}

.icon-label {
    font-size: 11px;
    color: #666;
    font-weight: 500;
}

/* 功能卡片区域 */
.drawer-cards {
    padding: 12px 18px;
    display: flex;
    gap: 10px;
    background: transparent;
}

.drawer-card {
    flex: 1;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 252, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05),
                0 1px 3px rgba(0, 0, 0, 0.03);
}

.drawer-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(123, 107, 214, 0.12),
                0 2px 6px rgba(0, 0, 0, 0.06);
}

.drawer-card:active {
    transform: translateY(0) scale(0.98);
}

.card-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.card-icon svg {
    width: 22px;
    height: 22px;
}

.card-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.1px;
}

.card-desc {
    font-size: 11px;
    color: #999;
    letter-spacing: 0.1px;
}

/* 抽屉区块 */
.drawer-section {
    margin-top: 10px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 252, 0.9) 100%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.section-title {
    font-size: 17px;
    font-weight: 600;
    color: #1a1a1a;
    letter-spacing: 0.2px;
}

.section-more {
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

.section-more:hover {
    background: rgba(123, 107, 214, 0.08);
    color: #7B6BD6;
}

.section-more svg {
    transition: transform 0.2s;
}

.section-more:hover svg {
    transform: translateX(2px);
}

/* 最近使用 */
.recent-items {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.recent-items::-webkit-scrollbar {
    display: none;
}

.recent-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 56px;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.recent-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F8FA;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08),
                0 1px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
}

.recent-icon span {
    font-size: 28px;
}

.recent-item:active .recent-icon {
    transform: scale(0.95);
}

.recent-label {
    font-size: 12px;
    color: #333;
    text-align: center;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    line-height: 1.3;
}

.recommend-badge {
    position: absolute;
    top: -4px;
    right: 2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    letter-spacing: 0.2px;
}

.ai-badge {
    position: absolute;
    top: -4px;
    right: 2px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(79, 172, 254, 0.4);
    letter-spacing: 0.2px;
}

/* 对话记录 */
.chat-history {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.history-date {
    font-size: 12px;
    color: #999;
    padding: 10px 0 8px;
    font-weight: 500;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
}

.history-item:hover {
    background: rgba(123, 107, 214, 0.04);
    padding: 16px 12px;
    margin: 0 -12px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-item:active {
    transform: scale(0.98);
}

.history-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
    letter-spacing: 0.1px;
}

.history-item:hover .history-text {
    color: #7B6BD6;
}

.history-time {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* 历史记录增强样式 - 仿豆包 */
.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.history-icon {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(123, 107, 214, 0.08);
    border-radius: 8px;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
    min-width: 0;
}

.history-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-time {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

.history-star {
    font-size: 14px;
    flex-shrink: 0;
}

.history-loading,
.history-empty,
.history-error {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* 最近使用 - 一列模式（recent-item-row 覆盖原有多列样式） */
#recentAgentList {
    flex-direction: column;
    overflow-x: visible;
    gap: 4px;
    padding-bottom: 0;
}

#recentAgentList .recent-item.recent-item-row {
    flex-direction: row;
    align-items: center;
    min-width: unset;
    width: 100%;
    gap: 12px;
    padding: 8px 6px;
    border-radius: 10px;
    transition: background 0.15s;
}

#recentAgentList .recent-item.recent-item-row:hover,
#recentAgentList .recent-item.recent-item-row:active {
    background: rgba(0, 0, 0, 0.04);
}

#recentAgentList .recent-item.recent-item-row .recent-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

#recentAgentList .recent-item.recent-item-row .recent-icon span {
    font-size: 18px;
}

#recentAgentList .recent-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#recentAgentList .recent-item.recent-item-row .recent-label {
    text-align: left;
    max-width: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

#recentAgentList .recent-tags {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}

#recentAgentList .recent-tag {
    font-size: 10px;
    color: #888;
    background: rgba(0,0,0,0.05);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

#recentAgentList .recent-item.recent-item-row .recommend-badge {
    position: static;
    flex-shrink: 0;
}

/* 55寸触摸屏适配 - 支持竖屏1080px */
@media screen and (min-width: 1024px) {
    .drawer-content {
        max-width: 30vw; /* 改为视口宽度的30%，自适应 */
        min-width: 450px;
    }
    
    .drawer-user-section {
        padding: 24px 22px 20px;
    }
    
    .user-avatar {
        width: 58px;
        height: 58px;
    }
    
    .user-name {
        font-size: 18px;
    }
    
    .drawer-cards {
        padding: 22px;
        gap: 14px;
    }
    
    .drawer-card {
        padding: 16px;
    }
    
    .card-icon {
        width: 52px;
        height: 52px;
    }
    
    .card-title {
        font-size: 15px;
    }
    
    .drawer-section {
        padding: 22px;
    }
    
    .section-title {
        font-size: 18px;
    }
}

/* 横屏大屏幕 */
@media screen and (min-width: 1920px) {
    .drawer-content {
        max-width: 28vw; /* 改为视口宽度的28%，自适应 */
        min-width: 480px;
    }
    
    .drawer-user-section {
        padding: 28px 24px 22px;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
    }
    
    .user-name {
        font-size: 19px;
    }
    
    .card-icon {
        width: 56px;
        height: 56px;
    }
    
    .card-title {
        font-size: 16px;
    }
    
    .section-title {
        font-size: 19px;
    }
}
