/* 全局样式 - 应用于整个页面的基础样式 */
* {
    margin: 0;  /* 移除所有元素的外边距 */
    padding: 0;  /* 移除所有元素的内边距 */
    box-sizing: border-box;  /* 使元素的宽度包含padding和border，更容易布局 */
}

/* HTML和BODY元素样式 - 确保应用占满整个视口 */
html, body {
    width: 100%;  /* 宽度占满整个视口 */
    height: 100%;  /* 高度占满整个视口 */
    overflow: hidden;  /* 隐藏滚动条，创建全屏体验 */
}

/* BODY元素样式 - 设置基础字体和背景 */
body {
    font-family: Arial, sans-serif;  /* 设置无衬线字体，提高可读性 */
    margin: 0;  /* 确保没有边距 */
    padding: 0;  /* 确保没有内边距 */
    background-color: #000;  /* 黑色背景 */
    display: flex;  /* 使用弹性布局 */
    justify-content: center;  /* 水平居中内容 */
}

/* 主应用容器 - 包含所有页面的主容器 */
#app {
    width: 100%;  /* 宽度占满父元素 */
    height: 100vh;  /* 高度占满视口高度，vh单位表示视口高度的百分比 */
    max-width: 500px;  /* 最大宽度限制，适合移动设备 */
    position: relative;  /* 相对定位，作为子元素的定位参考 */
    display: flex;  /* 使用弹性布局 */
    flex-direction: column;  /* 子元素垂直排列 */
    align-items: center;  /* 子元素水平居中 */
    overflow: hidden;  /* 隐藏超出部分 */
    background-color: #000;  /* 黑色背景 */
}

/* 通用页面样式 - 应用于所有页面的基础样式 */
.page {
    display: none;  /* 默认隐藏所有页面 */
    width: 100%;  /* 宽度占满父元素 */
    height: 100%;  /* 高度占满父元素 */
    position: relative;  /* 相对定位，作为子元素的定位参考 */
    flex: 1;  /* 在弹性容器中占用所有可用空间 */
}

/* 激活页面样式 - 当页面被激活时显示 */
.active {
    display: flex;  /* 显示为弹性容器 */
    flex-direction: column;  /* 子元素垂直排列 */
}

/* 第二页特定样式 - 密码输入页面 */
#page2 {
    background-color: #fff;  /* 白色背景 */
}

/* 内容容器样式 - 页面内的主要内容区域 */
.content {
    width: 100%;  /* 宽度占满父元素 */
    height: 100%;  /* 高度占满父元素 */
    position: relative;  /* 相对定位，作为子元素的定位参考 */
    display: flex;  /* 使用弹性布局 */
    flex-direction: column;  /* 子元素垂直排列 */
}

/* 背景图片样式 - 页面的背景图片 */
.background-image {
    width: 100%;  /* 宽度占满父元素 */
    height: 100%;  /* 高度占满父元素 */
    position: absolute;  /* 绝对定位，相对于最近的定位祖先 */
    top: 0;  /* 顶部对齐 */
    left: 0;  /* 左侧对齐 */
    z-index: 0;  /* 层叠顺序，确保背景在其他元素下方 */
    background-position: center;  /* 背景图片居中 */
    background-repeat: no-repeat;  /* 背景图片不重复 */
    background-size: cover;  /* 背景图片覆盖整个元素，可能裁剪但不变形 */
}

/* 页面2的图片特殊处理 - 确保图片不拉伸 */
#page2 .background-image {
    background-size: contain;  /* 背景图片完全显示，可能有空白但不变形 */
    background-position: top;  /* 背景图片顶部对齐 */
}

/* 视频/图片容器样式 - 用于显示查询结果的容器 */
.media-container {
    width: 100%;  /* 宽度占满父元素 */
    height: 100%;  /* 高度占满父元素 */
    display: flex;  /* 使用弹性布局 */
    align-items: center;  /* 子元素垂直居中 */
    justify-content: center;  /* 子元素水平居中 */
    position: relative;  /* 相对定位 */
    z-index: 1;  /* 层叠顺序，确保在背景之上 */
}

/* 媒体内容样式 - 视频或图片元素 */
.media-content {
    width: 100%;  /* 宽度占满父元素 */
    max-height: 100%;  /* 最大高度不超过父元素 */
    object-fit: contain;  /* 保持宽高比，确保完全显示 */
}

/* 视频控制器样式 - 确保视频控制器没有边距 */
video::-webkit-media-controls {
    margin: 0;  /* 移除外边距 */
    padding: 0;  /* 移除内边距 */
}

/* 倒计时样式 - 首页右上角的倒计时圆圈 */
.countdown {
    position: absolute;  /* 绝对定位，相对于最近的定位祖先 */
    top: 20px;  /* 距离顶部20像素 */
    right: 20px;  /* 距离右侧20像素 */
    width: 40px;  /* 宽度40像素 */
    height: 40px;  /* 高度40像素 */
    background: rgba(255, 255, 255, 0.8);  /* 半透明白色背景 */
    border-radius: 50%;  /* 圆形边框 */
    display: flex;  /* 使用弹性布局 */
    align-items: center;  /* 子元素垂直居中 */
    justify-content: center;  /* 子元素水平居中 */
    font-size: 24px;  /* 字体大小 */
    color: #333;  /* 深灰色文字 */
    z-index: 1;  /* 层叠顺序，确保在背景之上 */
}

/* 搜索容器样式 - 密码输入区域 */
.search-container {
    width: 100%;  /* 宽度占满父元素 */
    padding: 20px;  /* 内边距20像素 */
    display: flex;  /* 使用弹性布局 */
    flex-direction: column;  /* 子元素垂直排列 */
    align-items: center;  /* 子元素水平居中 */
    justify-content: center;  /* 子元素垂直居中 */
    position: absolute;  /* 绝对定位 */
    top: 39%;  /* 距离顶部39%，接近垂直居中 */
    transform: translateY(-50%);  /* 向上移动自身高度的一半，实现精确垂直居中 */
    z-index: 1;  /* 层叠顺序，确保在背景之上 */
}

/* 搜索输入框样式 */
#searchInput {
    width: 80%;  /* 宽度为父元素的80% */
    padding: 15px;  /* 内边距15像素，使输入框更大更易点击 */
    border: none;  /* 移除边框 */
    border-radius: 25px;  /* 圆角边框 */
    background: rgba(255, 255, 255, 0.9);  /* 半透明白色背景 */
    font-size: 16px;  /* 字体大小 */
    margin-bottom: 15px;  /* 下方外边距15像素 */
    border: 1px solid #387cd1;  /* 蓝色边框 */
    outline: none;  /* 移除输入框聚焦时的轮廓 */
}

/* 提交按钮样式 */
button {
    padding: 12px 30px;  /* 内边距：上下12像素，左右30像素 */
    background-color: #2196F3;  /* 蓝色背景 */
    color: white;  /* 白色文字 */
    border: none;  /* 移除边框 */
    border-radius: 20px;  /* 圆角边框 */
    font-size: 16px;  /* 字体大小 */
    cursor: pointer;  /* 鼠标悬停时显示手型光标 */
    width: 50%;  /* 宽度为父元素的50% */
}

/* 按钮悬停效果 */
button:hover {
    background-color: #1976D2;  /* 悬停时背景色变深 */
}

/* 媒体描述样式 - 显示在媒体内容下方的描述文本 */
.media-description {
    margin-top: 15px;  /* 上方外边距15像素 */
    padding: 10px;  /* 内边距10像素 */
    color: #333;  /* 深灰色文字 */
    text-align: center;  /* 文本居中 */
    background: rgba(255, 255, 255, 0.9);  /* 半透明白色背景 */
    border-radius: 5px;  /* 圆角边框 */
    max-width: 90%;  /* 最大宽度为父元素的90% */
    margin-left: auto;  /* 左右自动外边距，实现水平居中 */
    margin-right: auto;
}

/* 错误消息样式 - 查询失败时显示的错误信息 */
.media-container p {
    color: #666;  /* 灰色文字 */
    text-align: center;  /* 文本居中 */
    padding: 20px;  /* 内边距20像素 */
    background: rgba(255, 255, 255, 0.9);  /* 半透明白色背景 */
    border-radius: 5px;  /* 圆角边框 */
    margin: 20px auto;  /* 上下外边距20像素，左右自动外边距实现水平居中 */
    max-width: 80%;  /* 最大宽度为父元素的80% */
}

/* 响应式布局 - 中等屏幕 (501px以上) */
@media screen and (min-width: 501px) {
    #app, .page {
        max-width: 500px;  /* 限制最大宽度为500像素 */
        margin: 0 auto;  /* 水平居中 */
    }
    
    .background-image {
        height: 100vh;  /* 高度占满视口高度 */
        background-size: cover;  /* 背景图片覆盖整个元素 */
    }
    
    #page2 .background-image {
        background-size: contain;  /* 背景图片完全显示不变形 */
    }
}

/* 响应式布局 - 大屏幕 (1024px以上) */
@media screen and (min-width: 1024px) {
    #app, .page {
        max-width: 500px;  /* 限制最大宽度为500像素 */
        margin: 0 auto;  /* 水平居中 */
    }
    
    .background-image {
        background-size: cover;  /* 背景图片覆盖整个元素 */
    }
    
    #page2 .background-image {
        background-size: contain;  /* 背景图片完全显示不变形 */
    }
}

/* 响应式布局 - 小屏幕 (500px以下) */
@media screen and (max-width: 500px) {
    #searchInput {
        width: 90%;  /* 在小屏幕上增加输入框宽度 */
        padding: 12px;  /* 减小内边距 */
        font-size: 14px;  /* 减小字体大小 */
    }
    
    button {
        padding: 10px 25px;  /* 减小按钮内边距 */
        font-size: 14px;  /* 减小按钮字体大小 */
    }
    
    .countdown {
        width: 30px;  /* 减小倒计时圆圈大小 */
        height: 30px;
        font-size: 18px;  /* 减小倒计时字体大小 */
    }
} 