/*
 * @File: css/style.css
 * @Author: aidaox
 * @Date: 2024-07-27
 * @LastEditors: aidaox
 * @LastEditTime: 2024-07-27
 * @Description: Tela Preta 项目的主要样式文件。负责定义黑屏效果、控制菜单的样式和交互行为。
 */

/* --- 基础和重置样式 (Basic and Reset Styles) --- */

/* 
 * html, body 选择器
 * 作用: 选中整个 HTML 文档和页面的 body 部分。
 * 目的: 设置基础样式，确保黑屏效果能铺满整个浏览器窗口。
 */
html, body {
    /* width: 100%; height: 100%;: 设置宽度和高度为100%，让页面占满整个视口。 */
    width: 100%;
    height: 100%;
    /* margin: 0; padding: 0;: 移除浏览器默认的外边距和内边距，防止出现白边。 */
    margin: 0;
    padding: 0;
    /* overflow: hidden;: 隐藏滚动条，保持页面的整洁和沉浸感。 */
    overflow: hidden;
    /* font-family: ...: 设置一个通用的、无衬线的字体系列，保证在不同系统上显示一致。 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* color: white;: 设置默认文字颜色为白色，以便在黑色背景上能看清楚。 */
    color: white;
}

/* --- 核心样式 (Core Styles) --- */

/*
 * .bg-black 类选择器
 * 作用: 应用纯黑色的背景。
 * 目的: 这是项目的核心视觉效果。
 */
.bg-black {
    /* background-color: #000000;: 设置背景颜色为纯黑色。 */
    background-color: #000000;
}

/* --- 控制菜单样式 (Controls Menu Styles) --- */

/*
 * #controls ID 选择器
 * 作用: 选中ID为 "controls" 的顶部控制菜单。
 * 目的: 定义菜单的布局、位置和外观。
 */
#controls {
    /* position: fixed;: 固定定位，让菜单始终停留在浏览器窗口的顶部，不随页面滚动。 */
    position: fixed;
    /* top: 0; left: 0; right: 0;: 将菜单固定在顶部的左、中、右三个方向。 */
    top: 0;
    left: 0;
    right: 0;
    /* background: rgba(20, 20, 20, 0.9);: 设置半透明的深灰色背景，既能看清菜单，又能透出下方的黑屏。 */
    background: rgba(20, 20, 20, 0.9);
    /* padding: 1rem;: 设置内边距，让菜单内容不会紧贴边缘。 */
    padding: 1rem;
    /* text-align: center;: 文本居中对齐。 */
    text-align: center;
    /* transition: transform 0.3s ease-in-out;: 设置过渡效果，当菜单显示或隐藏时，会有平滑的动画。 */
    transition: transform 0.3s ease-in-out;
    /* z-index: 100;: 设置一个较高的堆叠顺序，确保菜单显示在其他所有内容的上方。 */
    z-index: 100;
}

/*
 * .controls-hidden 类选择器
 * 作用: 定义菜单在隐藏状态下的样式。
 * 目的: 通过 CSS transform 将菜单向上移动，移出可视区域，从而实现隐藏。
 */
.controls-hidden {
    /* transform: translateY(-100%);: 向上平移自身高度的100%，刚好完全移出屏幕顶部。 */
    transform: translateY(-100%);
}


/* --- 辅助样式 (Helper Styles) --- */

/*
 * .container 类选择器
 * 作用: 一个通用的容器，用于限制内容的宽度并使其居中。
 * 目的: 提高布局的复用性。
 */
.container {
    /* max-width: 800px;: 设置最大宽度，在大屏幕上不会让内容过宽。 */
    max-width: 800px;
    /* margin: 0 auto;: 外边距上下为0，左右自动，实现水平居中。 */
    margin: 0 auto;
    /* padding: 0 1rem;: 左右留出一些内边距，防止内容紧贴屏幕边缘。 */
    padding: 0 1rem;
}

/*
 * #controls h1, #controls p 选择器
 * 作用: 选中控制菜单中的 h1 标题和 p 段落。
 * 目的: 移除它们的默认外边距，让布局更紧凑。
 */
#controls h1, #controls p {
    margin: 0;
    padding: 0;
}

#controls h1 {
    /* 为标题下方添加一点间距 */
    margin-bottom: 0.5rem; 
} 

/* --- 导航样式 (Navigation Styles) --- */
.nav-container {
    display: flex; /* 使用 flexbox 布局 */
    justify-content: space-between; /* 子元素两端对齐 */
    align-items: center; /* 垂直居中 */
}

a.nav-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background-color 0.2s;
}

a.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

a.nav-link.active {
    font-weight: bold;
    color: #4ade80; /* 使用一个亮色来表示当前活动页面 */
}

/* --- 壁纸页面特定样式 (Wallpaper Page Specific Styles) --- */

/* 页面背景 */
body.bg-gray {
    background-color: #111827; /* 深灰色背景 */
    overflow-y: auto; /* 在壁纸页允许垂直滚动 */
}

/* 页面内容区域 */
.content-section {
    padding-top: 100px; /* 顶部留出空间，防止内容被固定导航栏遮挡 */
    padding-bottom: 40px;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.page-header p {
    font-size: 1.1rem;
    color: #9ca3af; /* 浅灰色文字 */
}

/* 壁纸网格布局 */
.wallpaper-grid {
    display: grid;
    /* 创建一个响应式的列布局，每列最小 280px，最大 1fr (平均分配空间) */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem; /* 网格项之间的间距 */
}

/* 壁纸卡片 */
.wallpaper-card {
    background-color: #1f2937; /* 卡片背景色 */
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #374151;
    transition: transform 0.2s, box-shadow 0.2s;
}

.wallpaper-card:hover {
    transform: translateY(-5px); /* 鼠标悬停时轻微上移 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* 壁纸预览 */
.wallpaper-preview {
    width: 100%;
    padding-top: 56.25%; /* 16:9 宽高比 (1080p / 720p) */
    background-color: #000000;
    border-radius: 4px;
    margin-bottom: 1rem;
    border: 1px solid #4b5563;
}

.wallpaper-preview.mobile-preview {
    padding-top: 190%;
    width: 50%; /* 宽度设为 50% 让它在卡片里显示为瘦长形 */
    margin-left: auto;
    margin-right: auto;
}

.wallpaper-card h3 {
    margin: 0.5rem 0;
    font-size: 1.25rem;
}

.wallpaper-card .resolution {
    color: #9ca3af;
    margin-bottom: 1rem;
}

/* 下载按钮 */
.download-btn {
    display: inline-block;
    background-color: #4ade80; /* 绿色按钮 */
    color: #111827; /* 深色文字 */
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.2s;
}

.download-btn:hover {
    background-color: #36b36a; /* 鼠标悬停时颜色变深 */
}

/* 提示信息样式 */
.notice {
    margin-top: 3rem;
    padding: 1rem;
    background-color: rgba(255, 235, 59, 0.1); /* 淡黄色背景 */
    border: 1px solid #fdec81;
    border-radius: 5px;
    text-align: center;
    color: #fdec81;
}

/* --- 睡眠页面播放器样式 (Sleep Page Player Styles) --- */

#player-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    transition: opacity 0.5s ease-in-out, visibility 0.5s;
    opacity: 1;
    visibility: visible;
}

#player-controls.player-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* 隐藏时不可交互 */
}

.sound-picker {
    display: flex;
    gap: 1rem;
}

.sound-btn {
    background-color: #1f2937;
    border: 1px solid #374151;
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.sound-btn:hover {
    background-color: #374151;
}

.sound-btn.active {
    background-color: #4ade80;
    border-color: #4ade80;
    color: #111827;
    font-weight: bold;
}

.player-core {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.control-btn {
    background: none;
    border: 2px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.control-btn:hover {
    transform: scale(1.1);
}

.control-btn svg {
    width: 28px;
    height: 28px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.volume-icon {
    color: #9ca3af;
}

/* 自定义音量滑块样式 */
#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 5px;
    background: #4b5563;
    border-radius: 5px;
    outline: none;
}

#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

#volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
}

.notice.notice-small {
    margin-top: 0;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    background: none;
    border: none;
    color: #6b7280;
}

/* --- 屏幕测试页面样式 (Screen Test Page Styles) --- */

/* 白屏背景 */
body.bg-white {
    background-color: #ffffff;
    color: #111827; /* 在白色背景上使用深色文字 */
}

/* 调整导航链接在白屏上的颜色 */
body.bg-white .nav-link {
    color: #1f2937;
}

body.bg-white .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

body.bg-white .nav-link.active {
    color: #1d4ed8; /* 在白色背景下，使用蓝色作为活动链接颜色 */
}

/* 白屏页上的提示信息 */
.screen-test-info {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: #9ca3af;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.9rem;
    pointer-events: none; /* 让鼠标可以穿透此元素 */
}

/* 白屏页面的菜单栏背景调整 */
body.bg-white #controls {
    background: rgba(255, 255, 255, 0.95); /* 白色半透明背景 */
    border-bottom: 1px solid #e5e7eb; /* 添加底部边框增加层次感 */
    backdrop-filter: blur(10px); /* 添加模糊效果 */
}

/* 红、绿、蓝纯色背景 */
.bg-red   { background-color: #ff0000; }
.bg-green { background-color: #00ff00; }
.bg-blue  { background-color: #0000ff; }

/* 调整导航链接在彩色背景上的颜色 */
body.bg-red .nav-link,
body.bg-green .nav-link,
body.bg-blue .nav-link {
    color: white; /* 在纯色背景上用白色文字 */
    text-shadow: 0 0 3px black; /* 添加一点文字阴影以增加对比度 */
}

body.bg-red .nav-link:hover,
body.bg-green .nav-link:hover,
body.bg-blue .nav-link:hover {
    background-color: rgba(0, 0, 0, 0.2);
}

body.bg-red .nav-link.active,
body.bg-green .nav-link.active,
body.bg-blue .nav-link.active {
    font-weight: bold;
    text-decoration: underline; /* 使用下划线来突出显示活动链接 */
}

/* 调整提示信息在彩色背景上的样式 */
body.bg-red .screen-test-info,
body.bg-green .screen-test-info,
body.bg-blue .screen-test-info {
    color: white;
    background-color: rgba(0, 0, 0, 0.4);
}

body.bg-blue .screen-test-info {
    color: white;
    background-color: rgba(0, 0, 0, 0.4);
}

/* --- FAQ/内容页面样式 (FAQ/Content Page Styles) --- */

.faq-section {
    max-width: 720px; /* 为获得更好的可读性，限制内容宽度 */
    margin: 0 auto; /* 居中内容区域 */
}

.faq-item {
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
}

.faq-item h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
    color: #4ade80; /* 用亮色突出问题标题 */
}

.faq-item p, .faq-item li {
    font-size: 1rem;
    line-height: 1.7; /* 增加行高以提高可读性 */
    color: #d1d5db;
}

.faq-item ul, .faq-item ol {
    padding-left: 25px;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.faq-item li {
    margin-bottom: 0.75rem;
}

.faq-item .disclaimer {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: rgba(255, 193, 7, 0.1);
    border-left: 4px solid #ffc107;
    color: #ffdda9;
    font-size: 0.9rem;
    border-radius: 0 4px 4px 0;
}

.faq-item .disclaimer strong {
    color: #ffc107;
}

/* --- AMOLED 提示样式 --- */
.amoled-notice {
    color: #9ca3af;
    font-size: 0.8rem;
    text-align: center;
    padding-top: 1rem;
    display: none; /* 默认在非主页上隐藏 */
}

/* 只在主页的 header 中显示 */
body.bg-black #controls .amoled-notice {
    display: block;
}

/* 在白屏页面中显示并调整颜色 */
body.bg-white #controls .amoled-notice {
    display: block;
    color: #4b5563; /* 在白色背景上使用深灰色文字 */
}

/* 在壁纸页的标题下方显示 */
.wallpaper-grid + .amoled-notice {
    display: block;
    margin-top: 2rem;
    padding: 0;
}

/* --- SEO Descrição (Sono) --- */
.seo-description {
    position: fixed;
    bottom: 12rem; /* 定位在播放器上方 */
    left: 0;
    right: 0;
    text-align: center;
    padding: 0 1rem;
    color: #6b7280; /* 使用比较暗的颜色，不干扰用户 */
    font-size: 0.9rem;
    max-width: 600px;
    margin: 0 auto;
    pointer-events: none; /* 让鼠标可以穿透此元素 */
    transition: opacity 0.5s, visibility 0.5s;
    opacity: 0;
    visibility: hidden;
}

/* 当播放器显示时，也显示这段描述 */
#player-controls:not(.player-hidden) + .seo-description {
    opacity: 1;
    visibility: visible;
}

/* Estilos para o menu de navegação que aparece no hover */
.nav-menu {
    padding: 1rem 2rem;
    transition: transform 0.3s ease-in-out;
}

.nav-menu.hidden {
    transform: translateY(-100%);
}

/* 
 * 新增：壁纸页面完整SEO结构样式
 * 作用：支持Hero、Features、Stats、FAQ等部分的专业布局
 * 开发者：aidaox
 * 创建时间：2024-07-28
 */

/* Hero Section - 主要价值主张区域 */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
}

.hero-description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin: 1.5rem 0 2rem 0;
    color: #e0e0e0;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    min-width: 150px;
}

.stat-item strong {
    display: block;
    font-size: 1.2rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.stat-item span {
    font-size: 0.9rem;
    color: #b0b0b0;
}

/* Features Section - 功能特性区域 */
.features-section {
    margin: 4rem 0;
}

.features-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #fff;
    font-size: 2rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.feature-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, background 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
}

.feature-card h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: #d0d0d0;
    line-height: 1.6;
}

/* Downloads Section - 下载区域优化 */
.downloads-section {
    margin: 4rem 0;
}

.downloads-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #fff;
    font-size: 2rem;
}

.wallpaper-info {
    flex: 1;
}

.wallpaper-info h3 {
    margin-bottom: 0.5rem;
}

.device-info {
    color: #b0b0b0;
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem 0;
}

.download-btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: bold;
}

/* Stats Section - 统计数据区域 */
.stats-section {
    margin: 4rem 0;
    background: rgba(255, 255, 255, 0.03);
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
}

.stats-section h2 {
    margin-bottom: 2rem;
    color: #fff;
    font-size: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-description {
    font-size: 0.9rem;
    color: #b0b0b0;
}

/* FAQ Section - 常见问题区域 */
.faq-section .faq-item {
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-section .faq-item h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.faq-section .faq-item p {
    color: #d0d0d0;
    line-height: 1.6;
    margin: 0;
}

/* Resources Section - 资源链接区域 */
.resources-section {
    margin: 4rem 0;
}

.resources-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #fff;
    font-size: 2rem;
}

.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.resource-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease;
}

.resource-card:hover {
    transform: translateY(-3px);
}

.resource-card h3 {
    color: #fff;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.resource-card p {
    color: #d0d0d0;
    line-height: 1.6;
    margin: 0;
}

.resource-card a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.resource-card a:hover {
    text-decoration: underline;
}

/* SEO Content - SEO内容区域 */
.seo-content {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border-left: 4px solid #4CAF50;
}

.seo-content p {
    color: #d0d0d0;
    line-height: 1.7;
    margin: 0;
    font-size: 1rem;
}

/* 移动端响应式优化 */
@media (max-width: 768px) {
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stat-item {
        min-width: auto;
    }
    
    .features-grid,
    .stats-grid,
    .resources-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .features-section h2,
    .downloads-section h2,
    .stats-section h2,
    .resources-section h2 {
        font-size: 1.6rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
    
    .feature-card,
    .stat-card,
    .resource-card {
        padding: 1.5rem;
    }
    
    .stats-section {
        padding: 2rem 1rem;
    }
} 