/* 基础样式和移动端优化 */
* {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background: linear-gradient(180deg, #FFF5F7 0%, #FFE4EC 50%, #FFF5F7 100%);
    overflow-x: hidden;
    min-height: 100vh;
    margin: 0;
    padding: 0;
}

/* 移动端安全区域适配 */
:root {
    --safe-area-inset-top: env(safe-area-inset-top, 0px);
    --safe-area-inset-right: env(safe-area-inset-right, 0px);
    --safe-area-inset-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-inset-left: env(safe-area-inset-left, 0px);
}

.safe-area-padding {
    padding-top: var(--safe-area-inset-top);
    padding-right: var(--safe-area-inset-right);
    padding-bottom: var(--safe-area-inset-bottom);
    padding-left: var(--safe-area-inset-left);
}

/* 图片优化 - 防止布局抖动 */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 懒加载图片样式 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazyloaded {
    opacity: 1;
}

/* 图片占位符 */
.img-placeholder {
    background: linear-gradient(135deg, #FFE4EC 0%, #FFF0F5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5DBDB6;
    border-radius: 8px;
}

/* 波浪分隔线 */
.wave-divider {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-divider svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 60px;
}

.wave-divider .shape-fill {
    fill: #FFF5F7;
}

/* 动画效果 */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.avatar-float {
    animation: float 3s ease-in-out infinite;
}

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

.hero-fade-in {
    animation: fadeInUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-fade-in-1 { animation-delay: 0.1s; opacity: 0; }
.hero-fade-in-2 { animation-delay: 0.2s; opacity: 0; }
.hero-fade-in-3 { animation-delay: 0.3s; opacity: 0; }

/* 滚动显示动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 卡片悬停效果 */
.card-hover {
    transition: all 0.3s ease-out;
}

@media (hover: hover) and (pointer: fine) {
    .card-hover:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 40px rgba(0,0,0,0.12);
    }
}

/* 技能按钮 */
.skill-btn {
    transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

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

.skill-btn:active::before {
    width: 100%;
    height: 100%;
}

@media (hover: hover) and (pointer: fine) {
    .skill-btn:hover {
        transform: scale(1.08) translateY(-2px);
        box-shadow: 0 8px 20px rgba(93, 189, 182, 0.3);
    }
}

.skill-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(93, 189, 182, 0.2);
}

/* 分类标题 */
.category-header {
    transition: all 0.3s ease;
    cursor: pointer;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    .category-header:hover {
        transform: translateX(4px);
        box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    }
}

.category-header:active {
    transform: scale(0.98);
}

/* 展开动画 */
.skill-category-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.skill-category-content.expanded {
    max-height: 500px;
}

.category-arrow {
    transition: transform 0.3s ease;
}

.category-arrow.rotated {
    transform: rotate(180deg);
}

/* 按钮悬停 */
.btn-hover {
    transition: all 0.3s ease-out;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    .btn-hover:hover {
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(93, 189, 182, 0.4);
    }
}

.btn-hover:active {
    transform: scale(0.98);
}

/* 脉冲动画 */
@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
    50% { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
}

.btn-pulse {
    animation: pulse-glow 2s infinite;
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 技能详情页 */
.skill-detail-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #FFF5F7 0%, #FFE4EC 100%);
    z-index: 100;
    overflow-y: auto;
    display: none;
}

.skill-detail-page.active {
    display: block;
}

/* 星级评分 */
.star-rating {
    color: #FFD700;
}

/* 证书卡片 */
.cert-card {
    background: linear-gradient(135deg, #fff 0%, #FFF5F7 100%);
    border: 2px dashed #FFB6C1;
    transition: all 0.3s ease;
    cursor: pointer;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    .cert-card:hover {
        border-color: #5DBDB6;
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(255, 182, 193, 0.3);
    }
}

.cert-card:active {
    transform: scale(0.95);
}

/* 页面切换动画 */
.page-slide-enter {
    animation: slideIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* 响应式优化 */
@media (max-width: 640px) {
    .skill-category-content.expanded {
        max-height: 600px;
    }
    
    .cert-card, .skill-btn {
        min-height: 44px; /* 最小触摸目标尺寸 */
    }
}

/* 加载指示器 */
.loading-indicator {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.loading-indicator.active {
    display: block;
}

/* 点赞动画 */
.scale-110 {
    transform: scale(1.1);
    transition: transform 0.3s ease;
}

/* 工作展示卡片 */
.work-card {
    transition: all 0.3s ease;
    cursor: pointer;
    touch-action: manipulation;
}

@media (hover: hover) and (pointer: fine) {
    .work-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 8px 25px rgba(93, 189, 182, 0.3);
    }
}

.work-card:active {
    transform: scale(0.98);
}

/* 错误提示 */
.error-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    z-index: 9999;
    display: none;
}

.error-message.show {
    display: block;
    animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    10% { opacity: 1; transform: translateX(-50%) translateY(0); }
    90% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* 悬浮预约按钮 */
.floating-contact-btn {
    position: fixed;
    right: 16px;
    bottom: 100px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #5DBDB6 0%, #4AA8A1 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(93, 189, 182, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: all 0.3s ease;
    animation: float-btn 3s ease-in-out infinite;
}

.floating-contact-btn i {
    font-size: 18px;
    margin-bottom: 2px;
}

.floating-contact-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(93, 189, 182, 0.5);
}

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

@keyframes float-btn {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* 安全区域适配 - 悬浮按钮 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .floating-contact-btn {
        bottom: calc(100px + env(safe-area-inset-bottom));
    }
}