/* 页面基础样式 */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f0f5f9;
    color: #333;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
}

.intro {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

.intro h1 {
    font-size: 2rem;
    color: #0056b3;
    margin-bottom: 15px;
}

.intro p {
    font-size: 1.1rem;
    color: #555;
    margin-bottom: 25px;
}

.intro .btn {
    background-color: #0056b3;
    color: white;
    padding: 15px 30px;
    font-size: 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.intro .btn:hover {
    background-color: #004080;
}

/* 热门直播部分 */
.popular-live, .all-live {
    margin-bottom: 50px;
}

.popular-live h2, .all-live h2 {
    font-size: 1.8rem;
    color: #0056b3;
    margin-bottom: 20px;
    text-align: center;
}

.live-rooms {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
}

/* 统一直播卡片样式 */
.live-room-item {
    width: 100%;
    max-width: 280px;
    background-color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 360px;
}

.live-room-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.live-room-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 15px;
}

.live-room-item h3 {
    font-size: 1.2rem;
    color: #333;
    margin-bottom: 15px;
}

.btn {
    display: inline-block;
    background-color: #0056b3;
    color: white;
    padding: 12px 25px;
    font-size: 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: #004080;
}

/* 顶部导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #E5CCA6;
    color: white;
    padding: 15px 30px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    flex-wrap: nowrap; /* 防止换行 */
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 600;
    flex-shrink: 1;
    min-width: 0;
}

.logo img {
    width: 150px;
    height: 40px;
    object-fit: cover;
    flex-shrink: 1;
    max-width: 100%;
}

.nav-links {
    display: flex;
    gap: 30px;
    flex-shrink: 1;
    min-width: 0;
}

.nav-links a {
    text-decoration: none;
    color: white;
    font-size: 18px;
    padding: 10px 20px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    flex-shrink: 1;
}

.nav-links a:hover {
    background-color: #0056b3;
}

.user-info {
    position: relative;
    flex-shrink: 0;
    min-width: 0;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    aspect-ratio: 1 / 1; /* 确保圆形 */
    object-fit: cover;
}

.user-info-tooltip {
    display: none;
    position: absolute;
    top: 50px;
    right: 0;
    background-color: #ffffff;
    color: #333;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 200px;
}

.user-info:hover .user-info-tooltip {
    display: block;
}

.user-info-tooltip h4 {
    margin: 0;
    font-size: 16px;
    color: #007bff;
}

.user-info-tooltip p {
    margin: 5px 0;
    font-size: 14px;
}

/* 汉堡菜单（移动端） */
.hamburger {
    display: none;
    width: 30px;
    height: 22px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 0;
}

.hamburger span {
    height: 3px;
    width: 100%;
    background: #fff;
    border-radius: 3px;
    display: block;
    transition: all .25s ease;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px,5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px,-6px);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    /* 适应平板设备 */
    .navbar {
        padding: 12px 20px;
    }

    .logo img {
        width: 120px;
        height: auto;
    }

    .nav-links {
        gap: 20px;
    }

    .nav-links a {
        font-size: 16px;
    }

    .user-avatar {
        width: 35px;
        height: 35px;
    }
}

@media (max-width: 768px) {
    /* 适应手机设备 */
    .navbar {
        padding: 12px 10px;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .logo img {
        height: 30px;
        max-width: calc(100vw - 100px);
    }

    .nav-links {
        display: none;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .nav-links a {
        width: 100%;
        text-align: center;
        padding: 12px;
    }

    .user-avatar {
        width: 30px;
        height: 30px;
    }

    .hamburger {
        display: flex;
        width: 24px;
        height: 18px;
    }

    .hamburger span {
        height: 2px;
    }

    .user-info-tooltip {
        width: 180px;
        top: 45px;
    }
}

@media (max-width: 480px) {
    /* 手机小屏优化 */
    .container {
        padding: 10px;
    }

    .intro h1 {
        font-size: 1.5rem;
    }

    .intro p {
        font-size: 1rem;
    }

    .live-room-item {
        min-height: 320px;
    }

    .live-room-thumbnail {
        height: 150px;
    }

    .navbar {
        padding: 8px 5px;
        gap: 4px;
    }

    .logo img {
        height: 25px;
        max-width: calc(100vw - 70px);
    }

    .user-avatar {
        width: 25px;
        height: 25px;
    }

    .hamburger {
        width: 20px;
        height: 15px;
    }

    .hamburger span {
        height: 1.5px;
    }
}

@media (max-width: 360px) {
    .navbar {
        padding: 6px 3px;
        gap: 2px;
    }

    .logo img {
        height: 22px;
        max-width: calc(100vw - 50px);
    }

    .user-avatar {
        width: 22px;
        height: 22px;
    }

    .hamburger {
        width: 18px;
        height: 13px;
    }

    .hamburger span {
        height: 1.2px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}