/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background-color: #121212;
    color: #ffffff;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 顶部导航 */
.header {
    background-color: #1a1a1a;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 10px;
}

.search {
    display: flex;
    align-items: center;
    background-color: #333;
    border-radius: 20px;
    padding: 5px 10px;
}

.search input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px;
    outline: none;
}

.search button {
    background-color: #ff4757;
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 14px;
}

/* 分类筛选 */
.category {
    display: flex;
    overflow-x: auto;
    background-color: #1a1a1a;
    padding: 10px 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex: 0 0 auto;
    padding: 8px 16px;
    margin: 0 5px;
    border-radius: 20px;
    font-size: 14px;
    background-color: #333;
    color: #ccc;
    transition: all 0.3s;
}

.category-item.active {
    background-color: #ff4757;
    color: white;
}

/* 直播列表 */
.live-list {
    padding: 15px;
}

.live-item {
    background-color: #1a1a1a;
    border-radius: 10px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.live-cover {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.live-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-status {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #ff4757;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.live-viewers {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.live-info {
    padding: 10px;
}

.live-anchor {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.anchor-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.anchor-name {
    font-size: 14px;
    font-weight: 500;
}

.live-title {
    font-size: 13px;
    color: #ccc;
    line-height: 1.4;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #1a1a1a;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #ccc;
    text-decoration: none;
    font-size: 12px;
    transition: all 0.3s;
}

.nav-item.active {
    color: #ff4757;
}

.nav-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.live-btn {
    background-color: #ff4757;
    color: white;
    padding: 10px;
    border-radius: 50%;
    margin-bottom: -20px;
    box-shadow: 0 2px 10px rgba(255, 71, 87, 0.5);
}

.live-btn .nav-icon {
    font-size: 24px;
}

/* 直播间样式 */
.live-room {
    position: relative;
    height: 100vh;
    background-color: #000;
}

.live-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-room-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.room-info {
    display: flex;
    align-items: center;
}

.room-anchor-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #ff4757;
    margin-right: 10px;
}

.room-anchor-name {
    font-size: 16px;
    font-weight: 600;
}

.room-viewers {
    font-size: 14px;
    color: #ccc;
}

.room-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

/* 聊天区域 */
.chat-area {
    position: absolute;
    bottom: 100px;
    left: 0;
    right: 0;
    height: 200px;
    overflow-y: auto;
    padding: 10px;
}

.chat-message {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

.chat-content {
    background-color: rgba(0, 0, 0, 0.6);
    padding: 8px 12px;
    border-radius: 15px;
    max-width: 70%;
}

.chat-username {
    font-size: 12px;
    color: #ff4757;
    margin-bottom: 2px;
}

.chat-text {
    font-size: 14px;
    color: white;
}

/* 礼物面板 */
.gift-panel {
    position: absolute;
    bottom: 60px;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px;
    display: none;
}

.gift-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.gift-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gift-image {
    width: 50px;
    height: 50px;
    margin-bottom: 5px;
}

.gift-name {
    font-size: 12px;
    color: #ccc;
}

.gift-price {
    font-size: 11px;
    color: #ff4757;
}

/* 发送消息区域 */
.message-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 10px;
    display: flex;
    align-items: center;
}

.message-input {
    flex: 1;
    background-color: #333;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    color: white;
    outline: none;
}

.send-btn {
    background-color: #ff4757;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    margin-left: 10px;
}

/* 个人中心 */
.profile {
    padding: 20px;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-right: 20px;
}

.profile-info h2 {
    font-size: 18px;
    margin-bottom: 5px;
}

.profile-info p {
    font-size: 14px;
    color: #ccc;
}

.profile-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background-color: #1a1a1a;
    border-radius: 10px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #ff4757;
}

.stat-label {
    font-size: 12px;
    color: #ccc;
    margin-top: 2px;
}

.profile-menu {
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
}

.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #333;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item span {
    font-size: 14px;
}

.menu-item .arrow {
    color: #666;
    font-size: 16px;
}

/* 登录/注册页面 */
.login-container {
    padding: 40px 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 24px;
    color: #ff4757;
    margin-bottom: 10px;
}

.login-form {
    flex: 1;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #ccc;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background-color: #333;
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    outline: none;
}

.form-group button {
    width: 100%;
    padding: 12px;
    background-color: #ff4757;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 600;
}

.form-group .code-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
    margin-left: 10px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #666;
}

.login-footer a {
    color: #ff4757;
    text-decoration: none;
}

/* 响应式设计 */
@media (min-width: 375px) {
    .live-cover {
        height: 250px;
    }
}

@media (min-width: 414px) {
    .live-cover {
        height: 280px;
    }
}

/* 动画效果 */
@keyframes giftAnimation {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.gift-animation {
    animation: giftAnimation 0.5s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff4757;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}
