/* 
 * 孟轩网 - 增强优化样式
 * 包含：响应式修复、美观提升、互动增强
 */

/* ============================================================
   响应式布局全面修复
   ============================================================ */

/* 防止水平溢出 */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

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

/* 容器优化 */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================================
   视觉美观度提升
   ============================================================ */

/* 平滑滚动增强 */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}

/* 动画减弱模式 - 尊重用户的无障碍偏好 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* 禁用Hero装饰元素动画 */
    .hero-rain,
    .hero-mouse-trail,
    .hero-beam,
    .hero-title-glow,
    .hero-parallax-layer,
    .hero-rings,
    .hero-particles,
    .hero-stars,
    .hero-glow {
        animation: none !important;
        opacity: 0.3 !important;
    }
    
    /* 禁用骨架屏动画 */
    .skeleton {
        animation: none !important;
        opacity: 0.6;
    }
    
    /* 禁用滚动动画 */
    .icp-scroll-track {
        animation: none !important;
    }
    
    /* 禁用卡片悬浮效果 */
    .service-card:hover,
    .friend-card:hover,
    .highlight-card:hover {
        transform: none !important;
    }
}


/* 卡片悬浮效果增强 */
.service-card,
.friend-card,
.highlight-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.service-card:hover,
.friend-card:hover,
.highlight-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2);
}

/* 按钮增强效果 */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:active {
    transform: scale(0.95);
}

/* 渐变文字增强 */
.gradient-text {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* ============================================================
   社交分享按钮组
   ============================================================ */

.social-share {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
}

.social-share-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    text-decoration: none;
}

.social-share-btn:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-lg);
}

.social-share-btn.weixin { color: #07c160; }
.social-share-btn.weixin:hover { background: #07c160; color: white; }

.social-share-btn.weibo { color: #e6162d; }
.social-share-btn.weibo:hover { background: #e6162d; color: white; }

.social-share-btn.qq { color: #12b7f5; }
.social-share-btn.qq:hover { background: #12b7f5; color: white; }

.social-share-btn.link { color: var(--primary); }
.social-share-btn.link:hover { background: var(--primary); color: white; }

/* 移动端隐藏社交分享 */
@media (max-width: 768px) {
    .social-share {
        display: none;
    }
}

/* ============================================================
   浮动通知提示
   ============================================================ */

.toast-notification {
    position: fixed;
    top: 80px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-xl);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    transform: translateX(450px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.show {
    transform: translateX(0);
}

.toast-icon {
    font-size: 24px;
    line-height: 1;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.toast-message {
    font-size: 14px;
    color: var(--text-secondary);
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.toast-close:hover {
    color: var(--text);
}

/* ============================================================
   互动引导元素
   ============================================================ */

/* 脉冲提示点 */
.pulse-hint {
    position: relative;
    display: inline-block;
}

.pulse-hint::after {
    content: '';
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulseHint 2s ease-in-out infinite;
}

@keyframes pulseHint {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.5;
    }
}

/* 引导箭头 */
.guide-arrow {
    position: relative;
    display: inline-block;
    animation: guideArrowBounce 1.5s ease-in-out infinite;
}

@keyframes guideArrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* ============================================================
   加载骨架屏
   ============================================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card) 0%,
        var(--bg-secondary) 50%,
        var(--bg-card) 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

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

.skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
}

.skeleton-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

/* 骨架屏卡片样式 */
.skeleton-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.skeleton-header {
    height: 120px;
    width: 100%;
    margin-bottom: 0;
}

.skeleton-body {
    padding: 20px;
}

.skeleton-friend-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.skeleton-friend-info {
    flex: 1;
}

.skeleton-friend-card .skeleton-avatar {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.skeleton-friend-card .skeleton-title {
    width: 50%;
    height: 20px;
    margin-bottom: 8px;
}

.skeleton-friend-card .skeleton-text {
    width: 80%;
    height: 14px;
}


/* ============================================================
   性能优化 - 图片懒加载占位
   ============================================================ */

.lazy-image {
    position: relative;
    overflow: hidden;
    background: var(--bg-secondary);
}

.lazy-image::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.lazy-image img {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.lazy-image img.loaded {
    opacity: 1;
}

/* ============================================================
   滚动进度指示器增强
   ============================================================ */

.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
    z-index: 10000;
    transform-origin: left;
    transition: transform 0.1s ease;
}

/* ============================================================
   SEO优化 - 结构化数据友好
   ============================================================ */

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumb-item a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

.breadcrumb-separator {
    color: var(--text-light);
}

/* ============================================================
   移动端优化增强
   ============================================================ */

@media (max-width: 768px) {
    /* 容器内边距优化 */
    .container {
        padding: 0 16px;
    }
    
    /* 字体大小适配 */
    body {
        font-size: 15px;
    }
    
    /* 按钮优化 */
    .btn {
        min-height: 44px;
        padding: 12px 24px;
    }
    
    /* 触摸目标大小 */
    a, button, .clickable {
        min-width: 44px;
        min-height: 44px;
    }
    
    /* 通知提示移动端适配 */
    .toast-notification {
        left: 10px;
        right: 10px;
        min-width: auto;
        transform: translateY(-100px);
    }
    
    .toast-notification.show {
        transform: translateY(0);
    }
}

/* ============================================================
   无障碍增强
   ============================================================ */

/* 焦点可见性 */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* 跳转到主内容 */
.skip-to-content {
    position: absolute;
    top: -100px;
    left: 0;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    z-index: 10001;
    text-decoration: none;
    border-radius: 0 0 var(--radius) 0;
    transition: top 0.3s;
}

.skip-to-content:focus {
    top: 0;
}

/* 屏幕阅读器专用 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================================
   深色模式优化
   ============================================================ */

[data-theme="dark"] .social-share-btn {
    background: var(--bg-secondary);
    border-color: var(--border);
}

[data-theme="dark"] .toast-notification {
    background: var(--bg-secondary);
}

/* ============================================================
   动画性能优化
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* GPU加速 */
.service-card,
.friend-card,
.highlight-card,
.btn {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* ============================================================
   ICP备案滚动展示
   ============================================================ */

/* 主内容区ICP展示区样式 */
.icp-showcase-section .icp-scroll-container {
    padding: 24px 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.icp-showcase-section .icp-scroll-track {
    gap: 32px;
}

.icp-showcase-section .icp-scroll-track img {
    height: 28px;
}

.icp-showcase-section .icp-scroll-track a {
    font-size: 15px;
}

.icp-scroll-container {
    width: 100%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius);
    padding: 12px 0;
    margin-bottom: 20px;
    position: relative;
}

.icp-scroll-container::before,
.icp-scroll-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    z-index: 2;
    pointer-events: none;
}

.icp-scroll-container::before {
    left: 0;
    background: linear-gradient(90deg, var(--bg-secondary) 0%, transparent 100%);
}

.icp-scroll-container::after {
    right: 0;
    background: linear-gradient(270deg, var(--bg-secondary) 0%, transparent 100%);
}

.icp-scroll-track {
    display: flex;
    align-items: center;
    gap: 20px;
    animation: scrollICP 8s linear infinite;
    white-space: nowrap;
}

.icp-scroll-track:hover {
    animation-play-state: paused;
}

.icp-scroll-track a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.icp-scroll-track a:hover {
    transform: translateY(-2px) scale(1.05);
}

.icp-scroll-track img {
    transition: transform 0.3s ease;
}

.icp-scroll-track a:hover img {
    transform: scale(1.1);
}

@keyframes scrollICP {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* 页脚徽章容器 */
.footer-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .icp-scroll-container {
        padding: 8px 0;
    }
    
    .icp-scroll-track {
        gap: 16px;
    }
    
    .icp-showcase-section .icp-scroll-container {
        padding: 16px 0;
    }
    
    .icp-showcase-section .icp-scroll-track {
        gap: 20px;
    }
    
    .icp-showcase-section .icp-scroll-track img {
        height: 22px;
    }
    
    .footer-badges {
        gap: 12px;
    }
}
