/* ============================================
   移动端历史对话底部抽屉样式
   ============================================ */

/* 遮罩层 */
#history-drawer-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#history-drawer-backdrop.active {
    display: block;
    opacity: 1;
}

/* 底部抽屉 */
#history-drawer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 70vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#history-drawer.open {
    transform: translateY(0);
}

/* 拖动条 */
.history-drawer-handle {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 10px auto 0;
    flex-shrink: 0;
}

/* 抽屉头部 */
.history-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.history-drawer-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.history-drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-drawer-new-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: #f0eeff;
    color: #6c5ce7;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.history-drawer-new-btn:hover {
    background: #6c5ce7;
    color: #fff;
}

.history-drawer-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.history-drawer-close-btn:hover {
    background: #f5f5f5;
    color: #555;
}

/* 列表区域 */
#history-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
    overscroll-behavior: contain;
}

#history-drawer-list::-webkit-scrollbar {
    width: 3px;
}
#history-drawer-list::-webkit-scrollbar-track {
    background: transparent;
}
#history-drawer-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* 空状态 */
.history-drawer-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    color: #bbb;
    gap: 10px;
}

.history-drawer-empty svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

.history-drawer-empty-text {
    font-size: 13px;
}

/* 历史条目 */
.history-drawer-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    gap: 10px;
    border-left: 3px solid transparent;
}

.history-drawer-item:hover {
    background: #f9f9f9;
}

.history-drawer-item.active {
    background: #f0f0f0;
    border-left-color: #999;
}

.history-drawer-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
}

.history-drawer-item.active .history-drawer-item-icon {
    background: #e0e0e0;
    color: #666;
}

.history-drawer-item-icon svg {
    width: 16px;
    height: 16px;
}

.history-drawer-item-content {
    flex: 1;
    min-width: 0;
}

.history-drawer-item-title {
    font-size: 13px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.history-drawer-item-meta {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}

/* 删除按钮 - 默认显示，滑动露出 */
.history-drawer-item-delete {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #bbb;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    transition: opacity 0.15s, background 0.15s, color 0.15s, transform 0.15s;
    transform: scale(0.9);
}

.history-drawer-item:hover .history-drawer-item-delete,
.history-drawer-item:active .history-drawer-item-delete {
    opacity: 1;
    transform: scale(1);
}

.history-drawer-item-delete:hover {
    background: #fff1f0;
    color: #ff4d4f;
}
