/* File: styles.css */

/* 基本样式 */
body {
    font-family: 'Arial', sans-serif;
    background-color: #f0f0f0;
    color: #333;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

/* 标题样式 */
h1 {
    font-size: 1.6em;
    font-weight: bold;
    color: #444;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
}

h2 {
    font-size: 1.4em;
    color: #555;
    margin: 18px 0 9px;
    text-align: left; /* 视频标题左对齐 */
}

h3 {
    font-size: 1.3em;
    color: #666;
    margin: 13px 0;
}

/* 链接样式 */
a {
    color: #007BFF;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #0056b3;
}

/* 头部样式 */
header {
    background-color: #333;
    color: #fff;
    padding: 12px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    box-sizing: border-box; /* 确保内边距不影响宽度 */
}

header h1 {
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* 导航栏样式 */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #444;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    width: 100%;
    box-sizing: border-box; /* 确保内边距不影响宽度 */
    flex-wrap: wrap; /* 允许换行 */
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap; /* 允许换行 */
    justify-content: center; /* 居中对齐 */
}

nav ul li {
    margin: 0;
}

nav ul li a {
    color: #fff;
    font-size: 1.2em;
    padding: 10px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

nav ul li a:hover {
    background-color: #555;
}

/* 语言切换器样式 */
.language-switcher {
    display: flex;
    gap: 10px;
    justify-content: center; /* 居中对齐 */
    margin-top: 10px; /* 增加上边距 */
    padding-right: 20px; /* 国旗右端留空间 */
}

.language-switcher img {
    width: 50px;
    height: auto;
    transition: transform 0.3s ease;
}

.language-switcher img:hover {
    transform: scale(1.1);
}

/* 主体内容样式 */
main {
    padding: 20px;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
}

/* 首页幻灯片容器 */
.slideshow-container {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    overflow: hidden;
    border: 5px solid #666;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    aspect-ratio: 3 / 2; /* 设置长宽比例为 3:2 */
}

/* 幻灯片 */
.slideshow {
    display: flex;
    transition: transform 1s ease-in-out;
    width: 100%;
    height: 100%;
}

.slideshow img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持图片比例，避免变形 */
    border-radius: 5px;
    flex-shrink: 0; /* 防止图片缩小 */
}

/* 视频目录容器 */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* 单个视频项 */
.video-item {
    position: relative;
    border: 5px solid #666;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease;
    aspect-ratio: 16 / 9; /* 设置长宽比例为 16:9 */
}

/* 视频图片 */
.video-item img {
    width: 100%;
    height: 100%; /* 图片填充整个视频项 */
    object-fit: cover; /* 保持图片比例，避免变形 */
    transition: transform 0.3s ease;
}

/* 视频标题 */
.video-item h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.3); /* 半透明背景 */
    color: #fff;
    padding: 8px; /* 增加内边距 */
    margin: 0;
    text-align: center;
    font-size: 1.1em;
    font-weight: normal;
    z-index: 1; /* 确保标题在图片上方 */
}

/* 悬停效果 */
.video-item:hover {
    transform: scale(1.05);
}

.video-item:hover img {
    transform: scale(1.1);
}

/* 相关链接页面样式 */
.links-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
}

.links-list a {
    color: #333;
    text-decoration: none;
    font-size: 1.2em;
    padding: 10px;
    background-color: #fff;
    border: 2px solid #666;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease;
}

.links-list a:hover {
    background-color: #ddd;
}

/* 视频播放页面样式 */
.video-player {
    max-width: 1280px;
    margin: 20px auto;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    text-align: left; /* 视频标题左对齐 */
}

.video-title {
    font-size: 1.5em;
    margin-bottom: 10px;
    text-align: left; /* 视频标题左对齐 */
}

.video-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 比例 */
    overflow: hidden;
    border: 5px solid #666;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    background-color: #000;
}

video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    object-fit: contain; /* 保持视频内容完整显示，必要时加黑边 */
}

/* 全屏播放按钮样式 */
.fullscreen-button {
    display: block;
    margin: 20px auto;
    padding: 10px 20px;
    font-size: 1.2em;
    color: #fff;
    background-color: #007BFF;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.fullscreen-button:hover {
    background-color: #0056b3;
}

/* 摄影分类网格布局 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* 单个摄影分类项 */
.photo-item {
    position: relative;
    border: 5px solid #666;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    transition: transform 0.3s ease;
    aspect-ratio: 3 / 2; /* 设置长宽比例为 3:2 */
}

/* 摄影分类图片 */
.photo-item img {
    width: 100%;
    height: 100%; /* 图片填充整个视频项 */
    object-fit: cover; /* 保持图片比例，避免变形 */
    transition: transform 0.3s ease;
}

/* 摄影分类标题 */
.photo-item h3 {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.3); /* 半透明背景 */
    color: #fff;
    padding: 8px; /* 增加内边距 */
    margin: 0;
    text-align: center;
    font-size: 1.1em;
    font-weight: normal;
    z-index: 1; /* 确保标题在图片上方 */
}

/* 悬停效果 */
.photo-item:hover {
    transform: scale(1.05);
}

.photo-item:hover img {
    transform: scale(1.1);
}

/* 缩略图网格布局 */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    padding: 20px;
}

/* 单个缩略图项 */
.thumbnail-item {
    border: 2px solid #666;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.thumbnail-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* 更新按钮样式 */
.update-form {
    text-align: left;
    margin: 20px;
}

.update-form button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.update-form button:hover {
    background-color: #0056b3;
}

/* 照片查看页面样式 */
.photo-view {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.back-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.photo-container {
    text-align: center;
    margin-top: 50px;
}

.photo-container img {
    max-width: 80%;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.navigation {
    margin-top: 20px;
    text-align: center;
}

.nav-button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin: 0 10px;
    transition: background-color 0.3s ease;
}

.nav-button:hover {
    background-color: #0056b3;
}

/* 分类按钮样式 */
.category-buttons {
    text-align: center;
    margin: 20px;
}

.category-button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    margin: 0 10px;
    transition: background-color 0.3s ease;
}

.category-button:hover {
    background-color: #0056b3;
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.4em;
    }

    h2 {
        font-size: 1.2em;
    }

    h3 {
        font-size: 1.1em;
    }

    nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .language-switcher {
        flex-direction: column; /* 手机版竖着排列 */
        align-items: flex-end; /* 靠右侧排列 */
        margin-top: 10px;
        padding-right: 10px; /* 调整国旗右端空间 */
    }

    .slideshow-container {
        max-width: 100%;
        border-radius: 0;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .video-player {
        padding: 10px;
    }

    .video-title {
        font-size: 1.2em;
    }

    .video-container {
        max-height: 60vh;
    }

    .fullscreen-button {
        font-size: 1em;
        padding: 8px 16px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.6em;
    }

    h2 {
        font-size: 1.4em;
    }

    h3 {
        font-size: 1.2em;
    }

    .language-switcher img {
        width: 50px;
    }

    .slideshow-container {
        border: none;
        box-shadow: none;
    }

    .video-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }

    .photo-gallery {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .video-player {
        padding: 5px;
    }

    .video-title {
        font-size: 1em;
    }

    .video-container {
        max-height: 50vh;
    }

    .fullscreen-button {
        font-size: 0.9em;
        padding: 6px 12px;
    }
}