/* layout.css - 网站布局样式 */

/* 页面整体布局 */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* 确保body没有默认边距 */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 头部区域 */
.site-header {
    position: absolute;
    /* 改为绝对定位，这样不会占用空间 */
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: transparent;
    /* 移除背景色，改为透明 */
    backdrop-filter: none;
    /* 移除模糊背景效果 */
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    /* 减小高度 */
    padding: 0 20px;
    /* 减小内边距 */
}

/* Logo样式 */
.logo {
    display: flex;
    align-items: center;
}

.logo img {
    height: 30px;
    /* 减小logo尺寸 */
    width: auto;
    margin-right: 10px;
}

.logo span {
    color: #ffffff;
    /* Logo文字改为白色 */
    font-weight: bold;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    gap: 30px;
    align-items: center;
}

/* 导航链接 - 更简洁的样式 */
.nav-link {
    position: relative;
    padding: 8px 0;
    font-weight: 500;
    color: #ffffff; /* 确保文字为白色 */
    border: none !important; /* 完全移除边框 */
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: none;
    outline: none;
    background-color: transparent !important; /* 强制透明背景，防止被其他样式覆盖 */
}

/* 导航链接悬停和激活状态 - 移除所有背景色和边框 */
.nav-link:hover,
.nav-link.active {
    color: #ffffff; /* 保持白色 */
    background-color: transparent !important; /* 强制保持透明 */
    border: none !important;
    box-shadow: none;
    text-decoration: none;
}

/* 修改下划线效果，使用更细的线条 */
.nav-link::after {
    content: '';
    display: block;
    width: 0;
    height: 1px; /* 更细的下划线 */
    background-color: #ffffff;
    transition: width 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
}

/* 悬停和激活时显示下划线 */
.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 确保移动端导航菜单中的链接也遵循相同样式 */
.mobile-menu .nav-link {
    background-color: transparent !important;
    border: none !important;
    color: #ffffff;
}

/* 汉堡菜单按钮 - 移动端 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    cursor: pointer;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #ffffff;
    /* 改为白色，在图片上更容易看见 */
    transition: all 0.3s ease;
}

/* 移动端菜单样式 */
.mobile-menu {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.7);
    /* 稍微透明的背景 */
    padding: 20px;
    border-radius: 0 0 10px 10px;
    z-index: 100;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu .nav-menu {
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

/* 移动端导航链接样式 */
.mobile-menu .nav-link {
    padding: 8px 0;
    width: 100%;
    text-align: center;
}

/* 移动端导航链接下划线效果 */
.mobile-menu .nav-link::after {
    left: 0;
    right: 0;
    margin: 0 auto;
    /* 居中下划线 */
}

/* 主内容区域 - 确保没有任何边距 */
.site-main {
    flex: 1;
    padding: 0;
    margin: 0;
}

/* 容器样式 - 确保没有任何边距 */
.container {
    width: 100%;
    max-width: 100%;
    padding: 0;
    margin: 0;
}

/* 作品展示区域 - 确保没有任何边距 */
.works-section {
    width: 100%;
    padding: 0;
    margin: 0;
}

/* 作品容器样式 - 确保没有任何边距 */
.works-container {
    position: relative;
    width: 100%;
    overflow: visible;
    padding: 0;
    margin: 0;
}

/* 作品网格布局 - 确保没有任何顶部边距 */
.works-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 10px;
    margin: 0;
    padding: 0;
}

/* 行布局 - 使用flex布局 */
.work-row {
    display: flex;
    width: 100%;
    gap: 10px; /* 列间距 */
    margin-bottom: 10px; /* 行底部间距 */
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.work-row.animated {
    opacity: 1;
    transform: translateY(0);
}

/* 移除偶数行反向排序 */
.work-row:nth-child(even) {
    /* 不再反向排序 */
    flex-direction: row; 
}

/* 确保第一行和第三行是小-小-大-小 */
.work-row:nth-child(4n+1),
.work-row:nth-child(4n+3) {
    flex-direction: row;
}

/* 确保第二行和第四行是小-大-小-小 */
.work-row:nth-child(4n+2),
.work-row:nth-child(4n) {
    flex-direction: row;
}

/* 作品项目样式 - 完全重写以解决遮挡问题 */
.work-item {
    position: relative;
    overflow: visible; /* 改为visible，避免内容被裁剪 */
    background-color: transparent;
    margin: 0;
    padding: 0;
}

/* 图片样式 - 直接应用于img元素 */
.work-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    position: relative;
    z-index: 5; /* 确保图片在最上层 */
    margin: 0;
    padding: 0;
}

/* 小尺寸项目 */
.work-item-small {
    width: 20%;
    /* 小项目占20%宽度 */
    flex-shrink: 0;
}

/* 大尺寸项目 */
.work-item-large {
    width: 40%;
    /* 大项目占40%宽度 */
    flex-shrink: 0;
}

/* 作品信息样式 - 确保显示在图片上方 */
.work-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    z-index: 6; /* 比图片高一层 */
    display: none !important; /* 完全隐藏文字和渐变背景 */
}

/* 调整标题样式 */
.work-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 0;
    /* 移除底部边距 */
    color: #ffffff;
    text-align: center;
    /* 居中显示 */
}

/* 隐藏描述和分类 */
.work-description,
.work-category {
    display: none;
}

/* 页脚区域 */
.site-footer {
    padding: 20px 0;
    background-color: transparent;
    margin-top: 5px;
    /* 与最后一行作品的间距 */
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.copyright {
    margin-bottom: 10px;
    color: var(--secondary-color);
}

.beian {
    color: var(--secondary-color);
    font-size: 14px;
}

/* 确保图片不会被其他元素遮挡 */
.work-row, .works-grid, .works-container, .works-section, .container, .site-main {
    overflow: visible;
    background-color: transparent;
}

/* 彻底移除所有悬停效果 - 完整覆盖 */
*, *:hover, *:active, *:focus {
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    transform: none !important;
    transition: opacity 0.8s ease, transform 0.8s ease !important;
}

.work-item:hover, 
.work-item:hover img,
.work-item img:hover,
.work-item:hover .work-info,
.work-item:hover *,
.color-block:hover,
.color-block:hover img,
img:hover {
    transform: none !important;
    filter: none !important;
    box-shadow: none !important;
    opacity: 1 !important;
    scale: 1 !important;
}

/* 移除main.js中可能引入的hover效果类 */
.hover, .card-hover, .image-hover {
    transform: none !important;
    box-shadow: none !important;
    filter: none !important;
}

/* 添加页面顶部黑色渐变 */
.page-gradient-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 150px; /* 调整渐变高度 */
    background: linear-gradient(to bottom, 
                rgba(0,0,0,0.7) 0%, 
                rgba(0,0,0,0.5) 30%,
                rgba(0,0,0,0.3) 60%,
                rgba(0,0,0,0) 100%);
    z-index: 1000; /* 确保在导航下方，在内容上方 */
    pointer-events: none; /* 允许点击穿透到导航元素 */
}