/* 全局样式 */
:root {
    --primary-color: #ff4d4f;
    --secondary-color: #1890ff;
    --text-primary: #333;
    --text-secondary: #666;
    --background-light: #f5f5f5;
    --background-white: #fff;
    --border-color: #e8e8e8;
    --header-height: 70px; /* 统一导航栏高度变量 */
    --transition-standard: all 0.3s ease; /* 统一过渡效果 */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--background-white);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: var(--header-height); /* 避免内容被导航栏遮挡 */
}

.container {
    max-width: 1360px;
    margin: 0 auto;
}

/* 导航栏 */
.navbar {
    background-color: #2a2a2a;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); /* 添加轻微阴影增强层次感 */
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo a {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
    text-shadow: 0 0 10px rgba(255, 77, 79, 0.5);
    transition: var(--transition-standard);
}

.logo a:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 10px;
}

.nav-links a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    transition: var(--transition-standard);
    padding: 8px 15px;
    border-radius: 20px;
    position: relative;
}


.start-live-btn {
    background: linear-gradient(135deg, #ff4d4f, #ff7875);
    color: #fff !important;
    padding: 8px 20px;
    border-radius: 20px;
    transition: var(--transition-standard);
    box-shadow: 0 2px 8px rgba(255, 77, 79, 0.3);
}

.start-live-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 77, 79, 0.4);
    background: linear-gradient(135deg, #ff6b6e, #ff8a87);
}

.user-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.login-btn,
.register-btn {
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition-standard);
}

.login-btn {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.register-btn {
    background: linear-gradient(135deg, #1890ff, #40a9ff);
    color: #fff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.login-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
    background: linear-gradient(135deg, #3ca5ff, #5bb8ff);
}

/* 主要内容区 */
.main-content {
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: 28px;
    color: white;
    margin-bottom: 30px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

/* 轮播图样式 */
.banner {
    width: 100%;
    max-width: 1900px;
    margin: 0 auto;
    padding: 20px 0;
}

.banner-slider {
    width: 100%;
    max-width: 1360px;
    height: 400px;
    overflow: hidden;
    margin: 0 auto;
    position: relative;
    border-radius: 10px;
}

.slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

.slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    border-radius: 0 0 10px 10px;
    z-index: 2;
}

.slide-content h2 {
    font-size: 32px;
    margin-bottom: 10px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.5s 0.2s ease-out;
}

.slide.active .slide-content h2 {
    transform: translateY(0);
    opacity: 1;
}

.slide-content p {
    font-size: 18px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s 0.4s ease-out;
}

.slide.active .slide-content p {
    transform: translateY(0);
    opacity: 0.9;
}

.slider-controls {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 3;
}

.prev-btn,
.next-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-standard);
    opacity: 0.7;
}

.slider-controls:hover .prev-btn,
.slider-controls:hover .next-btn {
    opacity: 1;
}

.prev-btn:hover,
.next-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.slider-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 3;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: var(--transition-standard);
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* 直播卡片样式 */
.live-section {
    padding: 40px 0;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.live-card {
    background-color: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.live-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.live-preview {
    position: relative;
    padding-top: 77.25%; /* 16:9 标准比例 */
    overflow: hidden;
}

.live-preview img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.live-card:hover .live-preview img {
    transform: scale(1.05);
    
}

/* 直播状态指示器 */
.live-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-indicator::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
    animation: pulse 1.5s infinite;
}

.viewer-count {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: white;
    display: flex;
    align-items: center;
    gap: 4px;
}

.live-info {
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-grow: 1;
}

.avatar {
    width: 50px;
    height: 50px;
    overflow: hidden;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.info h3 {
    font-size: 14px;
    margin-bottom: 5px;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.info p {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 分类导航样式 */
.category-section {
    padding: 40px 0;
    background-color: #f9f9f9;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(333px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-item {
    background-color: rgb(51 50 50);
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    color: white;
    transition: var(--transition-standard);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 120px;
}

.category-item:hover {
    background-color: rgb(91 91 91);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.category-item i {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
    transition: transform 0.3s;
}

.category-item:hover i {
    transform: scale(1.1);
}

/* 页脚 */
.footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 40px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section {
    display: flex;
    flex-direction: column;
}

.footer-section h3 {
    font-size: 18px;
    color: white;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.footer-section p {
    color: #d8d8d8;
    margin-bottom: 10px;
    transition: color 0.3s;
}

.footer-section p:hover {
    color: white;
    cursor: pointer;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.social-links a {
    color: #d8d8d8;
    font-size: 20px;
    transition: var(--transition-standard);
    width: 100px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    color: white;
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    color: #d8d8d8;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

/* 动画效果 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

/* 响应式设计优化 */
@media (max-width: 1200px) {
    .live-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .banner-slider {
        height: 350px;
    }
    
    .category-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar .container {
        padding: 0 15px;
    }
    
    .logo a {
        font-size: 24px;
    }
    
    .nav-links a {
        font-size: 14px;
        padding: 6px 12px;
    }
    
    .start-live-btn,
    .login-btn,
    .register-btn {
        padding: 6px 16px;
        font-size: 13px;
    }
    
    .banner-slider {
        height: 280px;
    }
    
    .slide-content h2 {
        font-size: 24px;
    }
    
    .slide-content p {
        font-size: 16px;
    }
    
    .live-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .footer-content {
        gap: 30px;
    }
}

@media (max-width: 576px) {
    :root {
        --header-height: 60px;
    }
    
    .navbar .container {
        flex-wrap: wrap;
        height: auto;
        padding: 10px 15px;
    }
    
    .nav-links {
        order: 3;
        width: 100%;
        margin-top: 10px;
        justify-content: center;
        gap: 5px;
    }
    
    .banner-slider {
        height: 220px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .category-item {
        height: 100px;
        padding: 15px;
    }
    
    .category-item i {
        font-size: 20px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 25px;
    }
}

@media (max-width: 400px) {
    .live-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
    
    .info h3 {
        font-size: 14px;
    }
    
    .info p {
        font-size: 12px;
    }
}
