/* 性能极致优化版样式 */

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #1F2937;
    background: #F9FAFB;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 图片优化 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 导航栏 */
.perf-nav {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #1F2937;
    font-weight: 600;
}

.logo-text {
    font-size: 0.9rem;
    color: #6B7280;
    background: #F3F4F6;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
}

.nav-actions {
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #6B7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background: #F3F4F6;
    color: #1F2937;
}

.nav-btn.user-btn {
    padding: 0;
    overflow: hidden;
}

.nav-btn.user-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #EF4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 搜索覆盖层 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    z-index: 2000;
}

.search-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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

.search-box {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    position: relative;
}

.search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #E5E7EB;
    border-radius: 12px;
    font-size: 1rem;
    color: #1F2937;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.search-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: transparent;
    border: none;
    color: #6B7280;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-close:hover {
    background: #F3F4F6;
    color: #1F2937;
}

/* 主内容 */
.perf-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 欢迎区域 */
.welcome-section {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: #6B7280;
    margin-bottom: 2rem;
}

.performance-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.perf-stat {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #F9FAFB;
    border-radius: 12px;
    min-width: 180px;
}

.perf-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.perf-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.perf-label {
    font-size: 0.9rem;
    color: #6B7280;
}

.perf-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
}

/* 功能区域 */
.features-section {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 1.5rem;
    text-align: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    border-color: #4F46E5;
}

.feature-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    flex-shrink: 0;
}

.feature-icon.wecom {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
}

.feature-icon.hr {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: white;
}

.feature-icon.analytics {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    color: white;
}

.feature-icon.monitor {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    color: white;
}

.feature-content {
    flex: 1;
}

.feature-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 0.5rem;
}

.feature-content p {
    color: #6B7280;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.feature-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #F3F4F6;
    color: #6B7280;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 12px;
}

/* 性能对比 */
.comparison-section {
    margin-bottom: 3rem;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.comparison-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 1.5rem;
}

.comparison-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 1.5rem;
}

.comparison-bar {
    margin-bottom: 1rem;
}

.bar-label {
    font-size: 0.9rem;
    color: #6B7280;
    margin-bottom: 0.5rem;
}

.bar-container {
    height: 24px;
    background: #F3F4F6;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 0.75rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    min-width: 60px;
    transition: width 1s ease;
}

.bar-fill.before {
    background: linear-gradient(90deg, #EF4444 0%, #F87171 100%);
}

.bar-fill.after {
    background: linear-gradient(90deg, #10B981 0%, #34D399 100%);
}

.improvement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10B981;
    font-weight: 600;
    margin-top: 1rem;
}

.improvement i {
    font-size: 0.9rem;
}

/* 技术实现 */
.tech-section {
    margin-bottom: 3rem;
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.tech-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.tech-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.tech-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 1rem;
}

.tech-card ul {
    list-style: none;
    text-align: left;
}

.tech-card li {
    padding: 0.5rem 0;
    color: #6B7280;
    border-bottom: 1px solid #F3F4F6;
}

.tech-card li:last-child {
    border-bottom: none;
}

/* 实时监控 */
.monitor-section {
    margin-bottom: 3rem;
}

.monitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.monitor-card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.monitor-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 1rem;
}

.monitor-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 1rem;
}

.monitor-chart {
    height: 40px;
    background: #10B981;
    border-radius: 8px;
    margin: 0 auto;
    width: 80%;
    transition: height 0.5s ease, background-color 0.5s ease;
}

/* 页脚 */
.perf-footer {
    background: white;
    border-top: 1px solid #E5E7EB;
    padding: 2rem 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo span {
    color: #6B7280;
    font-size: 0.9rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #4F46E5;
}

.footer-copyright {
    color: #9CA3AF;
    font-size: 0.9rem;
}

/* 性能监控面板 */
.perf-panel {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
}

.perf-panel.expanded {
    width: 200px;
}

.panel-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: #4F46E5;
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.panel-toggle:hover {
    background: #7C3AED;
    transform: scale(1.1);
}

.panel-content {
    padding: 1rem;
    display: none;
}

.perf-panel.expanded .panel-content {
    display: block;
}

.panel-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 0.75rem;
    text-align: center;
}

.panel-stats {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.panel-stat {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.panel-stat span:first-child {
    color: #6B7280;
}

.panel-stat span:last-child {
    font-weight: 600;
    color: #1F2937;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .welcome-title {
        font-size: 1.5rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
    
    .performance-stats {
        gap: 1rem;
    }
    
    .perf-stat {
        min-width: 140px;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .monitor-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .nav-logo .logo-text {
        display: none;
    }
    
    .perf-stat {
        min-width: 100%;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
    }
    
    .monitor-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .perf-panel.expanded {
        width: 180px;
    }
}

/* 打印样式 */
@media print {
    .perf-nav,
    .perf-footer,
    .perf-panel {
        display: none;
    }
    
    .perf-main {
        padding: 0;
    }
    
    .feature-card,
    .comparison-card,
    .tech-card,
    .monitor-card {
        break-inside: avoid;
        border: 1px solid #E5E7EB;
    }
}

/* 减少动画用户偏好 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .feature-card,
    .comparison-card,
    .tech-card,
    .monitor-card {
        border: 2px solid currentColor;
    }
    
    .nav-btn:hover,
    .search-close:hover {
        outline: 2px solid currentColor;
    }
}