/* 全局样式 */
:root {
    --primary-color: #2196F3;
    --secondary-color: #1976D2;
    --background-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --row-height: 3.2em;  /* 添加行高变量 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    min-width: 320px;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: hidden;
    position: relative;
}

/* 头部样式 */
header {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 200;
}

h1 {
    font-size: 2em;
    color: var(--primary-color);
    margin: 0;
}

/* 语言切换器 */
.language-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* 筛选器样式 */
.filters {
    background-color: #fff;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 80px;
    z-index: 150;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters select:hover {
    border-color: #007bff;
}

.filters select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 表格容器样式 */
.table-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: auto;
    margin-top: 20px;
    position: relative;
    max-height: calc(100vh - 300px);
}

/* 视觉隐藏标题样式 */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 表格样式 */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

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

/* 设置列宽 */
th:nth-child(1), td:nth-child(1) { width: 30%; }  /* 产品名称 */
th:nth-child(2), td:nth-child(2) { width: 15%; }  /* 每TB价格 */
th:nth-child(3), td:nth-child(3) { width: 15%; }  /* 价格 */
th:nth-child(4), td:nth-child(4) { width: 10%; }  /* 容量 */
th:nth-child(5), td:nth-child(5) { width: 10%; }  /* 保修 */
th:nth-child(6), td:nth-child(6) { width: 10%; }  /* 外形 */
th:nth-child(7), td:nth-child(7) { width: 10%; }  /* 技术 */
th:nth-child(8), td:nth-child(8) { width: 10%; }  /* 状态 */

th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 100;
}

td {
    color: var(--text-color);
    min-width: 80px;
    height: auto;
    min-height: calc(1.4em * 2);
}

tbody tr:hover {
    background-color: #f8f9fa;
}

/* 产品链接样式 */
.product-link {
    color: #007bff;
    text-decoration: none;
    font-size: 13px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    position: relative;
}

.product-link:hover {
    text-decoration: underline;
}

/* 工具提示样式 */
.product-link[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    white-space: normal;
    max-width: 300px;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    line-height: 1.4;
}

/* 价格样式 */
.price {
    font-weight: 500;
    color: #2e7d32;
}

/* 页脚样式 */
footer {
    margin-top: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
    color: #666;
}

/* 响应式设计 */
@media screen and (max-width: 1024px) {
    .container {
        padding: 10px;
    }

    table {
        min-width: 800px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header {
        position: relative;
        top: 0;
    }

    .filters {
        position: relative;
        top: 0;
    }

    .filters select {
        width: 100%;
        min-width: 100%;
    }

    .table-container {
        margin: 10px -10px;
        border-radius: 0;
    }

    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* 确保在小屏幕上表格可以水平滚动 */
@media screen and (max-width: 480px) {
    .table-container {
        margin: 0 -10px;
        width: calc(100% + 20px);
        border-radius: 0;
    }

    table {
        min-width: 100%;
    }
}

/* 添加滚动条样式 */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 容量列样式 */
.capacity {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
} 