/*
Theme Name: CPU参数展示与对比
Theme URI: https://www.ppsu.xyz/
Description: 专业展示各类CPU参数并提供对比功能的WordPress主题
Author: PPSU
Author URI: https://www.ppsu.xyz/
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: cpu-compare
*/

/* 基础样式重置与设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.site-header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    font-size: 1.8rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

/* 导航菜单 */
.main-navigation {
    display: flex;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 25px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: opacity 0.3s;
}

.nav-menu a:hover {
    opacity: 0.8;
}


/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* 页面标题 */
.page-header {
    text-align: center;
    padding: 40px 0;
}

.page-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    color: #2c3e50;
}

.page-header p {
    color: #666;
    font-size: 1.1rem;
}

/* CPU类型筛选 */
.cpu-filters {
    margin-bottom: 30px;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.cpu-filters h2 {
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: #34495e;
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-btn {
    padding: 6px 15px;
    background-color: #ecf0f1;
    color: #34495e;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
    background-color: #3498db;
    color: white;
}

/* CPU卡片网格 */
.cpu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* CPU卡片样式 */
.cpu-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

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

.cpu-type-badge {
    background-color: #3498db;
    color: white;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cpu-title {
    padding: 15px 15px 10px;
    font-size: 1.2rem;
    color: #2c3e50;
    line-height: 1.3;
}

.cpu-short-specs {
    padding: 0 15px 15px;
    flex-grow: 1;
}

.spec-item {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
}

.spec-item strong {
    color: #333;
}

.cpu-card-actions {
    display: flex;
    padding: 15px;
    background-color: #f9f9f9;
    border-top: 1px solid #eee;
}

/* 按钮样式 */
.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s;
    text-decoration: none;
    text-align: center;
}

.view-details {
    background-color: #3498db;
    color: white;
    margin-right: 10px;
    flex-grow: 1;
}

.view-details:hover {
    background-color: #2980b9;
}

.add-to-compare {
    background-color: #2ecc71;
    color: white;
    flex-grow: 1;
}

.add-to-compare:hover {
    background-color: #27ae60;
}

/* 分页样式 */
.pagination {
    margin-top: 30px;
    text-align: center;
}

.pagination a {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 4px;
    background-color: white;
    color: #3498db;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.pagination a:hover,
.pagination .current {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 对比浮窗样式 - 缩小尺寸 */
.compare-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.2);
    width: 300px;
    max-height: 350px;
    z-index: 9999;
    transform: translateY(120%);
    transition: transform 0.3s ease-out;
    overflow: hidden;
}

    

.compare-float.visible {
    transform: translateY(0);
}

.compare-header {
    background-color: #2c3e50;
    color: white;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    position: relative; /* 确保按钮定位正确 */
    padding-right: 40px; /* 为最小化按钮预留空间 */
}

.compare-count {
    background-color: #e74c3c;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8rem;
    margin-left: 5px;
}

.compare-items {
    padding: 10px;
    max-height: 220px;
    overflow-y: auto;
}

.compare-item {
    padding: 8px 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-compare {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #e74c3c;
    cursor: pointer;
    font-weight: bold;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.compare-actions {
    padding: 10px 15px;
    background-color: #f1f1f1;
    display: flex;
    gap: 8px;
}

#startCompare {
    background-color: #3498db;
    color: white;
    flex-grow: 2;
}

#startCompare:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
}

#clearCompare {
    background-color: #e74c3c;
    color: white;
    flex-grow: 1;
}

/* 文章内容页样式 */
.single-cpu {
    padding: 30px 0;
}

.cpu-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.cpu-specs {
    padding: 30px;
}

.cpu-performance {
    padding: 30px;
    background-color: #f9f9f9;
    border-left: 1px solid #eee;
}

.cpu-full-title {
    margin-bottom: 25px;
    color: #2c3e50;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.spec-group {
    margin-bottom: 25px;
}

.spec-group h3 {
    margin-bottom: 15px;
    color: #34495e;
    font-size: 1.3rem;
}

.spec-list {
    list-style: none;
}

.spec-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
    display: flex;
}

.spec-list .spec-label {
    flex: 0 0 140px;
    font-weight: 600;
    color: #555;
}

.spec-list .spec-value {
    flex: 1;
    color: #333;
}

.performance-chart {
    height: 300px;
    margin-bottom: 30px;
    position: relative;
}

.performance-ranking h3 {
    margin-bottom: 15px;
    color: #34495e;
}

.ranking-list {
    list-style: none;
}

.ranking-list li {
    padding: 10px;
    margin-bottom: 8px;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 对比页面样式 */
.compare-page {
    padding: 30px 0;
}

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

.compare-page h1 {
    color: #2c3e50;
}

.compare-table-container {
    overflow-x: auto;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.compare-table th,
.compare-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.compare-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.compare-table .param-name {
    background-color: #f8f9fa;
    font-weight: 500;
}

.compare-table tr:hover td {
    background-color: #f9f9f9;
}

.compare-error {
    background-color: #fef5f5;
    border: 1px solid #ffe3e3;
    border-radius: 4px;
    padding: 20px;
    color: #e74c3c;
    text-align: center;
}

/* 响应式调整 */
@media (max-width: 768px) {
    /* 导航调整 */
    .main-navigation {
        display: none;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .main-navigation.toggled {
        display: block;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background-color: #2c3e50;
        padding: 20px;
        z-index: 999;
    }
    
    .nav-menu {
        flex-direction: column;
    }
    
    .nav-menu li {
        margin: 10px 0;
    }
    
    /* CPU内容页调整 */
    .cpu-content {
        grid-template-columns: 1fr;
    }
    
    .cpu-performance {
        border-left: none;
        border-top: 1px solid #eee;
    }
    
    /* 对比页面调整 */
    .compare-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* 页脚样式 */
.site-footer {
    background-color: #2c3e50;
    color: white;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin-bottom: 15px;
}

.copyright {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* 设置对比浮窗透明度为50% */
#compareFloat {
    opacity: 0.5 !important;
    transition: opacity 0.3s ease; /* 添加平滑过渡效果 */
}

/* 鼠标悬停时恢复完全不透明，提高操作体验 */
#compareFloat:hover {
    opacity: 1 !important;
}


/* 对比浮窗基础样式 */
.compare-float {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 160px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 9999;
    transition: all 0.3s ease;
    overflow: hidden;
}

/*备案链接自定义样式*/
.link-foot {
  color: #333;          /* 主文字颜色 */
  text-decoration: none; /* 移除默认下划线 */
  transition: color 0.2s ease; /* 平滑颜色过渡效果 */
}

/* 鼠标悬停状态 */
.link-foot:hover {
  color: #000;          /* 悬停时加深颜色 */
  text-decoration: underline; /* 悬停时显示下划线 */
}

/* 已访问链接状态 */
.link-foot:visited {
  color: #555;          /* 访问后的颜色 */
}

/* 搜索栏美化 */
.search-container {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-form {
    display: flex;
    align-items: center;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.search-form:focus-within {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-form input[type="search"] {
    flex: 1;
    padding: 10px 18px;
    border: none;
    background: #fff;
    font-size: 14px;
    color: #333;
    outline: none;
}

.search-form input[type="search"]::placeholder {
    color: #aaa;
    transition: color 0.3s;
}

.search-form input[type="search"]:focus::placeholder {
    color: #ddd;
}

.search-form .search-submit {
    padding: 10px 18px;
    background: #0073aa;
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-form .search-submit:hover {
    background: #006799;
}

.search-form .search-submit svg {
    width: 18px;
    height: 18px;
}

/* 搜索结果页面美化 */
.search-page {
    padding: 30px 0;
}

.search-title {
    margin-bottom: 25px;
    color: #23282d;
    font-size: 24px;
    font-weight: 600;
}

.search-results-count {
    margin-bottom: 20px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 6px;
    color: #666;
    font-size: 14px;
}

/* 搜索结果卡片 */
.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.search-result-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.search-result-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.search-result-card .card-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.search-result-card .card-title {
    margin: 0;
    font-size: 18px;
    line-height: 1.4;
}

.search-result-card .card-title a {
    color: #23282d;
    text-decoration: none;
    transition: color 0.3s;
}

.search-result-card .card-title a:hover {
    color: #0073aa;
}

.search-result-card .card-content {
    padding: 15px 20px;
}

.search-result-card .card-params {
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-result-card .card-param {
    padding: 6px 0;
    border-bottom: 1px dashed #f0f0f0;
    font-size: 14px;
    color: #555;
}

.search-result-card .card-param:last-child {
    border-bottom: none;
}

.search-result-card .card-actions {
    padding: 15px 20px;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
}

/* 分页样式 */
.pagination {
    margin: 40px 0 20px;
    text-align: center;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #0073aa;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* 无结果样式 */
.no-search-results {
    padding: 40px 25px;
    background: #fff;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.no-search-results p {
    margin-bottom: 15px;
    color: #666;
}

.no-search-results ul {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.no-search-results li {
    display: inline-block;
    margin: 0 8px 10px;
}

.no-search-results a {
    display: inline-block;
    padding: 6px 15px;
    background: #f0f0f1;
    border-radius: 20px;
    color: #0073aa;
    text-decoration: none;
    transition: all 0.3s;
}

.no-search-results a:hover {
    background: #0073aa;
    color: #fff;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .search-title {
        font-size: 20px;
    }
    
    .search-results {
        grid-template-columns: 1fr;
    }
    
    .pagination .page-numbers {
        padding: 6px 12px;
        margin: 0 2px;
        font-size: 13px;
    }
}
    