/* Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;
    background-color: #f7f8fa;
}

[v-cloak] {
    display: none;
}

.layer {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
}

/* Music Layer Styles */
.music-layer {
    background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
    color: #333;
}

.music-header {
    padding-top: 44px; /* Safe area top simulation */
}

.music-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.album-cover-container {
    width: 280px;
    height: 280px;
    position: relative;
    margin-bottom: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
    border-radius: 50%;
    padding: 10px;
    background: rgba(255,255,255,0.2);
}

.album-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    animation: rotate 20s linear infinite;
    animation-play-state: paused;
}

.album-cover.playing {
    animation-play-state: running;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.center-hole {
    width: 40px;
    height: 40px;
    background: #e0c3fc;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255,255,255,0.5);
}

.song-info {
    text-align: center;
    margin-bottom: 40px;
}

.song-info h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.song-info p {
    font-size: 16px;
    color: #666;
}

.progress-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.time {
    font-size: 12px;
    color: #666;
    font-variant-numeric: tabular-nums;
}

.controls {
    display: flex;
    align-items: center;
    gap: 40px;
}

.controls i {
    font-size: 32px;
    color: #333;
    cursor: pointer;
}

.play-btn {
    width: 70px;
    height: 70px;
    background: #333;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.play-btn i {
    color: #fff;
    font-size: 36px;
    margin-left: 4px; /* Optical adjustment for play icon */
}
.play-btn i.ri-pause-fill {
    margin-left: 0;
}

/* Chat Layer Styles */
.chat-layer {
    background-color: #ededed;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message-item {
    display: flex;
    gap: 10px;
    max-width: 80%;
}

.message-item.me {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-content {
    display: flex;
    flex-direction: column;
    max-width: 100%;
}

.msg-time {
    font-size: 9px;
    color: #ccc;
    margin-top: 2px;
    padding: 0 4px;
    line-height: 1;
}

.message-item.me .msg-time {
    text-align: right;
}

.avatar {
    width: 40px;
    height: 40px;
    background: #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}

.message-item.me .avatar {
    background: #95ec69; /* Wechat green */
    color: #000;
}

.bubble {
    padding: 10px 14px;
    background: #fff;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1.4;
    position: relative;
    word-break: break-all;
}

.message-item.me .bubble {
    background: #95ec69;
}

.chat-input-area {
    background: #fff; /* 改为纯白背景，更干净 */
    padding: 10px 15px; /* 增加左右间距 */
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #f0f0f0; /* 更淡的分割线 */
    box-shadow: 0 -2px 10px rgba(0,0,0,0.03); /* 增加顶部轻微阴影，更有层次感 */
    /* 适配底部安全区 */
    padding-bottom: max(10px, env(safe-area-inset-bottom)); 
}

.input-wrapper {
    flex: 1;
    display: flex;
    background: #f5f5f5; /* 输入框背景 */
    border-radius: 20px; /* 大圆角 */
    padding: 0 5px;
}

.chat-input-area input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 15px;
    color: #333;
    line-height: 20px;
}

.send-btn {
    background: #95ec69; /* 微信绿 */
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    color: #fff;
    font-weight: 500;
    font-size: 14px;
    transition: opacity 0.2s;
    height: 36px; /* 固定高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:disabled {
    background: #e0e0e0;
    color: #aaa;
    opacity: 1;
}

.send-btn:active {
    opacity: 0.8;
}

/* Multimedia Messages */
.msg-img {
    max-width: 150px;
    border-radius: 4px;
}
.msg-video {
    max-width: 200px;
    border-radius: 4px;
}
.msg-audio {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    min-width: 80px;
}

/* Sticker Panel */
.sticker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
    height: calc(100% - 54px);
}
.sticker-item img {
    width: 100%;
    height: 80px;
    object-fit: contain;
}

/* Video Call UI */
.video-call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}
.remote-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.local-video {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 100px;
    height: 150px;
    background: #333;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    z-index: 10000;
}
.call-controls {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 40px;
    z-index: 10000;
}
.hangup-btn {
    width: 60px;
    height: 60px;
    background: #ff4d4f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}
.msg-call {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #1989fa;
    cursor: pointer;
    font-weight: 500;
}
