/* style.css */

@layer utilities {
    .text-shadow {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    }
    .transition-smooth {
        transition: all 0.3s ease-in-out;
    }
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

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

/* 导航栏滚动效果 */
.navbar-fixed {
    backdrop-filter: blur(8px);
    background-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* 技术流程图样式 */
.tech-flow-container {
    position: relative;
}
.tech-flow-container::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #e5e7eb;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}
.tech-flow-item {
    position: relative;
    margin-bottom: 2rem;
}
.tech-flow-item:nth-child(odd) {
    padding-right: calc(50% + 2rem);
}
.tech-flow-item:nth-child(even) {
    padding-left: calc(50% + 2rem);
}
.tech-flow-item::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #3b82f6;
    top: 5px;
}
.tech-flow-item:nth-child(odd)::before {
    right: calc(50% - 6px);
}
.tech-flow-item:nth-child(even)::before {
    left: calc(50% - 6px);
}

/* 数据流程图样式 */
.data-flow-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}
.data-flow-item {
    position: relative;
    margin-bottom: 2rem;
    width: 100%;
    max-width: 400px;
}
.data-flow-item:not(:last-child)::after {
    content: '';
    position: absolute;
    width: 2px;
    height: 2rem;
    background-color: #e5e7eb;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
}

/* 时间轴样式 */
.timeline-container {
    position: relative;
}
.timeline-container::after {
    content: '';
    position: absolute;
    width: 2px;
    background-color: #e5e7eb;
    top: 0;
    bottom: 0;
    left: 15px;
    margin-left: -1px;
}
.timeline-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 2rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #3b82f6;
    left: 10px;
    top: 5px;
    z-index: 1;
}

/* 项目详情页特有样式 */
.achievement-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.7));
    z-index: 1;
}
.feature-card > * {
    position: relative;
    z-index: 2;
}

/* 横向滑动组件样式 (增强) */
.slider-wrapper {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;  /* Firefox */
    -ms-overflow-style: none;  /* IE/Edge */
    padding-bottom: 1rem;
}
.slider-wrapper::-webkit-scrollbar {
    display: none;  /* Chrome/Safari */
}
.slider-card {
    scroll-snap-align: center;
}
.slider-dot.active {
    @apply w-4 bg-primary;
    background-color: #3b82f6;
    width: 1rem;
}
.slider-dot {
    transition: all 0.2s ease;
    width: 0.625rem;  /* 2.5px */
    height: 0.625rem;
    background-color: #9ca3af;
    border-radius: 9999px;
    margin: 0 0.25rem;
    cursor: pointer;
}
.slider-dot:hover {
    background-color: #6b7280;
}
.slider-prev:disabled, .slider-next:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}
/* 滑动容器相对定位，供遮罩绝对定位参考 */
.slider-wrapper {
    position: relative;
}

/* 左右渐变遮罩公用样式 */
.slider-fade-left,
.slider-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48px;
    pointer-events: none;    /* 让遮罩不拦截点击事件，确保箭头按钮和卡片可点 */
    z-index: 5;
    transition: opacity 0.2s ease;
}

.slider-fade-left {
    left: 0;
    background: linear-gradient(to right, 
        rgba(248, 250, 252, 1), 
        rgba(248, 250, 252, 0)
    );
}

.slider-fade-right {
    right: 0;
    background: linear-gradient(to left, 
        rgba(248, 250, 252, 1), 
        rgba(248, 250, 252, 0)
    );
}

/* 可选：在滚动到边界时自动隐藏对应的遮罩（提升体验） */
.slider-wrapper.at-start .slider-fade-left {
    opacity: 0;
}
.slider-wrapper.at-end .slider-fade-right {
    opacity: 0;
}