/* 苹果风格样式 */

/* 基础样式 */
html {
    scroll-behavior: smooth;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 滚动snap平滑过渡 */
.snap-y {
    scroll-snap-type: y proximity;
}

.snap-start {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

/* 苹果风格颜色变量 */
:root {
    --apple-gray: #f5f5f7;
    --apple-darkgray: #86868b;
    --apple-black: #1d1d1f;
    --apple-blue: #0071e3;
    --apple-blue-hover: #0077ED;
}

.dark {
    --apple-gray: #1f2937;
    --apple-darkgray: #9ca3af;
    --apple-black: #f9fafb;
}

/* 苹果风格导航链接 */
.apple-nav-link {
    position: relative;
    transition: opacity 0.3s ease;
    padding: 0.5rem 0;
}

.apple-nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1.5px;
    bottom: 0;
    left: 50%;
    background-color: #1d1d1f;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform: translateX(-50%);
}

.dark .apple-nav-link::after {
    background-color: #f5f5f7;
}

.apple-nav-link:hover {
    opacity: 0.7;
}

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

/* 苹果风格主题切换按钮 */
.apple-theme-toggle {
    background: transparent;
    color: #1d1d1f;
    transition: opacity 0.3s ease;
}

.apple-theme-toggle:hover {
    opacity: 0.7;
}

.dark .apple-theme-toggle {
    color: #f5f5f7;
}

/* 苹果风格主按钮 */
.apple-btn-primary {
    background-color: #0071e3;
    color: white;
    border: none;
    transition: background-color 0.3s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.apple-btn-primary:hover {
    background-color: #0077ED;
}

/* 苹果风格次按钮 */
.apple-btn-secondary {
    background-color: transparent;
    color: #0071e3;
    border: 1.5px solid #0071e3;
    transition: all 0.3s ease;
    font-family: inherit;
    letter-spacing: -0.01em;
}

.apple-btn-secondary:hover {
    background-color: #0071e3;
    color: white;
}

/* 苹果风格卡片 */
.apple-card {
    background-color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.apple-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.dark .apple-card {
    background-color: #1f2937;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.dark .apple-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* 苹果风格状态徽章 */
.apple-status-badge {
    font-family: inherit;
    font-weight: 500;
    letter-spacing: -0.01em;
}

/* 苹果风格标题动画 */
.apple-hero-title {
    animation: appleFadeIn 1s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.apple-hero-subtitle {
    animation: appleFadeIn 1s cubic-bezier(0.25, 0.1, 0.25, 1) 0.2s forwards;
    opacity: 0;
    transform: translateY(20px);
}

/* 苹果风格Logo动画 */
.apple-logo {
    animation: appleLogoFadeIn 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    opacity: 0;
    transform: scale(0.9);
}

@keyframes appleLogoFadeIn {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Logo悬停效果 */
.apple-logo:hover {
    transform: scale(1.05);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Logo响应式样式 */
@media (max-width: 768px) {
    .apple-logo {
        max-height: 120px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .apple-logo {
        max-height: 168px;
    }
}

@media (min-width: 1025px) {
    .apple-logo {
        max-height: 192px;
    }
}

/* Logo过渡效果 */
.apple-logo {
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), opacity 0.3s ease;
}

.apple-section-title {
    animation: appleFadeIn 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

.apple-section-subtitle {
    animation: appleFadeIn 0.8s cubic-bezier(0.25, 0.1, 0.25, 1) 0.1s forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* 苹果风格滚动指示器 */
.apple-scroll-indicator {
    animation: appleBounce 2s infinite;
}

@keyframes appleBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
    60% {
        transform: translateY(-4px);
    }
}

/* 苹果风格滚动动画 */
.apple-scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.1, 0.25, 1), transform 0.8s cubic-bezier(0.25, 0.1, 0.25, 1);
}

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

/* 苹果风格图片网格 */
.apple-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.apple-image-item {
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.apple-image-item:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 苹果风格视频网格 - 水平滚动 */
.apple-video-grid {
    display: flex;
    overflow-x: auto;
    gap: 24px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 16px;
}

.apple-video-grid::-webkit-scrollbar {
    height: 6px;
}

.apple-video-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.apple-video-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.apple-video-grid::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.dark .apple-video-grid::-webkit-scrollbar-track {
    background: #374151;
}

.dark .apple-video-grid::-webkit-scrollbar-thumb {
    background: #6b7280;
}

.apple-video-card {
    flex: 0 0 300px;
    scroll-snap-align: start;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.apple-video-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* 苹果风格按钮悬停效果 */
.apple-btn-primary:active,
.apple-btn-secondary:active {
    transform: scale(0.98);
}

/* 苹果风格卡片悬停效果 */
.apple-card:active {
    transform: scale(0.99);
}

/* 苹果风格图片悬停效果 */
.apple-image-item:hover .absolute {
    transform: translateY(0);
}

/* 苹果风格视频卡片悬停效果 */
.apple-video-card:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.dark .apple-video-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

/* 苹果风格图片网格响应式 */
@media (max-width: 768px) {
    .apple-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .apple-video-card {
        flex: 0 0 260px;
    }
}

@media (max-width: 480px) {
    .apple-image-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .apple-video-card {
        flex: 0 0 240px;
    }
}

/* 导航链接样式 */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #3B82F6;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.dark .nav-link::after {
    background-color: #60A5FA;
}

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

.nav-link.active::after {
    width: 100%;
}

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

.card-hover:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* 图片网格样式 */
.image-item {
    position: relative;
    overflow: hidden;
    border-radius: 1rem;
    aspect-ratio: 4/3;
}

.image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-item:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.image-item:hover .image-overlay {
    transform: translateY(0);
}

/* 模态框样式 */
.modal-enter {
    animation: modalEnter 0.3s ease forwards;
}

.modal-leave {
    animation: modalLeave 0.3s ease forwards;
}

@keyframes modalEnter {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes modalLeave {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* 加载动画 */
.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

.dark .loading-spinner {
    border-color: #374151;
    border-top-color: #60A5FA;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    #theme-toggle {
        padding: 0.5rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.dark ::-webkit-scrollbar-track {
    background: #1f2937;
}

.dark ::-webkit-scrollbar-thumb {
    background: #4b5563;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #6b7280;
}

/* 选中文本样式 */
::selection {
    background-color: #3B82F6;
    color: white;
}

.dark ::selection {
    background-color: #60A5FA;
    color: #1F2937;
}

/* 输入框焦点样式 */
input:focus, textarea:focus, select:focus {
    outline: none;
    ring: 2px;
    ring-color: #3B82F6;
    border-color: #3B82F6;
}

.dark input:focus, .dark textarea:focus, .dark select:focus {
    ring-color: #60A5FA;
    border-color: #60A5FA;
}

/* 按钮点击效果 */
button:active {
    transform: scale(0.98);
}

/* 链接下划线动画 */
.link-underline {
    position: relative;
    text-decoration: none;
}

.link-underline::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #3B82F6;
    transform-origin: bottom right;
    transition: transform 0.25s ease-out;
}

.dark .link-underline::after {
    background-color: #60A5FA;
}

.link-underline:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.fade-in-delay-1 {
    animation-delay: 0.1s;
    opacity: 0;
}

.fade-in-delay-2 {
    animation-delay: 0.2s;
    opacity: 0;
}

.fade-in-delay-3 {
    animation-delay: 0.3s;
    opacity: 0;
}

.fade-in-delay-4 {
    animation-delay: 0.4s;
    opacity: 0;
}

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

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* 旋转动画 */
.rotate {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 弹跳动画 */
.bounce {
    animation: bounce 1s infinite;
}

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

/* 骨架屏加载效果 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

.dark .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200% 100%;
}

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

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.dark .tooltip::after {
    background-color: #f9fafb;
    color: #1f2937;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: 110%;
}

/* 状态指示器 */
.status-online::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

.status-offline::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #ef4444;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* 进度条 */
.progress-bar {
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.dark .progress-bar {
    background-color: #374151;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3B82F6, #60A5FA);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* 标签样式 */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #e5e7eb;
    color: #374151;
}

.dark .tag {
    background-color: #374151;
    color: #d1d5db;
}

.tag-primary {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.dark .tag-primary {
    background-color: #1e3a8a;
    color: #93c5fd;
}

/* 分割线 */
.divider {
    height: 1px;
    background: linear-gradient(to right, transparent, #d1d5db, transparent);
}

.dark .divider {
    background: linear-gradient(to right, transparent, #4b5563, transparent);
}

/* 容器最大宽度 */
.container-custom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 640px) {
    .container-custom {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1024px) {
    .container-custom {
        padding: 0 2rem;
    }
}

/* 响应式隐藏 */
.hidden-mobile {
    display: block;
}

.hidden-desktop {
    display: none;
}

@media (max-width: 767px) {
    .hidden-mobile {
        display: none;
    }
    
    .hidden-desktop {
        display: block;
    }
}

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