/* 全局样式重置 */ * { margin: 0; padding: 0; box-sizing: border-box; scrollbar-color: #000000 #000000; scrollbar-width: auto; } body { font-family: 'Roboto', Arial, sans-serif; background-color: #121212; color: #ffffff; } /* 主容器 */ .youtube-container { display: flex; flex-direction: column; height: 100vh; overflow: hidden; } /* 顶栏样式 */ .header { display: flex; align-items: center; justify-content: space-between; padding: 0 16px; height: 56px; background-color: #000000; border-bottom: 1px solid #303030; position: sticky; top: 0; z-index: 100; } .header-left { display: flex; align-items: center; } .menu-btn { background: none; border: none; font-size: 24px; padding: 8px; margin-right: 16px; cursor: pointer; color: #909090; } .youtube-logo img { height: 20px; } .header-center { display: flex; align-items: center; flex: 1; max-width: 640px; margin: 0 40px; } .search-container { display: flex; align-items: center; width: 100%; } .search-input { flex: 1; height: 40px; padding: 0 16px; border: 1px solid #404040; border-radius: 20px 0 0 20px; font-size: 16px; outline: none; transition: all 0.3s ease; background-color: #121212; color: #ffffff; } .search-input:focus { border-color: #1a73e8; box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2); } .search-btn { height: 40px; padding: 0 20px; background-color: #303030; border: 1px solid #404040; border-left: none; border-radius: 0 20px 20px 0; cursor: pointer; color: #909090; } .search-btn:hover { background-color: #404040; } .voice-search-btn { margin-left: 8px; height: 40px; width: 40px; border-radius: 50%; background-color: #303030; border: none; cursor: pointer; color: #909090; } .voice-search-btn:hover { background-color: #404040; } .header-right { display: flex; align-items: center; } .create-btn { display: flex; align-items: center; background: none; border: none; padding: 8px 16px; margin-right: 16px; cursor: pointer; color: #909090; font-size: 14px; } .create-btn i { margin-right: 4px; font-size: 20px; } .notification-btn { background: none; border: none; padding: 8px; margin-right: 16px; cursor: pointer; color: #909090; font-size: 20px; } .profile-btn { background: none; border: none; padding: 8px; cursor: pointer; color: #909090; font-size: 20px; } /* 主内容区 */ .main-content { display: flex; flex: 1; overflow: hidden; } /* 侧边栏样式 */ .sidebar { width: 240px; background-color: #000000; border-right: 1px solid #303030; overflow-y: auto; flex-shrink: 0; transition: width 0.3s ease, transform 0.3s ease, opacity 0.3s ease; } .sidebar.collapsed { width: 0; transform: translateX(-100%); opacity: 0; overflow: hidden; } .sidebar-nav { padding: 12px 0; } .nav-section { margin-bottom: 24px; } .nav-section-title { display: flex; align-items: center; justify-content: space-between; padding: 0 24px 8px; font-size: 14px; font-weight: 500; color: #606060; text-transform: uppercase; } .nav-btn { display: flex; align-items: center; width: 100%; padding: 8px 24px; background: none; border: none; text-align: left; cursor: pointer; font-size: 14px; color: #ffffff; transition: background-color 0.2s ease; } .nav-btn:hover { background-color: rgba(255, 255, 255, 0.1); } .nav-btn.active { background-color: rgba(255, 255, 255, 0.15); font-weight: 500; } .nav-btn i { margin-right: 16px; font-size: 20px; width: 24px; } .subscriptions-list { padding: 0 12px; } .subscription-item { display: flex; align-items: center; padding: 8px 12px; cursor: pointer; border-radius: 8px; transition: background-color 0.2s ease; } .subscription-item:hover { background-color: rgba(255, 255, 255, 0.1); } .subscription-avatar { width: 24px; height: 24px; border-radius: 50%; margin-right: 12px; background-color: #e0e0e0; overflow: hidden; } .subscription-avatar img { width: 100%; height: 100%; object-fit: cover; } .subscription-name { font-size: 14px; color: #ffffff; } .sidebar-footer { padding: 16px 24px; font-size: 12px; color: #909090; border-top: 1px solid #303030; } /* 视频内容区 */ .video-content { flex: 1; overflow-y: auto; padding: 24px; background-color: #121212; } /* 板块按钮 */ .category-buttons { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; } .category-btn { padding: 8px 16px; background-color: #303030; border: 1px solid #404040; border-radius: 20px; cursor: pointer; font-size: 14px; font-weight: 500; color: #ffffff; transition: all 0.2s ease; } .category-btn:hover { background-color: #404040; } .category-btn.active { background-color: #ffffff; color: #121212; border-color: #ffffff; } /* 视频网格 */ .video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(550px, 1fr)); gap: 24px; margin-bottom: 48px; } /* 视频卡片 */ .video-card { background-color: #202020; border-radius: 12px; transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; position: static; } .video-thumbnail { overflow: hidden; border-radius: 12px 12px 0 0; } .video-menu { position: relative; z-index: 100; } .video-card:hover { transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); } .video-thumbnail { position: relative; width: 100%; padding-top: 56.25%; /* 16:9 比例 */ background-color: #303030; } .video-thumbnail img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; } .video-duration { position: absolute; bottom: 8px; right: 8px; background-color: rgba(0, 0, 0, 0.8); color: white; font-size: 12px; padding: 2px 6px; border-radius: 4px; } .video-info { display: flex; padding: 16px; } .video-channel-avatar { width: 48px; height: 48px; border-radius: 50%; margin-right: 16px; background-color: #e0e0e0; display: flex; align-items: center; justify-content: center; } .avatar-img { font-size: 20px; color: #666; } .video-details { flex: 1; min-width: 0; } .video-title { font-size: 16px; font-weight: 500; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; color: #ffffff; } .video-meta { font-size: 14px; color: #909090; line-height: 1.4; } .video-channel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; display: flex; gap: 8px; } .video-menu { position: relative; } .menu-toggle { background: none; border: none; padding: 8px; cursor: pointer; color: #909090; font-size: 16px; opacity: 0; transition: opacity 0.2s ease; } .video-card:hover .menu-toggle { opacity: 1; } .menu-dropdown { position: absolute; top: 100%; right: 0; background-color: #202020; border: 1px solid #303030; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); padding: 8px 0; min-width: 200px; z-index: 1000; display: none; } .menu-dropdown.show { display: block; } .menu-item { display: flex; align-items: center; padding: 8px 16px; cursor: pointer; font-size: 14px; color: #ffffff; transition: background-color 0.2s ease; } .menu-item:hover { background-color: #303030; } .menu-item i { margin-right: 12px; font-size: 16px; color: #909090; } /* Shorts 部分 */ .shorts-section { margin-top: 48px; } .shorts-section h3 { font-size: 25px; font-weight: 500; margin-bottom: 16px; color: #ffffff; } .shorts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(450px, 1fr)); gap: 20px; } /* Shorts 卡片 */ .shorts-card { position: relative; width: 100%; padding-top: 177.78%; /* 9:16 比例 */ background-color: #303030; border-radius: 12px; overflow: hidden; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; } .shorts-card:hover { transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); } .shorts-thumbnail { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .shorts-thumbnail img { width: 100%; height: 100%; object-fit: cover; } .shorts-info { position: absolute; bottom: 0; left: 0; right: 0; padding: 12px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.8)); color: white; } .shorts-title { font-size: 14px; font-weight: 500; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .shorts-stats { font-size: 12px; display: flex; align-items: center; gap: 8px; } .shorts-stats i { margin-right: 4px; } /* 搜索结果弹窗 */ .search-results { position: fixed; top: 56px; left: 50%; transform: translateX(-55%); width: 100%; max-width: 640px; background-color: #202020; border-bottom: 1px solid #303030; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); z-index: 99; max-height: 80vh; overflow-y: auto; } .search-results-content { padding: 16px; } .search-result-item { display: flex; align-items: flex-start; padding: 12px; cursor: pointer; border-radius: 8px; transition: background-color 0.2s ease; margin-bottom: 8px; } .search-result-item:hover { background-color: #303030; } .search-result-thumbnail { width: 120px; height: 68px; border-radius: 8px; margin-right: 16px; background-color: #303030; flex-shrink: 0; } .search-result-thumbnail img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; } .search-result-details { flex: 1; min-width: 0; } .search-result-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; white-space: normal; color: #ffffff; } .search-result-channel { font-size: 12px; color: #909090; margin-bottom: 2px; } .search-result-stats { font-size: 12px; color: #909090; } .highlight { background-color: #3d3d29; font-weight: 500; color: #ffffff; } /* 响应式设计 */ @media (max-width: 1600px) { .video-grid { grid-template-columns: repeat(auto-fill, minmax(500px, 1fr)); gap: 24px; } } @media (max-width: 1200px) { .video-grid { grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 20px; } } @media (max-width: 992px) { .sidebar { width: 200px; } .video-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; } } @media (max-width: 768px) { .sidebar { display: none; } .header-center { margin: 0 16px; } .create-btn span { display: none; } .video-content { padding: 16px; } .video-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; } .shorts-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; } } @media (max-width: 576px) { .header-center { display: none; } .video-grid { grid-template-columns: 1fr; } .shorts-grid { grid-template-columns: repeat(4, 1fr); } } /* 滚动条样式 - Webkit浏览器 */ ::-webkit-scrollbar { width: 12px; height: 12px; } ::-webkit-scrollbar-track { background-color: #000000; } ::-webkit-scrollbar-thumb { background-color: #000000; border-radius: 6px; } ::-webkit-scrollbar-thumb:hover { background-color: #000000; }