/* 自定义CSS样式 */

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 选中文本样式 */
::selection {
    background-color: rgba(124, 58, 237, 0.2);
    color: #581c87;
}

/* 焦点状态优化 */
*:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

input:focus,
textarea:focus,
button:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* 渐显动画增强 */
.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 卡片悬浮效果 */
.card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
}

.card-hover:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* 按钮悬浮效果 */
.btn-hover {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-hover:hover::before {
    left: 100%;
}

/* 渐变背景 */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 技能进度条动画 */
.skill-item .bg-blue-600,
.skill-item .bg-green-600,
.skill-item .bg-purple-600 {
    transition: width 1s ease-in-out;
}

/* 文本限制行数 */
.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 响应式字体大小 */
@media (max-width: 640px) {
    .text-hero {
        font-size: 2.5rem;
        line-height: 1.1;
    }
}

@media (min-width: 641px) {
    .text-hero {
        font-size: 3.5rem;
        line-height: 1.1;
    }
}

@media (min-width: 1024px) {
    .text-hero {
        font-size: 4rem;
        line-height: 1.1;
    }
}

/* 导航栏背景模糊效果 */
.backdrop-blur-md {
    backdrop-filter: blur(12px);
}

/* 表单输入框增强效果 */
.form-input {
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.form-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input:hover {
    border-color: #e5e7eb;
}

/* 项目卡片特殊效果 */
.project-card {
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(59, 130, 246, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.project-card:hover::before {
    opacity: 1;
}

/* 加载状态 */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 图标动画 */
.icon-hover {
    transition: transform 0.3s ease;
}

.icon-hover:hover {
    transform: scale(1.1) rotate(5deg);
}

/* 统计数字计数动画 */
.count-up {
    animation: countUp 2s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 时间线样式 */
.timeline-item {
    position: relative;
    padding-left: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 0.75rem;
    height: 0.75rem;
    background-color: #3b82f6;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #3b82f6;
}

.timeline-item::after {
    content: '';
    position: absolute;
    left: 0.375rem;
    top: 1.25rem;
    width: 1px;
    height: calc(100% - 1rem);
    background-color: #e5e7eb;
}

.timeline-item:last-child::after {
    display: none;
}

/* 打字机效果 */
.typewriter {
    overflow: hidden;
    border-right: 2px solid #3b82f6;
    white-space: nowrap;
    animation: typewriter 3s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from,
    to {
        border-color: transparent;
    }
    50% {
        border-color: #3b82f6;
    }
}

/* 粘性导航栏 */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 50;
}

/* 视差滚动效果 */
.parallax {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* 响应式隐藏 */
@media (max-width: 768px) {
    .hidden-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hidden-desktop {
        display: none !important;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        background-color: #1f2937;
        color: #f9fafb;
    }
}

/* 打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
}

/* 辅助功能优化 */
@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;
    }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
    .card-hover {
        border: 2px solid #000;
    }
    
    .text-gray-600 {
        color: #000 !important;
    }
}

/* 移动端优化 */
@media (max-width: 640px) {
    .container-mobile {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .text-mobile-sm {
        font-size: 0.875rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .card-hover:hover {
        transform: none;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .btn-hover:hover {
        transform: none;
    }
}

/* 自定义工具类 */
.text-balance {
    text-wrap: balance;
}

.scroll-smooth {
    scroll-behavior: smooth;
}

.overflow-wrap-anywhere {
    overflow-wrap: anywhere;
}

/* 性能优化 */
.will-change-transform {
    will-change: transform;
}

.will-change-opacity {
    will-change: opacity;
}

/* GPU 加速 */
.gpu-accelerated {
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* 项目选项卡样式 */
.project-tab {
    position: relative;
    overflow: hidden;
}

.project-tab:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.project-tab:hover:before {
    left: 100%;
}

/* 修复激活状态的选项卡在hover时文字颜色的问题 */
.project-tab.bg-primary-600.text-white:hover {
    color: white !important;
}

/* 确保激活状态的样式优先级最高 */
.project-tab.bg-primary-600 {
    background-color: #2563eb !important;
    color: white !important;
}

/* 更具体的修复规则 - 覆盖Tailwind的hover样式 */
.project-tab.bg-primary-600:hover {
    color: white !important;
    background-color: #1d4ed8 !important;
}

/* 确保普通状态的hover仍然工作 */
.project-tab:not(.bg-primary-600):hover {
    color: #111827;
}

/* 项目区域切换动画 */
.project-section {
    transition: all 0.3s ease-in-out;
}

.project-section.hidden {
    opacity: 0;
    transform: translateY(10px);
    max-height: 0;
    overflow: hidden;
}

.project-section:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    max-height: none;
}

/* 公司项目特殊标识 */
.company-tag {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 委托开发项目特殊标识 */
.contract-tag {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 项目指标卡片 */
.metric-card {
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
}

.metric-card:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    transform: scale(1.02);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .project-thumbnail-frame {
        width: 76px;  /* 60px内容区 + 16px内边距 */
        height: 76px;
        padding: 8px;
    }
    
    .project-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .project-thumbnail-wide {
        max-width: 60px;
        max-height: 60px;
    }
    
    .project-overlay-title {
        font-size: 1rem;
    }
    
    .project-content-area {
        padding: 1rem;
    }
}

/* 性能优化 */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.card-hover,
.project-tab,
.metric-card {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000px;
    perspective: 1000px;
}

/* 无障碍访问优化 */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 焦点状态 */
.project-tab:focus,
button:focus,
a:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* 项目卡片图片增强效果 */
.card-hover .project-image {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.card-hover:hover .project-image {
    transform: scale(1.05);
}

/* 图片加载效果 */
.project-image-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #f8fafc, #e2e8f0);
}

.project-image-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.project-image-container:hover::before {
    transform: translateX(100%);
}

/* 项目类型标签增强 */
.project-type-badge {
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 图片错误处理样式 */
.image-fallback {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 2rem;
}

/* 图片模糊加载效果 */
.blur-load {
    background-size: cover;
    background-position: center;
}

.blur-load.loaded > img {
    opacity: 1;
}

.blur-load::before {
    content: '';
    position: absolute;
    inset: 0;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: 5px;
}

.blur-load.loaded::before {
    display: none;
}

/* 高性能动画 */
@media (prefers-reduced-motion: reduce) {
    .card-hover,
    .project-image,
    .project-image-container::before {
        transition: none !important;
    }
    
    .card-hover:hover {
        transform: none !important;
    }
}

/* Hero区域头像增强效果 */
.hero-avatar-container {
    position: relative;
    transition: all 0.3s ease;
}

.hero-avatar-container:hover {
    transform: translateY(-5px);
}

/* 背景装饰动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-10px) rotate(180deg);
    }
}

.floating-decoration {
    animation: float 6s ease-in-out infinite;
}

/* 头像图片加载效果 */
.hero-image {
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hero-image:hover {
    transform: scale(1.05) rotate(2deg);
}

/* 光效动画 */
@keyframes shimmer {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }
    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

.shimmer-effect {
    animation: shimmer 3s ease-in-out infinite;
}

/* 装饰元素动画 */
.decoration-dot {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.decoration-dot:nth-child(2) {
    animation-delay: 0.5s;
}

/* 响应式优化 */
@media (max-width: 1024px) {
    .hero-avatar-container {
        width: 280px !important;
        height: 280px !important;
    }
}

@media (max-width: 640px) {
    .hero-avatar-container {
        width: 240px !important;
        height: 240px !important;
    }
}

/* 减少动画（无障碍） */
@media (prefers-reduced-motion: reduce) {
    .hero-image,
    .floating-decoration,
    .shimmer-effect,
    .decoration-dot {
        animation: none !important;
        transition: none !important;
    }
}

/* 项目卡片双层图片设计 */
.project-image-dual-layer {
    position: relative;
    height: 192px; /* h-48 */
    overflow: hidden;
}

/* 底层模糊背景 */
.project-bg-blur {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.project-bg-blur img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px) brightness(0.7) saturate(1.2);
    transform: scale(1.1);
    opacity: 0.8;
    transition: all 0.5s ease;
}

/* 顶层小图容器 */
.project-thumbnail-container {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

/* 统一所有项目的缩略图容器尺寸 */
.project-thumbnail-frame {
    position: relative;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    /* 统一容器尺寸 - 1:1比例 */
    width: 104px;  /* 80px内容区 + 24px内边距 */
    height: 104px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-thumbnail-frame:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.2);
}

/* 标准项目的缩略图 */
.project-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.project-thumbnail:hover {
    transform: scale(1.1);
}

/* 项目信息覆盖层 */
.project-overlay-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1rem;
    color: white;
}

.project-overlay-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.project-overlay-category {
    font-size: 0.875rem;
    opacity: 0.9;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* 类型标签样式增强 */
.project-type-badge-enhanced {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 卡片内容区域优化 */
.project-content-area {
    padding: 1.5rem;
    background: white;
}

.project-status-badge {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    color: #0369a1;
    border: 1px solid #7dd3fc;
}

.project-view-hint {
    color: #6b7280;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.card-hover:hover .project-view-hint {
    opacity: 1;
    color: #3b82f6;
}

/* 高对比度模式优化 */
@media (prefers-contrast: high) {
    .project-thumbnail-frame {
        background: rgba(255, 255, 255, 0.9);
        border: 2px solid #000;
    }
    
    .project-overlay-info {
        background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    }
}

/* 性能优化 */
.project-image-dual-layer,
.project-thumbnail-frame,
.project-thumbnail {
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* 极果网项目特殊样式 - 按长边缩放 */
.project-thumbnail-wide {
    max-width: 80px;  /* 容器内容区最大宽度 */
    max-height: 80px; /* 容器内容区最大高度 */
    width: auto;
    height: auto;
    object-fit: contain; /* 按长边缩放，保持比例，不裁剪 */
    border-radius: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 宽图片的hover效果 */
.project-thumbnail-wide:hover {
    transform: scale(1.1);
}

/* 移动端优化样式 */
@media (max-width: 768px) {
    /* 触摸友好的按钮尺寸 */
    .mobile-touch-friendly {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* 移动端导航优化 */
    .mobile-nav-enhanced {
        padding: 16px 0;
    }
    
    .mobile-nav-link {
        padding: 12px 16px !important;
        font-size: 16px;
        border-radius: 8px;
        margin: 4px 0;
    }
    
    /* Hero区域移动端优化 */
    .hero-mobile-spacing {
        padding-top: 100px;
        padding-bottom: 60px;
    }
    
    .hero-title-mobile {
        font-size: 2.5rem !important;
        line-height: 1.1;
        margin-bottom: 16px;
    }
    
    .hero-subtitle-mobile {
        font-size: 1.25rem !important;
        margin-bottom: 20px;
    }
    
    .hero-description-mobile {
        font-size: 16px;
        line-height: 1.6;
        margin-bottom: 32px;
    }
    
    /* 移动端按钮组优化 */
    .mobile-button-group {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }
    
    .mobile-button-group a {
        width: 100%;
        text-align: center;
        padding: 14px 24px;
        font-size: 16px;
    }
    
    /* 移动端统计数据优化 */
    .mobile-stats-grid {
        gap: 16px;
        margin-top: 32px;
        padding-top: 24px;
    }
    
    .mobile-stat-item {
        text-align: center;
    }
    
    .mobile-stat-number {
        font-size: 1.75rem !important;
        font-weight: 700;
        margin-bottom: 4px;
    }
    
    .mobile-stat-label {
        font-size: 12px;
        color: #6b7280;
    }
    
    /* 移动端头像优化 */
    .hero-avatar-mobile {
        width: 240px !important;
        height: 240px !important;
        margin: 0 auto 32px auto !important;
        display: block !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        max-width: calc(100vw - 32px) !important;
    }
    
    /* 图片容器内部元素居中 */
    .hero-avatar-mobile .relative {
        width: 100% !important;
        height: 240px !important;
        margin: 0 auto !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
    }
    
    /* 背景装饰元素居中 */
    .hero-avatar-mobile .absolute {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    /* 确保装饰圆点也居中 */
    .hero-avatar-mobile .absolute.-top-2.-right-2 {
        right: -8px !important;
        left: auto !important;
        transform: none !important;
    }
    
    .hero-avatar-mobile .absolute.-bottom-4.-left-4 {
        left: -16px !important;
        right: auto !important;
        transform: none !important;
    }
    
    /* 确保移动端Hero图片容器居中 */
    @media (max-width: 1023px) {
        .hero-avatar-mobile {
            margin-left: auto !important;
            margin-right: auto !important;
            left: 0 !important;
            transform: none !important;
        }
    }
    
    /* 移动端成就卡片优化 */
    .achievement-card-mobile {
        padding: 20px;
        margin-bottom: 16px;
    }
    
    .achievement-icon-mobile {
        width: 48px !important;
        height: 48px !important;
        margin-bottom: 16px;
    }
    
    .achievement-title-mobile {
        font-size: 1.5rem !important;
        margin-bottom: 8px;
    }
    
    .achievement-desc-mobile {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    /* 移动端项目选项卡优化 */
    .project-tabs-mobile {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .project-tab-mobile {
        width: 100%;
        padding: 12px 16px;
        text-align: center;
        font-size: 16px;
        border-radius: 8px;
    }
    
    /* 移动端项目卡片优化 */
    .project-card-mobile {
        margin-bottom: 20px;
    }
    
    .project-image-mobile {
        height: 180px;
    }
    
    .project-content-mobile {
        padding: 20px;
    }
    
    .project-title-mobile {
        font-size: 1.125rem;
        font-weight: 600;
        margin-bottom: 8px;
    }
    
    .project-description-mobile {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 16px;
    }
    
    /* 移动端指标网格优化 */
    .metrics-grid-mobile {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 16px;
    }
    
    .metric-item-mobile {
        padding: 8px;
        text-align: center;
        background: #f8fafc;
        border-radius: 6px;
    }
    
    .metric-value-mobile {
        font-size: 14px;
        font-weight: 600;
        color: #3b82f6;
    }
    
    .metric-label-mobile {
        font-size: 10px;
        color: #6b7280;
        margin-top: 2px;
    }
    
    /* 移动端技能部分优化 */
    .skills-section-mobile {
        padding: 48px 0;
    }
    
    .skill-card-mobile {
        padding: 24px;
        margin-bottom: 20px;
    }
    
    .skill-title-mobile {
        font-size: 1.125rem;
        margin-bottom: 20px;
    }
    
    /* 移动端关于我部分优化 */
    .about-content-mobile {
        text-align: left;
    }
    
    .about-title-mobile {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    
    .about-text-mobile {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 16px;
    }
    
    .about-info-grid-mobile {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 24px;
    }
    
    .about-info-item-mobile {
        display: flex;
        align-items: center;
        padding: 8px 0;
        font-size: 14px;
    }
    
    /* 移动端联系部分优化 */
    .contact-cards-mobile {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .contact-card-mobile {
        padding: 24px;
        text-align: center;
    }
    
    .contact-icon-mobile {
        width: 48px !important;
        height: 48px !important;
        margin: 0 auto 16px auto;
    }
    
    .contact-title-mobile {
        font-size: 1.125rem;
        margin-bottom: 8px;
    }
    
    /* 移动端CTA区域优化 */
    .cta-mobile {
        padding: 32px 20px;
        text-align: center;
        border-radius: 12px;
    }
    
    .cta-title-mobile {
        font-size: 1.5rem;
        margin-bottom: 16px;
    }
    
    .cta-description-mobile {
        font-size: 16px;
        margin-bottom: 24px;
        line-height: 1.5;
    }
    
    .cta-buttons-mobile {
        flex-direction: column;
        gap: 12px;
    }
    
    .cta-button-mobile {
        width: 100%;
        padding: 14px 24px;
        font-size: 16px;
        border-radius: 8px;
    }
    
    /* 移动端Footer优化 */
    .footer-mobile {
        padding: 40px 0 32px 0;
    }
    
    .footer-grid-mobile {
        grid-template-columns: 1fr;
        gap: 24px;
        text-align: left;
    }
    
    .footer-section-mobile {
        margin-bottom: 0;
    }
    
    .footer-title-mobile {
        font-size: 1.125rem;
        margin-bottom: 12px;
        font-weight: 600;
    }
    
    .footer-links-mobile {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .footer-social-mobile {
        justify-content: flex-start;
        gap: 12px;
        margin-top: 12px;
    }
    
    /* 移动端footer个人信息区域优化 */
    .footer-section-mobile:first-child {
        padding-bottom: 20px;
        border-bottom: 1px solid #374151;
        margin-bottom: 20px;
    }
    
    .footer-section-mobile:first-child .flex {
        margin-bottom: 12px;
    }
    
    .footer-section-mobile:first-child p {
        margin-bottom: 16px;
        line-height: 1.5;
    }
    
    .footer-section-mobile:first-child .space-y-2 > div {
        margin-bottom: 8px;
    }
    
    /* 移动端footer导航链接优化 */
    .footer-links-mobile a {
        padding: 6px 0;
        display: block;
        font-size: 14px;
    }
    
    /* 移动端footer社交链接优化 */
    .footer-social-mobile a {
        width: 40px;
        height: 40px;
    }
    
    /* 移动端footer底部版权区域 */
    .footer-mobile .border-t {
        margin-top: 24px;
        padding-top: 20px;
    }
    
    .footer-mobile .border-t p {
        text-align: center;
        font-size: 12px;
        color: #9ca3af;
    }
    
    /* 移动端滚动优化 */
    .mobile-scroll-padding {
        scroll-padding-top: 80px;
    }
    
    /* 移动端文本选择优化 */
    .mobile-text-select {
        -webkit-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
    
    /* 移动端输入框优化 */
    .mobile-input-zoom-fix {
        font-size: 16px !important;
    }
    
    /* 移动端卡片间距优化 */
    .mobile-card-spacing {
        margin-bottom: 20px;
    }
    
    /* 移动端段落间距优化 */
    .mobile-paragraph-spacing {
        margin-bottom: 16px;
    }
    
    /* 移动端列表优化 */
    .mobile-list-spacing li {
        margin-bottom: 8px;
        padding: 4px 0;
    }
    
    /* 移动端图片优化 */
    .mobile-image-responsive {
        width: 100%;
        height: auto;
        border-radius: 8px;
    }
    
    /* 移动端表格优化 */
    .mobile-table-scroll {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* 移动端模态框优化 */
    .mobile-modal {
        margin: 16px;
        max-height: calc(100vh - 32px);
        overflow-y: auto;
    }
}

/* 移动端安全区域适配 */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .hero-mobile-spacing {
            padding-top: max(100px, env(safe-area-inset-top) + 80px);
        }
        
        .footer-mobile {
            padding-bottom: max(32px, env(safe-area-inset-bottom) + 16px);
        }
        
        .fixed.bottom-6.right-6 {
            bottom: max(20px, env(safe-area-inset-bottom) + 20px);
            right: max(20px, env(safe-area-inset-right) + 20px);
        }
    }
}

/* 移动端Hero头像优化 - 统一样式定义 */
@media (max-width: 768px) {
    /* 防止hero区域产生横向滚动 */
    .hero-mobile-spacing {
        overflow-x: hidden;
    }
    
    /* Hero区域整体布局优化 */
    .hero-mobile-spacing .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    /* Hero图片容器的父级flex容器 */
    .hero-mobile-spacing .flex.justify-center {
        width: 100%;
        justify-content: center !important;
        align-items: center;
        padding: 0 1rem;
    }
    
    /* Hero图片容器完全居中，防止偏移 */
    .hero-avatar-mobile {
        width: 240px !important;
        height: 240px !important;
        margin: 0 auto 32px auto !important;
        display: block !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        max-width: calc(100vw - 64px) !important;
    }
    
    /* 内部图片容器 */
    .hero-avatar-mobile > .relative {
        width: 100% !important;
        height: 240px !important;
        margin: 0 !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
    }
    
    /* 背景装饰元素居中 */
    .hero-avatar-mobile .absolute:not(.-top-2):not(.-bottom-4) {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    /* 装饰圆点位置调整 */
    .hero-avatar-mobile .absolute.-top-2.-right-2 {
        right: -8px !important;
        left: auto !important;
        transform: none !important;
    }
    
    .hero-avatar-mobile .absolute.-bottom-4.-left-4 {
        left: -16px !important;
        right: auto !important;
        transform: none !important;
    }
}

/* 超小屏幕优化 (iPhone SE等) */
@media (max-width: 375px) {
    .hero-title-mobile {
        font-size: 2rem !important;
    }
    
    .hero-subtitle-mobile {
        font-size: 1.125rem !important;
    }
    
    .hero-avatar-mobile {
        width: 200px !important;
        height: 200px !important;
        margin: 0 auto 32px auto !important;
        display: block !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
        max-width: calc(100vw - 32px) !important;
    }
    
    .hero-avatar-mobile .relative {
        width: 100% !important;
        height: 200px !important;
    }
    
    .mobile-button-group a {
        padding: 12px 20px;
        font-size: 15px;
    }
    
    .achievement-card-mobile {
        padding: 16px;
    }
    
    .project-content-mobile {
        padding: 16px;
    }
    
    .contact-card-mobile {
        padding: 20px;
    }
    
    .cta-mobile {
        padding: 24px 16px;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 移除hover效果，使用active状态 */
    .card-hover:hover {
        transform: none;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    }
    
    .card-hover:active {
        transform: translateY(-2px);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    }
    
    /* 按钮触摸反馈 */
    .mobile-touch-feedback:active {
        transform: scale(0.98);
        opacity: 0.8;
    }
    
    /* 链接触摸区域优化 */
    .mobile-touch-target {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* 移动端卡片激活状态 */
.mobile-card-active {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.15) !important;
}

/* 减少动画模式 */
.reduce-motion *,
.reduce-motion *::before,
.reduce-motion *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* 移动端设备标识 */
.mobile-device .card-hover:hover {
    transform: none;
}

.mobile-device .card-hover:active {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 移动端滚动到顶部按钮优化 */
@media (max-width: 768px) {
    .fixed.bottom-6.right-6 {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
}

/* 移动端文本选择优化 */
@media (max-width: 768px) {
    .mobile-text-select {
        -webkit-touch-callout: default;
        -webkit-user-select: text;
        -khtml-user-select: text;
        -moz-user-select: text;
        -ms-user-select: text;
        user-select: text;
    }
}

/* 移动端Hero区域完全居中修复 - 最终版本 */
@media (max-width: 768px) {
    /* 确保整个hero区域不会产生横向滚动 */
    body {
        overflow-x: hidden;
    }
    
    /* Hero区域容器优化 */
    #home {
        overflow-x: hidden;
    }
    
    /* Hero区域网格布局在移动端改为单列 */
    #home .grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
        text-align: center;
    }
    
    /* Hero图片区域的flex容器 */
    #home .flex.justify-center {
        width: 100% !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 !important;
        padding: 0 1rem !important;
    }
    
    /* Hero头像容器 - 完全居中 */
    .hero-avatar-mobile {
        width: 240px !important;
        height: 240px !important;
        margin: 0 auto !important;
        display: block !important;
        position: relative !important;
        left: 0 !important;
        right: 0 !important;
        transform: none !important;
        max-width: calc(100vw - 64px) !important;
    }
    
    /* 内部图片容器 */
    .hero-avatar-mobile > .relative {
        width: 100% !important;
        height: 240px !important;
        margin: 0 !important;
        position: relative !important;
        left: 0 !important;
        transform: none !important;
    }
    
    /* 背景装饰元素居中 */
    .hero-avatar-mobile .absolute:not(.-top-2):not(.-bottom-4) {
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    /* 装饰圆点位置调整 */
    .hero-avatar-mobile .absolute.-top-2.-right-2 {
        right: -8px !important;
        left: auto !important;
        transform: none !important;
    }
    
    .hero-avatar-mobile .absolute.-bottom-4.-left-4 {
        left: -16px !important;
        right: auto !important;
        transform: none !important;
    }
}

/* 超小屏幕额外优化 */
@media (max-width: 375px) {
    .hero-avatar-mobile {
        width: 200px !important;
        height: 200px !important;
        max-width: calc(100vw - 48px) !important;
    }
    
    .hero-avatar-mobile > .relative {
        height: 200px !important;
    }
}

/* 项目详情弹窗样式 */
#projectModal {
    animation: fadeIn 0.3s ease-out;
}

#projectModal.hidden {
    animation: fadeOut 0.3s ease-out;
}

#projectModal > div {
    animation: slideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

/* 固定标题栏样式 */
#projectModal .modal-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1.5rem;
    flex-shrink: 0;
}

/* 可滚动内容区域 */
#projectModal .modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
    /* 为底部固定按钮留出空间 */
    padding-bottom: 5rem;
}

/* 固定底部按钮区域 */
#projectModal .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background: white;
    border-top: 1px solid #e5e7eb;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem 1.5rem;
    flex-shrink: 0;
}

/* 关闭按钮优化 */
#projectModal .modal-header .close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 11;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#projectModal .modal-header .close-button:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
    transform: scale(1.05);
}

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

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

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#projectModal .metric-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
}

#projectModal .metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

@media (max-width: 768px) {
    #projectModal {
        padding: 1rem;
    }
    
    #projectModal > div {
        max-height: 95vh;
        margin: 0;
        border-radius: 1rem;
    }
    
    #projectModal .modal-header {
        padding: 1rem;
        border-radius: 1rem 1rem 0 0;
    }
    
    #projectModal .modal-content {
        padding: 0 1rem;
        padding-bottom: 4rem;
    }
    
    #projectModal .modal-footer {
        padding: 1rem;
        border-radius: 0 0 1rem 1rem;
    }
    
    #projectModal .modal-header .close-button {
        top: 0.75rem;
        right: 0.75rem;
        width: 2rem;
        height: 2rem;
    }

    #projectModal #modalMetrics {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    #projectModal #modalTechnologies {
        gap: 0.5rem;
    }
    
    #projectModal #modalTechnologies span {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    #projectModal #modalImage {
        max-height: 200px;
        border-radius: 0.5rem;
    }
    
    #projectModal .modal-header h2 {
        font-size: 1.25rem;
    }
    
    #projectModal .modal-header p {
        font-size: 0.875rem;
    }
}

/* 滚动条样式优化 */
#projectModal .modal-content::-webkit-scrollbar {
    width: 6px;
}

#projectModal .modal-content::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

#projectModal .modal-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

#projectModal .modal-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 项目卡片按钮组优化 */
.project-card-buttons {
    display: flex;
    gap: 0.5rem;
}

.project-card-buttons .flex-1 {
    flex: 1;
}

/* 访问链接按钮特殊样式 */
.visit-link-button {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    transition: all 0.3s ease;
}

.visit-link-button:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* 移动端按钮触摸优化 */
@media (max-width: 768px) {
    .project-card-buttons {
        gap: 0.75rem;
    }
    
    .project-card-buttons button,
    .project-card-buttons a {
        min-height: 44px;
        font-size: 14px;
        padding: 12px 16px;
    }
    
    .visit-link-button:active {
        transform: translateY(0) scale(0.98);
        box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
    }
}

/* 触摸设备按钮优化 */
@media (hover: none) and (pointer: coarse) {
    .visit-link-button:hover {
        transform: none;
        box-shadow: none;
    }
    
    .visit-link-button:active {
        background: linear-gradient(135deg, #1e40af, #1e3a8a);
        transform: scale(0.98);
    }
}

/* 可访问标签样式 */
.accessible-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* 弹窗关闭按钮悬浮效果 */
#projectModal button[onclick="closeProjectModal()"] {
    transition: all 0.2s ease;
}

#projectModal button[onclick="closeProjectModal()"]:hover {
    background-color: #f3f4f6;
    transform: scale(1.05);
}

/* 项目亮点列表样式优化 */
#modalHighlights li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

#modalHighlights li:last-child {
    border-bottom: none;
}

/* 委托项目信息卡片动画 */
#modalContractInfo {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 弹窗内容区域渐入动画 */
#projectModal .mb-6 {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

#projectModal .mb-6:nth-child(1) { animation-delay: 0.1s; }
#projectModal .mb-6:nth-child(2) { animation-delay: 0.2s; }
#projectModal .mb-6:nth-child(3) { animation-delay: 0.3s; }
#projectModal .mb-6:nth-child(4) { animation-delay: 0.4s; }
#projectModal .mb-6:nth-child(5) { animation-delay: 0.5s; }
#projectModal .mb-6:nth-child(6) { animation-delay: 0.6s; }

