/**
 * VK Consulting - 现代化样式增强
 * 暗黑模式、动画优化等
 */

/* ==================== 暗黑模式 ==================== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f5;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
}

.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2a2a2a;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #3a3a3a;
}

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

.dark-mode .navbar {
    background-color: #2a2a2a;
    border-bottom: 1px solid var(--border-color);
}

.dark-mode .card,
.dark-mode .service-card,
.dark-mode .case-card {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

.dark-mode .btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.dark-mode .btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* ==================== 动画优化 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 使用will-change优化动画性能 */
.animate-on-scroll {
    will-change: transform, opacity;
}

/* ==================== 骨架屏样式 ==================== */
.skeleton-loader {
    position: relative;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
    overflow: hidden;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.dark-mode .skeleton-loader {
    background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    background-size: 200% 100%;
}

/* ==================== 阅读进度条 ==================== */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), #ff6b6b);
    z-index: 10000;
    transition: width 0.1s ease;
    box-shadow: 0 2px 4px rgba(178, 34, 34, 0.3);
}

/* ==================== 返回顶部按钮 ==================== */
.back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(178, 34, 34, 0.4);
}

.back-to-top:active {
    transform: translateY(-1px);
}

/* ==================== 暗黑模式切换按钮 ==================== */
.dark-mode-toggle {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 999;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(178, 34, 34, 0.4);
}

/* ==================== 分享菜单 ==================== */
.share-menu {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
    min-width: 300px;
    max-width: 90%;
}

.dark-mode .share-menu {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

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

.share-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-primary);
}

.share-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.share-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.share-option {
    padding: 16px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.share-option:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(178, 34, 34, 0.3);
}

.share-icon {
    font-size: 24px;
}

/* ==================== 面包屑导航 ==================== */
.breadcrumb-nav {
    padding: 12px 20px;
    background: var(--bg-secondary);
    font-size: 14px;
    margin-top: 60px;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 60px;
    z-index: 100;
}

.breadcrumb-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-nav a:hover {
    color: var(--primary-color);
}

.breadcrumb-nav .separator {
    margin: 0 8px;
    color: var(--text-secondary);
}

.breadcrumb-nav .current {
    color: var(--text-primary);
    font-weight: 500;
}

.dark-mode .breadcrumb-nav {
    background: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

.dark-mode .breadcrumb-nav a {
    color: var(--text-secondary);
}

.dark-mode .breadcrumb-nav a:hover {
    color: var(--primary-color);
}

.dark-mode .breadcrumb-nav .current {
    color: var(--text-primary);
}

/* ==================== 通知样式 ==================== */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    animation: slideInRight 0.3s ease;
    max-width: 300px;
}

.notification-success {
    background: #4caf50;
    color: white;
}

.notification-warning {
    background: #ff9800;
    color: white;
}

.notification-info {
    background: #2196f3;
    color: white;
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
    .back-to-top,
    .dark-mode-toggle {
        width: 44px;
        height: 44px;
        font-size: 20px;
        bottom: 15px;
        right: 15px;
    }
    
    .dark-mode-toggle {
        bottom: 70px;
    }
    
    .share-menu {
        width: 90%;
        max-width: 300px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .navbar,
    .hamburger,
    .back-to-top,
    .dark-mode-toggle,
    .share-btn,
    .reading-progress,
    .breadcrumb-nav {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    .container {
        max-width: 100%;
        padding: 0;
    }
    
    .card,
    .service-card {
        page-break-inside: avoid;
    }
}

/* ==================== 性能优化 ==================== */
/* 使用contain优化渲染性能 */
.card,
.service-card,
.case-card {
    contain: layout style paint;
}

/* GPU加速动画 */
.animate-on-scroll,
.back-to-top,
.dark-mode-toggle {
    transform: translateZ(0);
    will-change: transform;
}

/* ==================== 可访问性增强 ==================== */
/* 焦点可见性 */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 减少动画（尊重用户偏好） */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

