#chat-area.section.is-active {
    align-items: stretch;
    justify-content: center;
    padding: 24px 16px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f2f6ff 0%, #f5f5f5 100%);
    min-height: 100vh;
}

.chat-page {
    width: min(1100px, 100%);
    height: 100vh;
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.chat-shell {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(30, 144, 255, 0.12);
    overflow: hidden;
    border: 1px solid rgba(30, 144, 255, 0.1);
    position: relative;
}

.message-area {
    flex: 1;
    overflow: hidden;
    background: #f7f9fd;
    padding-bottom: 96px;
}

.message-list {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 20px 120px;
}

.message-list .ql-container.ql-snow {
    border: none;
}

.message-list .ql-editor {
    padding: 0;
    font-size: 14px;
    line-height: 1.5;
}

.loading-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 120px;
    color: #999;
    font-size: 14px;
    flex-direction: column;
    gap: 8px;
}

.loading-container::before {
    content: '';
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #1e90ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.message-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.load-more {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.load-more-btn {
    background: transparent;
    border: none;
    color: #1e90ff;
    font-size: 13px;
    cursor: pointer;
}

.load-more-btn:hover {
    color: #0066cc;
}

.message-item {
    display: flex;
    flex-direction: column;
}

.customer-message {
    align-self: flex-end;
    max-width: 90%;
}

.customer-message .message-content {
    background-color: #1e90ff;
    color: white;
    border-radius: 18px 4px 18px 18px;
    word-wrap: break-word;
    position: relative;
    box-shadow: 0 8px 18px rgba(30, 144, 255, 0.18);
}

.customer-message .message-time {
    text-align: right;
    font-size: 12px;
    color: #8a96a8;
    margin-top: 4px;
}

.sending-status {
    color: #1e90ff;
    margin-left: 8px;
    font-size: 11px;
}

.servicer-message {
    align-self: flex-start;
    max-width: 75%;
}

.servicer-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.servicer-avatar {
    flex-shrink: 0;
    margin-top: 2px;
}

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e7f0ff;
    color: #1e90ff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.servicer-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.servicer-nickname {
    font-size: 13px;
    color: #5c6b82;
    font-weight: 600;
    margin-bottom: 2px;
}

.servicer-message .message-content {
    background-color: white;
    color: #333;
    border-radius: 4px 18px 18px 18px;
    word-wrap: break-word;
    position: relative;
    border: 1px solid #e5ecf5;
    box-shadow: 0 6px 14px rgba(21, 61, 121, 0.06);
}

.servicer-message .message-time {
    text-align: left;
    font-size: 12px;
    color: #8a96a8;
    margin-top: 4px;
}

.recalled-message {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 8px;
}

.text-content {
    max-width: 420px;
    padding: 10px;
}

.message-border {
    border-radius: 4px 18px 18px 18px;
}

.user-content {
    padding: 0;
}

.normal-text {
    padding: 12px 15px;
    display: block;
    line-height: 1.5;
    font-size: 14px;
}

.keyword-content {
    text-align: left;
    padding: 12px 14px;
    min-width: 240px;
    border: 1px solid #e0e0e0;
    border-radius: 4px 18px 18px 18px;
    background: #fafcff;
}

.keyword-title {
    font-size: 13px;
    color: #4a5c7a;
    font-weight: 600;
    margin-bottom: 8px;
}

.keyword-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keyword-item {
    padding: 8px 10px;
    color: #1e90ff;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 8px;
    background: rgba(30, 144, 255, 0.06);
}

.keyword-item:hover {
    color: #0066cc;
    background: rgba(30, 144, 255, 0.12);
}

.audio-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 18px;
    min-width: 80px;
    max-width: 200px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
    background-color: #f7f9fd;
}

.audio-message.is-customer {
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.audio-message.is-playing {
    box-shadow: 0 4px 12px rgba(30, 144, 255, 0.2);
}

.audio-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-icon {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
}

.voice-icon .wave {
    width: 3px;
    background: #1e90ff;
    border-radius: 2px;
    height: 6px;
    opacity: 0.6;
}

.audio-message.is-playing .wave {
    animation: voiceWave 1s ease-in-out infinite;
}

.audio-message.is-playing .wave2 {
    animation-delay: 0.2s;
}

.audio-message.is-playing .wave3 {
    animation-delay: 0.4s;
}

.audio-duration {
    font-size: 12px;
    color: #3b4a63;
}

.unread-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ff4d4f;
}

.video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 150px;
    background: #e6eef8;
    color: #4a5c7a;
    font-size: 13px;
}

.media-wrapper {
    position: relative;
    width: 280px;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background-color: #fff;
    transition: all 0.2s ease;
}

.media-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.fixed-media {
    width: 100%;
    height: auto;
    border: none;
    outline: none;
    border-radius: 8px;
    display: block;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.2s ease;
}

.media-wrapper:hover .play-icon {
    background-color: rgba(0, 0, 0, 0.8);
    transform: translate(-50%, -50%) scale(1.1);
}

.video-player-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.video-player-overlay.is-hidden {
    display: none;
}

.video-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.video-element {
    max-width: 80vw;
    max-height: calc(70vh - 80px);
    width: auto;
    height: auto;
    border-radius: 8px;
    background: #000;
    object-fit: contain;
}

.video-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

.image-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.image-preview-overlay.is-hidden {
    display: none;
}

.image-preview-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
    background: #000;
}

.image-close {
    position: absolute;
    top: -12px;
    right: -12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

@keyframes voiceWave {
    0%, 100% { height: 6px; opacity: 0.5; }
    50% { height: 16px; opacity: 1; }
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
}

.input-area {
    flex-shrink: 0;
    background-color: white;
    border-top: 1px solid #e6edf6;
    padding: 12px 16px 16px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1100px, 100%);
    box-sizing: border-box;
    z-index: 20;
}

.chat-input {
    background-color: white;
    border-radius: 20px;
    padding: 8px 12px;
    min-height: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #e5ecf5;
}

.input-left,
.input-right {
    flex-shrink: 0;
}

.file-input {
    display: none;
}

.icon-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f5ff;
    color: #1e90ff;
    font-size: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.input-center {
    flex: 1;
    min-width: 0;
}

.chat-textarea {
    width: 100%;
    border: none;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    background: transparent;
    line-height: 1.4;
    min-height: 24px;
}

.send-button {
    border: none;
    background: #1e90ff;
    color: #fff;
    border-radius: 18px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    #chat-area.section.is-active {
        padding: 0;
        min-height: 100vh;
    }

    .chat-page {
        height: 100vh;
        min-height: 100vh;
    }

    .chat-shell {
        border-radius: 0;
        border: none;
    }

    .message-list {
        padding: 16px 14px 120px;
    }

    .text-content {
        max-width: 280px;
    }

    .input-area {
        width: 100%;
        border-radius: 0;
    }
}
