/* 基础样式 - 更年轻高饱和配色 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #0051CF;
    --primary-light: #3b82f6;
    --primary-dark: #003a9b;
    --accent-color: #10b981;
    --text-color: #1f2937;
    --text-light: #4b5563;
    --text-lighter: #9ca3af;
    --bg-color: #f9fafb;
    --card-color: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
    --module-bg: #f0f9ff;
    --module-text: #0369a1;
}

body {
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

h1, h2, h3, h4 {
    margin-bottom: 15px;
    color: var(--text-color);
    font-weight: 500;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 头部样式 */
header {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 0;
    box-shadow: var(--shadow-sm);
}

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

/* Header工具栏样式 */
#header-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 8px 15px;
    margin-top: 8px;
}

.toolbar-left {
    flex: 0 0 auto;
}

.toolbar-center {
    display: flex;
    gap: 15px;
    align-items: center;
    flex: 1;
    justify-content: center;
}

header h1 {
    margin-bottom: 0;
    color: white;
    font-size: 24px;
    font-weight: 500;
}

.language-switcher {
    display: flex;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn.active {
    background-color: white;
    color: var(--primary-color);
    border-color: white;
}

.lang-btn:first-child {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.lang-btn:last-child {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* 主内容 */
main {
    flex-grow: 1;
    padding: 20px 0;
}

/* 品类选择器 */
.category-selector {
    margin-bottom: 30px;
}

.category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    justify-content: center;
}

.category-card {
    width: 180px;
    height: 150px;
    border-radius: var(--radius-md);
    background-color: var(--card-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 15px;
    border: 1px solid transparent;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.category-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: var(--primary-color);
}

.category-name {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
}

/* 品类名称标签 */
.category-name-label {
    font-size: 14px;
    color: white;
    font-weight: 500;
    margin-left: 8px;
    padding: 2px 8px;
    background-color: var(--primary-light);
    border-radius: var(--radius-sm);
}

/* 返回按钮 */
.back-to-home {
    margin-bottom: 20px;
}

.back-btn {
    background: none;
    border: none;
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 6px 0;
    transition: var(--transition);
}

/* Header中的返回按钮样式 */
#header-toolbar .back-btn {
    color: white;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background-color: rgba(255, 255, 255, 0.1);
}

.back-btn:hover {
    color: var(--primary-dark);
}

/* Header中的返回按钮hover效果 */
#header-toolbar .back-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
}

.back-btn i {
    margin-right: 5px;
}

/* 工具栏 */
.toolbar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
    background-color: var(--card-color);
    padding: 15px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.toolbar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toolbar-divider {
    height: 30px;
    width: 1px;
    background-color: var(--border-color);
    margin: 0 5px;
}

/* 筛选按钮 */
.filter-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.filter-button:hover {
    background-color: var(--primary-dark);
}

.filter-count {
    background-color: white;
    color: var(--primary-color);
    font-size: 12px;
    height: 20px;
    min-width: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0 6px;
}

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

.sidebar-modal.active {
    display: block;
}

.sidebar-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background-color: var(--card-color);
    box-shadow: var(--shadow-lg);
    padding: 20px;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.sidebar-modal.active .sidebar-content {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 18px;
    font-weight: 500;
    margin: 0;
    color: var(--primary-color);
}

.close-sidebar {
    background: none;
    border: none;
    color: var(--text-lighter);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s;
}

.close-sidebar:hover {
    color: var(--text-color);
}

/* 对比表格样式 */
.comparison-table-container {
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.comparison-table {
    min-width: 800px;
    background-color: var(--card-color);
    border-radius: var(--radius-md);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.comparison-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
}

.comparison-table th, 
.comparison-table td {
    padding: 8px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.comparison-table td:not(:first-child) {
    text-align: center;
}

/* 添加单元格内文本溢出时的提示 */
.comparison-table td:hover:not(:first-child) {
    white-space: normal;
    overflow: visible;
    z-index: 5;
    position: relative;
    background-color: #f8f9fa;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
}

.comparison-table th:first-child,
.comparison-table td:first-child {
    position: sticky;
    left: 0;
    background-color: white;
    z-index: 2;
    border-right: 1px solid var(--border-color);
    width: 280px;
    min-width: 280px;
    max-width: 280px;
}

.comparison-table th:not(:first-child), 
.comparison-table td:not(:first-child) {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comparison-table th:first-child {
    z-index: 4;
}

.comparison-table thead {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: white;
}

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

.comparison-table tr:hover td:first-child {
    background-color: #f5f5f5;
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: white;
}

.sticky-product-header {
    position: sticky;
    top: 0;
    z-index: 4;
    height: 60px;
    display: flex;
    align-items: center;
    background-color: white;
    box-shadow: var(--shadow-sm);
    padding: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.product-header-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.product-header-image:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.product-header-name {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    line-height: 1.2;
}

.attribute-module {
    background-color: var(--module-bg);
    color: var(--module-text);
    padding: 8px 15px;
    font-weight: bold;
    position: sticky;
    top: 60px;
    z-index: 2;
}

.attribute-row {
    font-size: 14px;
    height: 36px;
}

.attribute-name {
    font-weight: 500;
}

.bool-value {
    font-size: 18px;
    text-align: center;
}

.bool-true {
    color: var(--accent-color);
}

.bool-false {
    color: #ef4444;
}

.product-image-cell {
    padding: 10px 15px !important;
    text-align: center;
}

.product-image-cell img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    cursor: pointer;
    transition: var(--transition);
    border-radius: var(--radius-sm);
    margin: 0 auto;
}

.product-image-cell img:hover {
    transform: scale(1.05);
}

/* 属性筛选树 */
.attribute-tree {
    user-select: none;
}

.attribute-group {
    margin-bottom: 15px;
}

.attribute-group-label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-sm);
    background-color: var(--module-bg);
    margin-bottom: 8px;
    color: var(--module-text);
}

.attribute-group-icon {
    margin-right: 8px;
}

.attribute-group-toggle {
    margin-left: auto;
    transition: transform 0.3s;
    color: var(--text-lighter);
}

.attribute-group.collapsed .attribute-group-toggle {
    transform: rotate(-90deg);
}

.attribute-group.collapsed .attribute-items {
    display: none;
}

.attribute-items {
    margin-left: 24px;
    margin-top: 8px;
}

.attribute-item {
    display: flex;
    align-items: center;
    margin: 8px 0;
}

.attribute-checkbox {
    margin-right: 8px;
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 3px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.attribute-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.attribute-checkbox:checked::after {
    content: '\2713';
    font-size: 12px;
    color: white;
    position: absolute;
    top: 0;
    left: 3px;
}

/* 筛选控件 */
.filter-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
}

.select-all-btn {
    background-color: var(--primary-light);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.select-all-btn:hover {
    background-color: var(--primary-color);
}

/* 产品筛选网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.product-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    background-color: var(--card-color);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-card.selected {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.product-card.selected::after {
    content: "\f00c";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.product-image {
    width: 100%;
    height: 120px;
    object-fit: contain;
    background-color: #fafafa;
    transition: var(--transition);
}

.product-info {
    padding: 12px;
}

.product-model {
    font-weight: 500;
    font-size: 14px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-brand, .product-price {
    font-size: 12px;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 图片放大弹窗 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-image-content {
    display: block;
    margin: 50px auto;
    max-width: 90%;
    max-height: 90%;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0.1)}
    to {transform: scale(1)}
}

.close-image-modal {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: 300;
    cursor: pointer;
    transition: var(--transition);
}

.close-image-modal:hover {
    color: white;
}

/* 页脚 */
footer {
    background-color: var(--primary-color);
    color: white;
    padding: 20px 0;
    text-align: center;
    margin-top: auto;
}

footer p {
    margin: 0;
}

/* 媒体查询 */
@media (max-width: 768px) {
    .toolbar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sidebar-content {
        width: 300px;
    }
    
    .category-card {
        width: 140px;
        height: 120px;
    }
    
    .category-icon {
        font-size: 36px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 480px) {
    .category-card {
        width: 120px;
        height: 100px;
    }
    
    .category-icon {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .category-name {
        font-size: 14px;
    }
} 