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

:root {
    /* 颜色变量 - Linear.app风格 */
    --bg-primary: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;
    --accent-primary: #3b82f6;
    --accent-secondary: #2563eb;
    --border-primary: #333333;
    --border-secondary: #444444;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    /* 阴影效果 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    /* 间距 */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

.dark-theme {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

/* 导航栏样式 */
.navbar {
    background-color: rgba(15, 15, 15, 0.95);
    /* backdrop-filter: blur(10px); */
    border-bottom: 1px solid var(--border-primary);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-4) var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtext {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.nav-links {
    display: flex;
    gap: var(--space-6);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    /* transition: color 0.2s ease; */
}

.nav-link:hover {
    color: var(--text-primary);
}

/* Hero区域样式 */
.hero-section {
    background: linear-gradient(135deg, rgba(15, 15, 15, 0.95), rgba(26, 26, 26, 0.98));
    padding: var(--space-16) var(--space-6);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.1), transparent 70%);
    pointer-events: none;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-4);
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-4);
    font-weight: 400;
    line-height: 1.4;
}

.hero-description {
    font-size: 1.125rem;
    /* color: var(--text-tertiary); */
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 主内容区域 */
/* .main-content {
    padding: var(--space-16) 0;
} */

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

.section-title {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: var(--space-4);
    color: var(--text-primary);
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: left;
    margin-bottom: var(--space-12);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* 对比表格容器 */
.comparison-table-container {
    overflow-x: auto;
    overflow-y: hidden; /* 禁止纵向滚动 */
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-primary);
    white-space: nowrap; /* 不换行 */
    margin-top: var(--space-16);
    margin-left: var(--space-8);
    margin-right: var(--space-8);
    margin-bottom: var(--space-8);
    background: var(--bg-secondary);
}

.comparison-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 1000px;
}

.comparison-table th,
.comparison-table td {
    padding: var(--space-4);
    text-align: center;
    border-right: 1px solid var(--border-primary);
    border-bottom: 1px solid var(--border-primary);
    width: 200px; /* 固定宽度 */
    min-width: 200px; /* 最小宽度 */
    max-width: 200px; /* 最大宽度 */
    min-height: 300px; /* 最小高度 */
    white-space: nowrap; /* 不换行 */
    overflow: hidden; /* 隐藏溢出 */
    text-overflow: ellipsis; /* 溢出显示省略号 */
    vertical-align: top; /* 内容顶部对齐 */
}

/* 移除最右列的右边框 */
.comparison-table th:last-child,
.comparison-table td:last-child {
    border-right: none;
}

/* 移除最底行的下边框 */
.comparison-table tr:last-child td {
    border-bottom: none;
}

.test-case {
    width: 13% !important; /* 测试用例列稍宽 */
    min-width: 320px !important;
}

.comparison-table th {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.875rem;
    /* text-transform: uppercase; */
    letter-spacing: 0.05em;
}

.comparison-table th:first-child {
    border-top-left-radius: var(--radius-xl);
}

.comparison-table th:last-child {
    border-top-right-radius: var(--radius-xl);
}

.comparison-table tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-xl);
}

.comparison-table tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-xl);
}

.comparison-table td {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
}

.test-case {
    min-width: 200px;
    text-align: left !important;
}

.original, .vendor {
    min-width: 180px;
}

/* 图片单元格样式 */
.image-cell {
    vertical-align: top;
}

.loading {
    opacity: 0.7;
}

.loaded {
    animation: fadeIn 0.5s ease-in;
}

.error {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error);
}

.loading-spinner {
    border: 2px solid var(--border-primary);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

.cell-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 270px; /* 适应表格单元格的最小高度 */
    padding: var(--space-4);
}

.status-text {
    margin-top: var(--space-2);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.error .status-text {
    color: var(--error);
}

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

/* @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
} */

.image-container {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease;
    min-height: 270px; /* 确保图片容器也有足够高度 */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.image-container:hover {
    transform: scale(1.02);
}

.comparison-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--radius-md);
    border: 2px solid var(--border-secondary);
}

.image-info {
    margin-top: var(--space-2);
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.2;
    position: relative;
}

.image-info[data-headers] {
    cursor: help;
}

.image-info .info-item {
    display: block;
    margin-bottom: var(--space-1);
}

.image-info[data-headers]:hover::after {
    content: attr(data-headers);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    white-space: pre-wrap;
    z-index: 1000;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    margin-bottom: 8px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.image-info[data-headers]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% - 6px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.95);
    z-index: 1001;
    pointer-events: none;
}

/* 确保tooltip在图片上方显示 */
.image-info[data-headers]:hover::after,
.image-info[data-headers]:hover::before {
    z-index: 1002;
}

.image-info div {
    margin-bottom: 2px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    /* backdrop-filter: blur(10px); */
}

.modal-content {
    display: block;
    margin: 2% auto;
    max-width: 95%;
    max-height: 80%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-6);
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.close:hover {
    color: var(--accent-primary);
}

#modal-caption {
    color: var(--text-primary);
    text-align: center;
    padding: var(--space-4);
    font-size: 1.125rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .nav-container {
        padding: var(--space-3);
    }
    
    .nav-links {
        gap: var(--space-4);
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: var(--space-3);
    }
    
    .comparison-image {
        /* max-height: 100px; */
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .nav-links {
        display: none;
    }
    
    .comparison-image {
        /* max-height: 80px; */
        width: auto;
        max-width: 100%;
        object-fit: contain;
    }
}

/* 工具类 */
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--accent-primary); }

.bg-success { background-color: var(--success); }
.bg-warning { background-color: var(--warning); }
.bg-error { background-color: var(--error); }

/* 动画效果 */
/* @keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
} */

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

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

.comparison-table-container::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.comparison-table-container::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-sm);
}

.comparison-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* Bitiful 推广区域样式 */
.bitiful-promo {
    margin-top: var(--space-16);
    padding: var(--space-16) var(--space-8);
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border-radius: var(--radius-xl);
    margin-left: var(--space-8);
    margin-right: var(--space-8);
    margin-bottom: var(--space-8);
}

.promo-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: var(--space-16);
    align-items: center;
}

.promo-content {
    color: #1f2937;
}

.promo-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--space-5);
    line-height: 1.2;
}

.promo-subtitle {
    font-size: 1.125rem;
    margin-bottom: var(--space-2);
    opacity: 0.8;
    font-weight: 500;
}

.promo-button {
    background: #1f2937;
    margin-top: var(--space-6);
    color: white;
    padding: var(--space-4) var(--space-8);
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    text-decoration: none;
}

.promo-button:hover {
    background: #111827;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.promo-dashboard {
    position: relative;
}

.dashboard-mockup {
    background: #1f2937;
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: perspective(1000px) rotateY(-5deg) rotateX(5deg);
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid #374151;
}

.dashboard-logo {
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
}

.dashboard-title {
    color: #9ca3af;
    font-size: 1rem;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-3);
    margin-bottom: var(--space-6);
}

.stat-card {
    background: #374151;
    padding: var(--space-4);
    border-radius: var(--radius-md);
}

.stat-label {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: var(--space-1);
}

.stat-value {
    color: white;
    font-size: 1.25rem;
    font-weight: 600;
}

.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: var(--space-6);
}

.chart-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.pie-chart {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
}

.pie {
    width: 80px;
    height: 80px;
}

.chart-legend {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: #9ca3af;
    font-size: 0.875rem;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.line-chart {
    background: #374151;
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.chart {
    width: 100%;
    height: 80px;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .promo-container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }
    
    .dashboard-mockup {
        transform: none;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .promo-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .bitiful-promo {
        margin-left: var(--space-4);
        margin-right: var(--space-4);
        padding: var(--space-8) var(--space-6);
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .dashboard-charts {
        grid-template-columns: 1fr;
    }
    
    .promo-title {
        font-size: 1.75rem;
    }
    
    .promo-subtitle {
        font-size: 1rem;
    }
}