/* 左侧边栏样式美化 */
.sidebar-section {
    /* 注释掉原来的样式以保留记录 */
    /* background: #fff;
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); */
    
    /* 新的样式，与右侧区域一致 */
    background: #fff;
    transition: all 0.3s ease;
}

.sidebar-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #4B5563;
    margin-bottom: 0.7rem;
    letter-spacing: 0.01em;
}

/* 历史记录容器 */
.sidebar-scroll-container {
    /* 移除边框和背景色 */
    border-radius: 0;
    background: transparent;
    border: none;
}

/* 历史记录项样式 - 更加紧凑 */
.history-item-row {
    display: flex;
    align-items: center;
    padding: 0.4rem 0.5rem;
    margin-bottom: 0px;
    transition: all 0.2s ease;
    border-bottom: 1px solid #EEF1F5;
}

.history-item-row:last-child {
    border-bottom: none;
}

.history-item-row:hover {
    background: #F3F4F6;
}

.history-icon-container {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: white;
    margin-right: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.history-icon {
    width: 14px;
    height: 14px;
    color: #6366F1;
}

.history-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.history-item-text {
    font-size: 0.8rem;
    font-weight: 500;
    color: #1F2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.history-item-time {
    font-size: 0.65rem;
    color: #9CA3AF;
    margin-top: 1px;
    line-height: 1.1;
}

/* 快捷操作项样式 */
.shortcut-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.7rem;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    touch-action: manipulation; /* 优化触屏设备交互 */
}

.shortcut-item:hover {
    background: #F3F4F6;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.shortcut-icon {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    color: #6366F1;
}

.shortcut-text {
    font-size: 0.82rem;
    font-weight: 500;
    color: #1F2937;
}

/* 分隔线样式 */
.sidebar-divider {
    height: 1px;
    background: #E5E7EB;
    margin: 1rem 0;
}

/* 自定义滚动条 */
.sidebar-scroll-container::-webkit-scrollbar {
    width: 3px;
}

.sidebar-scroll-container::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll-container::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
}

.sidebar-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
}

/* 旋转刷新动画 */
.refresh-icon-container {
    opacity: 0;
    transition: all 0.2s ease;
    margin-left: 3px;
}

.history-item-row:hover .refresh-icon-container {
    opacity: 1;
}

.refresh-icon {
    color: #6366F1;
    cursor: pointer;
    transition: transform 0.3s ease;
    width: 13px;
    height: 13px;
}

.refresh-icon:hover {
    transform: rotate(90deg);
}

/* 类型标签样式 */
.type-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 500;
    margin-left: 6px;
}

.type-tag-whois {
    background-color: #EFF6FF;
    color: #3B82F6;
}

.type-tag-ip {
    background-color: #ECFDF5;
    color: #10B981;
}

.type-tag-icp {
    background-color: #F5F3FF;
    color: #8B5CF6;
}

.type-tag-price {
    background-color: #FFFBEB;
    color: #F59E0B;
}

.type-tag-dns {
    background-color: #EEF2FF;
    color: #6366F1;
}

/* 移动端折叠控制按钮 */
#mobile-sidebar-toggle {
    transition: all 0.2s ease;
}

#mobile-sidebar-toggle:active {
    background-color: #f3f4f6;
    transform: scale(0.95);
}

/* 移动端历史记录适配 */
@media (max-width: 768px) {
    /* 优化移动端的触摸区域 */
    .history-item-row, .shortcut-item, .tab-btn, .suggestion-chip {
        padding: 0.5rem 0.6rem;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* 增加触摸目标大小 */
    .history-icon-container, .shortcut-item {
        width: 28px;
        height: 28px;
    }
    
    .shortcut-item {
        margin-bottom: 0.4rem;
    }
    
    /* 移动端列表项适配 */
    .history-item-text {
        font-size: 0.85rem;
    }
    
    .history-item-time {
        font-size: 0.7rem;
    }
    
    /* 适配移动端触摸区域 */
    .suggestion-chip {
        padding: 0.5rem 0.8rem;
        margin-bottom: 0.2rem;
    }
    
    /* 确保滚动区域不被覆盖 */
    .sidebar-scroll-container {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 添加移动端查询结果标题样式 */
    .query-result-title {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
        margin-right: 0.25rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    
    .query-result-badge {
        font-size: 0.65rem !important;
        padding: 0.15rem 0.5rem !important;
    }
    
    .query-result-icon {
        width: 2rem !important;
        height: 2rem !important;
        margin-right: 0.5rem !important;
    }
    
    .query-result-icon svg {
        width: 1rem !important;
        height: 1rem !important;
    }
    
    .query-result-container {
        padding: 0.75rem !important;
    }
    
    /* 表格样式优化 */
    .query-result-container table {
        font-size: 0.7rem !important;
    }
    
    .query-result-container th,
    .query-result-container td {
        padding: 0.35rem 0.5rem !important;
    }
    
    /* 按钮样式 */
    .query-result-container button {
        font-size: 0.7rem !important;
        padding: 0.35rem 0.75rem !important;
    }
    
    /* 移动端表格滚动 */
    .query-result-container .overflow-hidden {
        overflow-x: auto !important;
    }
    
    /* 注册商列表 */
    .query-result-container .space-y-2 > div {
        padding: 0.5rem !important;
    }
    
    .query-result-container .space-y-2 a {
        font-size: 0.75rem !important;
    }
    
    /* 移动端卡片间距调整 */
    .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    /* 表格紧凑布局 */
    .query-result-container .min-w-full {
        width: 100% !important;
        table-layout: fixed !important;
    }
    
    /* 文本溢出处理 */
    .query-result-container .break-all {
        word-break: break-all !important;
        font-size: 0.65rem !important;
    }
    
    /* 移动端的表格头部 */
    .query-result-container thead th {
        position: sticky !important;
        top: 0 !important;
        z-index: 1 !important;
        background-color: #f3f4f6 !important;
    }
}

/* 暗色模式下移动优化 */
@media (max-width: 768px) {
    .dark .query-result-icon {
        background-color: rgba(30, 58, 138, 0.3) !important;
    }
    
    .dark .query-result-container {
        background-color: #1f2937 !important;
    }
    
    .dark .query-result-title {
        color: #e5e7eb !important;
    }
    
    .dark .query-result-badge {
        background-color: rgba(30, 58, 138, 0.3) !important;
        color: #93c5fd !important;
    }
}

/* 修复移动端字体大小 */
html {
    -webkit-text-size-adjust: 100%; 
}

/* 防止页面溢出 */
body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* 移动端历史记录样式优化 */
.tabs-container {
    max-width: 100%;
    overflow: hidden;
} 