/* CPU首页专用样式 - 优化版本 */
.cpu-comparison-home {
    margin: 10px auto;
    padding: 15px;
}


/* 通栏头部样式 */
.full-width-header {
    background-color: #1a237e;
    padding: 30px 0;
    margin: 0 -15px;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
}
        
.cpu-home-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 25px;
}
        
        .page-title {
            font-size: 36px;
            font-weight: 700;
            color: white;
            margin-bottom: 10px;
            letter-spacing: -0.5px;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        
        .page-subtitle {
            font-size: 18px;
            color: rgba(255, 255, 255, 0.85);
            max-width: 700px;
            margin: 0 auto;
            font-weight: 400;
        }
        
        /* 装饰元素 */
        .header-decoration {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            pointer-events: none;
            z-index: 0;
        }
        
        .circle {
            position: absolute;
            border-radius: 50%;
            background: rgba(255, 255, 255, 0.05);
        }
        
        .circle-lg {
            width: 300px;
            height: 300px;
            top: -150px;
            right: -150px;
        }
        
        .circle-md {
            width: 180px;
            height: 180px;
            bottom: -90px;
            left: 10%;
        }
        
        .circle-sm {
            width: 100px;
            height: 100px;
            top: 40%;
            left: 20%;
        }


/* 控制面板 - 主要优化点 */
.cpu-control-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
}

/* 新增：确保类别和搜索框始终垂直对齐 */
.cpu-categories, .cpu-search-container {
    display: flex;
    align-items: center;
    height: 100%;
}

/* 类别选项卡 */
.cpu-categories ul.category-tabs {
    display: flex;
    list-style: none;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: -30px;
    padding: 0;
    align-items: center; 
}

.cpu-categories ul.category-tabs li {
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f0f4ff;
    color: #1a237e;
    border: 1px solid #dde4f7;
    font-size: 14px;
    margin-bottom: 4px; /* 移除底部间距 */
}

.cpu-categories ul.category-tabs li:hover {
    background: #e1e8ff;
}

.cpu-categories ul.category-tabs li.active {
    background: #1a237e;
    color: white;
    font-weight: 600;
}



/* 新增：搜索方块 */
.cpu-search-container .search-box::before {
    content: "🔍";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: #FFF;
    color: white;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    z-index: 2;
}

/* 搜索框容器 */
.cpu-search-container {
    width: 100%; 
    max-width: 600px;
    margin: 20px auto 0;
}

/* 搜索框内部调整 */
.cpu-search-container .search-box {
    position: relative;
    width: 100%; 
}

/* 蓝色方块定位微调 */
.cpu-search-container .search-box::before {
    left: 12px; 
}

/* 输入框宽度调整 */
.cpu-search-container input {
    width: 100%; 
    padding: 11px 15px 11px 50px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .cpu-search-container {
        max-width: 90%; 
    }
}

/* CPU列表容器 */
.cpu-list-container {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

/* CPU列表 */
.cpu-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* CPU项卡片 - 高度统一优化 */
.cpu-item {
    background: white;
    border-radius: 10px;
    padding: 18px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #f0f4ff;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 220px; /* 统一最小高度 */
}

.cpu-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: #dde4f7;
}

/* CPU头部 - 名称高度统一优化 */
.cpu-item-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f4ff;
    min-height: 60px; /* 确保名称区域高度统一 */
}

.cpu-rank {
    background: #3949ab;
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-right: 10px;
    min-width: 45px;
    text-align: center;
    flex-shrink: 0;
    margin-top: 3px;
}

.cpu-name {
    font-size: 17px;
    font-weight: 700;
    color: #1a237e;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制最多2行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 48px; /* 确保即使只有一行也保持高度 */
}

.cpu-name-link {
    text-decoration: none;
    transition: color 0.3s;
    flex: 1;
}

.cpu-name-link:hover .cpu-name {
    color: #3949ab;
    text-decoration: underline;
}


.cpu-score-card {
    flex: 1;
    text-align: center;
    background: #f8f9ff;
    border-radius: 7px;
    padding: 10px;
    border: 1px solid #eef2f7;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.score-label {
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    font-weight: 500;
}

.score-value {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.multi-score {
    color: #2196f3;
}

.single-score {
    color: #ff9800;
}

/* 操作按钮 */
.cpu-actions {
    display: flex;
    gap: 8px;
    margin-top: auto; /* 确保按钮始终在底部 */
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 12px;
    border: none;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.btn .dashicons {
    margin-right: 4px;
    font-size: 15px;
}

.btn-detail {
    background: #f0f4ff;
    color: #1a56db;
}

.btn-detail:hover {
    background: #1a56db;
    color: white;
}

.btn-compare {
    background: #4caf50;
    color: white;
}

.btn-compare:hover {
    background: #388e3c;
}

/* 对比浮动框 - 修复显示问题 */
.compare-floating-box {
    position: fixed;
    top: 120px;
    right: 20px;
    background: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 300px;
    min-width: 300px;
    border: 1px solid #eef2f7;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.3s ease;
}

.compare-floating-box.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f4ff;
}

.compare-title {
    font-weight: 600;
    font-size: 17px;
    color: #1a237e;
}

.compare-count {
    background: #ff5722;
    color: white;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
}

.compare-items {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 12px;
}

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

.compare-item-name {
    flex: 1;
    font-size: 13px;
    color: #333;
    padding-right: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.compare-item-remove {
    color: #f44336;
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.compare-item-remove:hover {
    transform: scale(1.2);
}

.compare-actions {
    display: flex;
    gap: 8px;
}

.btn-clear {
    background: #f5f5f5;
    color: #555;
    flex: 1;
    padding: 8px 10px;
    font-size: 13px;
}

.btn-clear:hover {
    background: #e0e0e0;
}

.btn-view-compare {
    background: #1a237e;
    color: white;
    flex: 2;
    padding: 8px 10px;
    font-size: 13px;
}

.btn-view-compare:hover {
    background: #3949ab;
}

/* 反馈弹窗 */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.feedback-modal.active {
    opacity: 1;
    visibility: visible;
}

.feedback-content {
    background: white;
    border-radius: 10px;
    width: 100%;
    max-width: 480px;
    padding: 25px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.2);
    transform: translateY(25px);
    transition: transform 0.3s ease;
}

.feedback-modal.active .feedback-content {
    transform: translateY(0);
}

.feedback-header {
    margin-bottom: 20px;
    text-align: center;
}

.feedback-header h3 {
    font-size: 22px;
    color: #1a237e;
    margin-bottom: 8px;
}

.feedback-header p {
    color: #666;
    font-size: 15px;
}

.feedback-form .form-group {
    margin-bottom: 18px;
}

.feedback-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

.feedback-form input,
.feedback-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 7px;
    font-size: 15px;
    background: #f8f9ff;
    transition: all 0.3s;
}

.feedback-form input:focus,
.feedback-form textarea:focus {
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
    outline: none;
    background: white;
}

.feedback-form textarea {
    min-height: 100px;
    resize: vertical;
}

.feedback-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.btn-cancel {
    background: #f5f5f5;
    color: #555;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-submit {
    background: #1a237e;
    color: white;
    padding: 10px 20px;
    font-size: 14px;
}

.btn-submit:hover {
    background: #3949ab;
}

/* 加载更多 */
.load-more-container {
    text-align: center;
    margin: 35px 0 15px;
}

.btn-load-more {
    padding: 12px 30px;
    background: #1a237e;
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(26, 35, 126, 0.2);
}

.btn-load-more:hover {
    background: #3949ab;
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(26, 35, 126, 0.25);
}

.loading-indicator {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px 0;
    color: #555;
    font-size: 15px;
}

.spinner {
    border: 3px solid rgba(26, 35, 126, 0.2);
    border-top: 3px solid #1a237e;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ================= 响应式优化 - 手机端最小边距 ================= */
@media (max-width: 992px) {
    .cpu-control-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 12px;
    }
    
    .cpu-categories ul.category-tabs {
        justify-content: center;
    }
    
    .cpu-search-container .search-box {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .cpu-comparison-home {
        padding: 5px; /* 最小边距 */
    }
    
    .cpu-home-header {
        padding: 10px 0 15px;
    }
    
    .compare-header {
        display: none;
    }
    
    .page-title {
        font-size: 24px;
    }
    
    .page-subtitle {
        font-size: 14px;
    }
    
    .cpu-control-panel {
        border-radius: 8px;
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .cpu-categories ul.category-tabs li {
        padding: 7px 12px;
        font-size: 13px;
    }
    
    .cpu-list-container {
        padding: 10px;
        border-radius: 8px;
    }
    
    .cpu-list {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
        gap: 12px;
    }
    
    .cpu-item {
        padding: 15px;
        min-height: 200px;
    }
    
    .cpu-name {
        font-size: 16px;
        min-height: 44px;
    }
    
    .compare-floating-box {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        max-width: none;
        min-width: auto;
        right: auto;
        transform: translateY(100%); /* 关键修复：初始位置在屏幕外 */
    }
    
    .compare-floating-box.active {
        transform: translateY(0); /* 关键修复：显示时移动到屏幕内 */
    }
    
    .feedback-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .cpu-comparison-home {
        padding: 0; /* 完全去掉边距 */
    }
    
    .cpu-control-panel {
        border-radius: 0;
        padding: 10px 5px;
        margin-bottom: 10px;
    }
    
    .cpu-list-container {
        padding: 8px 5px;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #eee;
        border-bottom: 1px solid #eee;
    }
    
    .cpu-item {
        padding: 12px;
        min-height: 190px;
        border-radius: 8px;
    }
    
    .cpu-item-header {
        min-height: 54px;
    }
    
    .cpu-name {
        font-size: 15px;
        min-height: 42px;
    }
    
    .cpu-scores {
        flex-direction: column;
        gap: 8px;
    }
    
    .cpu-actions {
        flex-direction: row; /* 保持横向布局 */
        gap: 6px;
    }
    
    .btn {
        padding: 8px 10px;
        font-size: 12px;
    }
    
    .btn .dashicons {
        font-size: 14px;
    }
    
    .compare-floating-box {
        position: fixed;
        bottom: 0;
        top: auto;
        left: 0;
        width: 100%;
        max-width: 100%;
        border-radius: 12px 12px 0 0;
        max-width: none;
        min-width: auto;
        right: auto;
        padding: 14px;
    }
    
    .load-more-container {
        margin: 25px 0 10px;
    }
    
    .btn-load-more {
        padding: 10px 25px;
        font-size: 14px;
    }
    
    .feedback-content {
        max-width: 95%;
        padding: 15px;
    }
    
    .feedback-header h3 {
        font-size: 20px;
    }
}