/* Apple 風格自定義樣式 */
.gradient-ancient {
    background: linear-gradient(135deg, #C8102E 0%, #ffffff 100%);
}

.text-shadow {
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hero-pattern {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 215, 0, 0.08) 0%, transparent 60%),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
}

/* Apple 風格毛玻璃效果 */
.glass-morphism {
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Apple 風格陰影系統 */
.shadow-apple-sm {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

.shadow-apple-md {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.shadow-apple-lg {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
}

/* Apple 風格按鈕動畫 */
.btn-apple {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0);
}

.btn-apple:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-apple:active {
    transform: translateY(0);
    transition: all 0.1s ease;
}

/* Apple 風格導覽動畫 */
.nav-item {
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: #FFFFFF;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.nav-item:hover::after {
    width: 100%;
}

/* Apple 風格卡片動畫 */
.feature-card {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform: translateY(0) scale(1);
}

.feature-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Apple 風格文字動畫 */
.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    transform: translateY(30px);
}

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

/* Apple 風格滾動指示器 */
.scroll-indicator {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0) translateX(-50%);
    }
    40% {
        transform: translateY(-10px) translateX(-50%);
    }
    60% {
        transform: translateY(-5px) translateX(-50%);
    }
}

/* Apple 風格響應式字體 */
.text-responsive {
    font-size: clamp(1rem, 4vw, 1.25rem);
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: -0.01em;
}

.title-responsive {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* 行動版選單動畫 */
#mobile-menu {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: top;
    overflow: hidden;
    max-height: 300px;
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.menu-hidden {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
}

#mobile-menu .mobile-menu-content {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s;
    opacity: 1;
    transform: translateY(0);
}

#mobile-menu.menu-hidden .mobile-menu-content {
    opacity: 0;
    transform: translateY(-15px);
}

/* 絲滑滾動動畫效果 */
/* 全局平滑滾動 */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* 為固定導覽列留出空間 */
}

/* 自定義滾動條樣式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #C8102E, #8B4513);
    border-radius: 4px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #A00E26, #7A3D11);
}

/* 滾動進度指示器 */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, #C8102E, #FFD700);
    z-index: 9999;
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(200, 16, 46, 0.5);
}

/* 滾動觸發動畫類別 */
.scroll-animate {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate.animate-in {
    opacity: 1;
}

.scroll-animate-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-left.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-right.animate-in {
    opacity: 1;
    transform: translateX(0);
}

.scroll-animate-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-animate-scale.animate-in {
    opacity: 1;
    transform: scale(1);
}

/* 視差滾動效果 */
.parallax-element {
    will-change: transform;
    transition: transform 0.1s ease-out;
}

/* 滾動時的背景視差效果 */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* 滾動時元素的淡入淡出效果 */
.scroll-fade {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-fade.fade-out {
    opacity: 0.3;
    transform: scale(0.95);
}

/* 滾動時導覽列的動態效果 */
nav.scrolled {
    background: rgba(200, 16, 46, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 滾動時的浮動效果 */
.float-on-scroll {
    transition: transform 0.3s ease;
}

.float-on-scroll.floating {
    transform: translateY(-5px);
}

/* 滾動時的旋轉效果 */
.rotate-on-scroll {
    transition: transform 0.5s ease;
}

.rotate-on-scroll.rotating {
    transform: rotate(5deg) scale(1.05);
}

/* AR相機及渲染效果 */
#ar-canvas {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

#camera-preview {
    position: relative;
    overflow: hidden;
}

.analysis-point {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #C8102E;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    animation: pointAppear 0.5s ease forwards;
}

@keyframes pointAppear {
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2);
    }
}