/* DIY Builder CSS Styles - DIY电脑配置 AI装机大师 */

/* 聊天按钮和对话框样式 */
.chat-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #165DFF 0%, #1890FF 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chat-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
}

.chat-btn-rotate {
    transform: rotate(180deg);
}

.icon-transition {
    transition: all 0.3s ease;
    font-size: 24px;
}

#chatContainer {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 999;
    overflow: hidden;
}

/* 基础样式 */
.content-auto {
    content-visibility: auto;
}

.category-item {
    transition: all 0.3s ease;
}

.category-item:hover .rounded-lg {
    background-color: rgba(22, 93, 255, 0.05);
}

.category-item.active .rounded-lg {
    background-color: rgba(22, 93, 255, 0.1);
    border-color: rgba(22, 93, 255, 0.2);
}

.category-item.completed .rounded-lg {
    background-color: rgba(0, 180, 42, 0.1);
    border-color: rgba(0, 180, 42, 0.2);
}

/* 兼容性状态样式 */
.compatibility-ok {
    color: #00B42A;
}

.compatibility-warning {
    color: #FF7D00;
}

.compatibility-error {
    color: #F53F3F;
}

/* 按钮样式 */
.btn-primary {
    background: linear-gradient(135deg, #165DFF 0%, #1890FF 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(22, 93, 255, 0.3);
}

.btn-secondary {
    background: white;
    color: #165DFF;
    border: 2px solid #165DFF;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-secondary:hover {
    background: #165DFF;
    color: white;
    transform: translateY(-2px);
}

/* 规格标签样式 */
.spec-badge {
    background: rgba(22, 93, 255, 0.1);
    color: #165DFF;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* 动态按钮状态样式 */
.btn-status-good {
    background: linear-gradient(135deg, #00B42A 0%, #52C41A 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: pulse-good 2s infinite;
}

.btn-status-warning {
    background: linear-gradient(135deg, #F53F3F 0%, #FF7875 100%);
    color: white;
    border: none;
    border-radius: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    animation: pulse-warning 2s infinite;
}

.btn-status-good:hover {
    background: linear-gradient(135deg, #389e0d 0%, #73d13d 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 180, 42, 0.3);
}

.btn-status-warning:hover {
    background: linear-gradient(135deg, #cf1322 0%, #ff4d4f 100%);
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 63, 63, 0.3);
}

/* 脉冲动画效果 */
@keyframes pulse-good {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 180, 42, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(0, 180, 42, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 180, 42, 0);
    }
}

@keyframes pulse-warning {
    0% {
        box-shadow: 0 0 0 0 rgba(245, 63, 63, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(245, 63, 63, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(245, 63, 63, 0);
    }
}

/* 配件选项样式 */
.part-option {
    background: white;
    border: 2px solid #E5E6EB;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.part-option:hover {
    border-color: #165DFF;
    box-shadow: 0 8px 25px rgba(22, 93, 255, 0.15);
    transform: translateY(-4px);
}

.part-option.selected {
    border-color: #165DFF;
    background: rgba(22, 93, 255, 0.05);
}

/* 文本截断样式 */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 兼容性警示样式 */
.compatibility-warning-card {
    position: relative;
    animation: subtle-pulse 3s infinite;
}

.compatibility-warning-card:hover {
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

@keyframes subtle-pulse {
    0%, 100% {
        border-color: #fecaca;
    }
    50% {
        border-color: #f87171;
    }
}

.compatibility-warning-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    animation: warning-glow 2s infinite;
}

@keyframes warning-glow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }
}

.compatibility-issue-tooltip {
    position: absolute;
    background: #1f2937;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 5px;
}

.compatibility-issue-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #1f2937;
}

.compatibility-warning-card:hover .compatibility-issue-tooltip {
    opacity: 1;
}

/* 侧边栏样式 */
#selected-parts-sidebar {
    backdrop-filter: blur(10px);
}

/* 侧边栏滚动条样式 */
#selected-parts-sidebar::-webkit-scrollbar {
    width: 6px;
}

#selected-parts-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#selected-parts-sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#selected-parts-sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 悬浮操作按钮样式 */
.floating-actions {
    position: fixed;
    bottom: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    padding: 16px;
    z-index: 100;
    border-top: 1px solid #e5e6eb;
    transition: all 0.3s ease;
}

.floating-actions .container {
    max-width: 1200px;
    margin: 0 auto;
}

/* 为底部内容添加额外的内边距，防止被悬浮按钮遮挡 */
main {
    padding-bottom: 80px !important;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 0;
    border: none;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.close:hover {
    opacity: 1;
}

.compatibility-item {
    background: #f8f9fa;
    border-left: 4px solid #dc3545;
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.compatibility-item.warning {
    border-left-color: #ffc107;
}

.compatibility-item.info {
    border-left-color: #17a2b8;
}

.score-section {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.score-bar {
    background: #e9ecef;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.score-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    transition: width 0.5s ease;
}

.power-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

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

.power-total {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: bold;
    font-size: 16px;
}

/* 主板示例弹窗样式 */
.motherboard-preview-modal {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.motherboard-preview-container {
    position: relative;
    width: 400px;
    height: 340px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-shrink: 0;
}

.parts-info-panel {
    flex: 1;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    max-height: 340px;
    overflow-y: auto;
}

/* 主板预览组件样式 */
#motherboardExampleModal .banzi {
    width: 100px;
    height: 120px;
    position: absolute;
    bottom: 0px;
    background: url(zhuban.png);
    background-size: 100% 100%;
}

#motherboardExampleModal .cpu, 
#motherboardExampleModal .zhuban, 
#motherboardExampleModal .neicun, 
#motherboardExampleModal .xianka, 
#motherboardExampleModal .yingpan, 
#motherboardExampleModal .dianyuan, 
#motherboardExampleModal .sanre {
    position: absolute;
    z-index: 3;
    width: auto;
    height: auto;
}

#motherboardExampleModal .item {
    white-space: nowrap;
    display: flex;
    align-items: center;
    line-height: 22px;
    color: #162f66;
    font-size: 11px;
    padding-right: 10px;
}

#motherboardExampleModal .item img {
    width: 22px;
    height: 22px;
    margin-right: 5px;
}

/* 各组件位置 */
#motherboardExampleModal .cpu {
    left: 34px;
    bottom: 99px;
}

#motherboardExampleModal .zhuban {
    left: 100px;
    bottom: 108px;
}

#motherboardExampleModal .neicun {
    left: 68px;
    bottom: 113px;
}

#motherboardExampleModal .xianka {
    left: 45px;
    bottom: 42px;
}

#motherboardExampleModal .yingpan {
    left: 97px;
    bottom: 2px;
}

#motherboardExampleModal .dianyuan {
    left: 100px;
    bottom: 78px;
}

#motherboardExampleModal .sanre {
    left: 44px;
    bottom: 118px;
}

/* 连接线样式 */
#motherboardExampleModal .cpu-line {
    width: 100px;
    height: 220px;
    border-top: 1px solid #333;
    border-left: 1px solid #333;
    position: absolute;
    left: 34px;
    bottom: 99px;
    z-index: 2;
}

#motherboardExampleModal .zhuban-line {
    width: 35px;
    height: 10px;
    border-top: 1px solid #333;
    position: absolute;
    left: 100px;
    bottom: 108px;
    z-index: 2;
}

#motherboardExampleModal .neicun-line {
    width: 65px;
    height: 75px;
    border-top: 1px solid #333;
    border-left: 1px solid #333;
    position: absolute;
    left: 68px;
    bottom: 113px;
    z-index: 2;
}

#motherboardExampleModal .xianka-line {
    width: 90px;
    height: 10px;
    border-top: 1px solid #333;
    position: absolute;
    left: 45px;
    bottom: 42px;
    z-index: 2;
}

#motherboardExampleModal .yingpan-line {
    width: 35px;
    height: 10px;
    border-top: 1px solid #333;
    position: absolute;
    left: 97px;
    bottom: 2px;
    z-index: 2;
}

#motherboardExampleModal .dianyuan-line {
    width: 118px;
    height: 110px;
    border-top: 1px dashed #333;
    border-left: 1px dashed #333;
    position: absolute;
    left: 17px;
    bottom: 118px;
    z-index: 2;
}

#motherboardExampleModal .sanre-line {
    width: 90px;
    height: 155px;
    border-top: 1px solid #333;
    border-left: 1px solid #333;
    position: absolute;
    left: 44px;
    bottom: 118px;
    z-index: 2;
}

/* 已选择组件样式 */
#motherboardExampleModal .cpu.selected, 
#motherboardExampleModal .zhuban.selected, 
#motherboardExampleModal .neicun.selected, 
#motherboardExampleModal .xianka.selected, 
#motherboardExampleModal .yingpan.selected, 
#motherboardExampleModal .dianyuan.selected, 
#motherboardExampleModal .sanre.selected {
    border-radius: 4px;
}

/* 配件信息项样式 */
.part-info-item {
    display: flex;
    align-items: center;
    padding: 10px;
    background: white;
    border-radius: 6px;
    border-left: 4px solid #e2e8f0;
}

.part-info-item.selected {
    border-left-color: #4299e1;
    background: #ebf8ff;
}

.part-info-item .part-icon {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: white;
    font-size: 14px;
}

.part-info-item .part-details {
    flex: 1;
}

.part-info-item .part-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 2px;
}

.part-info-item .part-model {
    font-size: 12px;
    color: #718096;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .motherboard-preview-modal {
        flex-direction: column;
    }
    
    .motherboard-preview-container {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
    }
}