/* 全局样式 */
.cpu-comparison-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 搜索框 */
.cpu-search-container {
    position: relative;
    margin-bottom: 0px;
    width: 300px;
}

.cpu-search-container input {
    width: 100%;
    padding: 5px 10px;  
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

/* 分数卡片 */
.cpu-scores {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
    flex-grow: 1; /* 确保分数区域填充空间 */
}

/* CPU列表 - 关键修复 */
.cpu-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    opacity: 1 !important; /* 确保始终可见 */
}

/* 移除所有隐藏搜索结果的样式 */
.cpu-list.searching .cpu-item {
    display: block !important; /* 覆盖任何隐藏样式 */
    opacity: 1 !important;
}

.cpu-item {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
    display: block; /* 确保默认显示 */
    opacity: 1; /* 确保默认可见 */
}

.cpu-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.cpu-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.cpu-top {
    display: flex;
    justify-content: space-between;
}

.cpu-rank {
    display: inline-block;
    background: #4CAF50;
    color: white; 
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 10px;
}


.cpu-score {
    text-align: center;
    flex: 1;
}

.score-label {
    font-size: 12px;
    color: #777;
    margin-bottom: 5px;
}

.score-value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

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

.single-score {
    color: #FF9800;
}

.cpu-meta {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.cpu-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.btn-detail {
    background: #f5f5f5;
    color: #333;
}

.btn-detail:hover {
    background: #eaeaea;
}

.btn-compare {
    background: #2196F3;
    color: white;
}

.btn-compare:hover {
    background: #0b7dda;
}

/* 对比浮动框 */
.compare-floating-box {
    position: fixed;
    top: 120px;
    right: 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 1000;
    max-width: 310px;
    min-width: 310px;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.compare-title {
    font-weight: 600;
    font-size: 16px;
}

.compare-count {
    background: #2196F3;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

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

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

.compare-item-name {
    flex: 1;
}

.compare-item-remove {
    color: #f44336;
    cursor: pointer;
    padding: 5px;
}

.compare-actions {
    display: flex;
    justify-content: space-between;
}

.btn-clear {
    background: #f5f5f5;
    color: #333;
}

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

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

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

/* 详情页 */
.cpu-detail-container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.cpu-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cpu-detail-name {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.cpu-detail-rank {
    font-size: 18px;
    background: #4CAF50;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
}

.cpu-detail-scores {
    display: flex;
    justify-content: space-around;
    margin-bottom: 30px;
    text-align: center;
}

.cpu-detail-score {
    flex: 1;
}

.cpu-detail-score-value {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 5px;
    color: #2196f3;
}

.cpu-detail-score-label {
    font-size: 16px;
    color: #777;
}

.cpu-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 50px;
    margin-bottom: 30px;
}

.cpu-spec {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.spec-label {
    font-weight: 600;
    color: #333;
}

.spec-value {
    font-weight: 500;
    color: #555;
}

/* 对比页 */
.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
}

.compare-table th {
    background: #f5f5f5;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #ddd;
}

.compare-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.compare-table tr:nth-child(even) {
    background: #fafafa;
}

.compare-table tr:hover {
    background: #f0f0f0;
}

.compare-header-cell {
    background: #e3f2fd;
    font-weight: 600;
}

/* 反馈弹窗 */
.feedback-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    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: 8px;
    width: 100%;
    max-width: 500px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

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

.feedback-header h3 {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

.feedback-header p {
    color: #666;
}

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

.feedback-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.feedback-form input,
.feedback-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

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

.feedback-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-cancel {
    background: #f5f5f5;
    color: #333;
}

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

.btn-submit {
    background: #2196F3;
    color: white;
}

.btn-submit:hover {
    background: #0b7dda;
}

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

.btn-load-more {
    padding: 12px 30px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-load-more:hover {
    background: #0b7dda;
}

.loading-text {
    color: #777;
    margin-top: 20px;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    color: #666;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* 搜索信息提示 - 确保显示 */
.search-results-info {
    background: #f8f8f8;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 10px;
    display: block !important; /* 确保始终显示 */
    color: #666;
    font-size: 14px;
}

.no-results, .no-more, .error {
    text-align: center;
    padding: 20px;
    color: #666;
    background: #f9f9f9;
    border-radius: 4px;
    margin: 10px 0;
    display: block; /* 确保显示 */
}

/* 添加类别选项卡样式 */
.cpu-categories {
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.cpu-categories ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

.cpu-categories ul li {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-right: 5px;
}

.cpu-categories ul li:hover {
    color: #2196F3;
    border-bottom-color: #2196F3;
}

.cpu-categories ul li.active {
    color: #2196F3;
    border-bottom-color: #2196F3;
    font-weight: 600;
}

.category-count {
    float: right;
    font-size: 14px;
    color: #666;
    padding: 5px 10px;
    margin-bottom: -30px;
    background: #f5f5f5;
    border-radius: 4px;
}

.category-count span {
    font-weight: 600;
    color: #2196F3;
}

/* 调整CPU列表上边距 */
.cpu-list {
    margin-top: 15px;
}

/* 响应式 */
@media (max-width: 768px) {
    .cpu-list {
        grid-template-columns: 1fr;
    }
    
    .cpu-specs {
        grid-template-columns: 1fr;
    }
    
    .cpu-scores {
        display: none !important;
    }

    /* 调整卡片内边距 */
    .cpu-item {
        padding: 15px !important; /* 缩小内边距 */
    }
 
    /* 优化头部间距 */
    .cpu-item-header {
        margin-bottom: 10px !important; /* 减少底部间距 */
        padding-bottom: 10px !important;
        border-bottom: 1px solid #eee; /* 添加分割线 */
    }
 
    /* 调整操作按钮区域 */
    .cpu-actions {
        margin-top: 0px !important; /* 减少上边距 */
        justify-content: center !important;
        gap: 15px;
    }
 
    /* 按钮尺寸优化 */
    .btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
 
    /* 隐藏跑分区域 */
    .cpu-scores {
        display: none !important;
    }
 
    /* 确保卡片高度自适应 */
    .cpu-item {
        min-height: auto !important;
    }
    .compare-table {
        display: block;
        overflow-x: auto;
    }
    
    .cpu-categories {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .category-count {
        margin-top: 10px;
    }
}