/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
}

header h1 {
    text-align: center;
    margin: 0;
}

header h1 a {
    color: white;
    text-decoration: none;
}

header h1 a:hover {
    text-decoration: underline;
}

nav ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0 0 0;
    text-align: center;
}

nav ul li {
    display: inline-block;
    margin: 0 15px;
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

nav ul li a:hover {
    background-color: #34495e;
    text-decoration: none;
}

nav ul li a.active {
    background-color: #3498db;
}

main {
    min-height: calc(100vh - 120px);
}

footer {
    background-color: #34495e;
    color: white;
    text-align: center;
    padding: 1rem 0;
    margin-top: 20px;
}

h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

h3 {
    color: #34495e;
}

/* 认识流量计模块样式 */
.meter-types {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.meter-type {
    flex: 0 0 calc(33.333% - 20px);
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.meter-description {
    margin-top: 15px;
}

.meter-animation {
    margin-top: 15px;
    text-align: center;
}

.placeholder {
    background-color: #ecf0f1;
    border: 2px dashed #bdc3c7;
    padding: 40px 20px;
    color: #7f8c8d;
    font-style: italic;
}

/* Tab切换样式 */
.meter-tabs {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    border-bottom: 2px solid #3498db;
    margin-bottom: 20px;
}

.tab-button {
    background-color: #f1f1f1;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 14px 20px;
    transition: 0.3s;
    font-size: 16px;
    border-radius: 8px 8px 0 0;
    margin-right: 5px;
}

.tab-button:hover {
    background-color: #ddd;
}

.tab-button.active {
    background-color: #3498db;
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
    border: 1px solid #ccc;
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    margin-top: 0;
    color: #2c3e50;
}

.tab-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.tab-content li {
    margin-bottom: 5px;
}

/* 流量计对比模块样式 */
.meter-type-selection {
    margin-bottom: 20px;
}

.meter-type-selection label {
    font-weight: bold;
    margin-right: 10px;
}

.meter-type-selection select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.meter-model-selection {
    margin-bottom: 20px;
}

.meter-models-table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

.meter-models-table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.meter-models-table th,
.meter-models-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.meter-models-table th {
    background-color: #3498db;
    color: white;
    font-weight: bold;
    text-align: center;
}

.meter-models-table tbody tr:hover {
    background-color: #f5f5f5;
}

.meter-models-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.meter-models-table input[type="checkbox"] {
    transform: scale(1.3);
    margin: 0 auto;
    display: block;
}

.meter-models {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.model-checkbox {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    background-color: #f9f9f9;
}

.model-checkbox label {
    font-weight: bold;
    display: block;
    margin-bottom: 5px;
}

.model-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    color: #666;
}

.comparison-results {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.comparison-results table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed; /* 固定表格布局确保对齐 */
}

.comparison-results th,
.comparison-results td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
    vertical-align: middle;
    word-wrap: break-word; /* 长文本自动换行 */
}

.comparison-results th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.comparison-results td {
    background-color: #fff;
}

/* 图表容器样式 */
.charts-container {
    margin-top: 30px;
}

.chart-wrapper {
    margin-bottom: 25px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f9f9f9;
    overflow: hidden; /* 防止内容溢出 */
}

.chart-wrapper h3 {
    margin: 0 0 10px 0;
    text-align: center;
    font-size: 16px;
}

/* HTML图表样式 */
.html-pipeline-chart {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 对比表格专用样式 */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    table-layout: fixed; /* 固定表格布局 */
}

.comparison-table th,
.comparison-table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: center;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comparison-table th {
    background-color: #f2f2f2;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison-table .param-column {
    width: 20%; /* 参数列固定宽度 */
    background-color: #f8f9fa;
    font-weight: bold;
    text-align: left;
    padding-left: 15px;
}

.comparison-table .model-column {
    width: calc(80% / var(--model-count, 2)); /* 动态分配模型列宽度 */
}

.comparison-table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.comparison-table tbody tr:hover {
    background-color: #e8f4fd;
}

/* 智能选型模块样式 */
.ai-chat {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background-color: #fff;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 4px;
}

.user-message {
    background-color: #007bff;
    color: white;
    text-align: right;
    margin-left: 20%;
}

.ai-message {
    background-color: #e9ecef;
    color: #333;
    text-align: left;
    margin-right: 20%;
}

.message-content {
    display: inline-block;
}

.chat-input {
    display: flex;
}

.chat-input input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.chat-input button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.chat-input button:hover {
    background-color: #0056b3;
}

.recommendations {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.recommendations h3 {
    margin-top: 0;
    color: #333;
}

.model-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.model-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.model-card h4 {
    margin-top: 0;
    color: #333;
}

.model-card p {
    margin: 5px 0;
    color: #666;
}

.details-link {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.details-link:hover {
    background-color: #0056b3;
}

/* 首页样式 */
.home-intro {
    text-align: center;
    margin-top: 30px;
}

.home-intro p {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
}

.features {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 20px;
}

.feature-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
    width: 250px;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-card h3 {
    color: #2c3e50;
    margin-top: 0;
}

.feature-card p {
    color: #7f8c8d;
    font-size: 16px;
}

.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #2980b9;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .meter-type {
        flex: 0 0 calc(50% - 20px);
    }
    
    nav ul li {
        display: block;
        margin: 5px 0;
    }
    
    .features {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .meter-type {
        flex: 0 0 100%;
    }
    
    .chat-messages {
        height: 200px;
    }
    
    .feature-card {
        width: 90%;
    }
}

/* 模态框样式 */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    border-radius: 8px;
    width: 80%;
    max-width: 700px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
}

.close-btn {
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.close-btn:hover {
    color: #000;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.detail-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.detail-table td:first-child {
    background-color: #f8f9fa;
    width: 30%;
    font-weight: bold;
}

.detail-table tr:last-child td {
    border-bottom: none;
}

/* 更多按钮样式 */
.detail-btn {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s ease;
}

.detail-btn:hover {
    background-color: #2980b9;
}