/* 售后管理 - 现代化简洁风格 */

.service-wrapper {
    width: 100%;
    height: calc(100vh - 180px);
    min-height: 520px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 头部 */
.service-header {
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to right, #fafafa, #fff);
}

.service-header .title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    position: relative;
    padding-left: 12px;
}

.service-header .title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(135deg, #1890ff, #36cfc9);
    border-radius: 2px;
}

.service-header .subtitle {
    font-size: 13px;
    color: #888;
}

.service-header .subtitle span {
    color: #1890ff;
    font-weight: 500;
}

/* 主容器 */
.service-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧侧边栏 */
.service-sidebar {
    width: 280px;
    background: #fafbfc;
    border-right: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
}

.service-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.service-list::-webkit-scrollbar {
    width: 4px;
}

.service-list::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 2px;
}

/* 售后列表项 */
.service-item {
    padding: 12px;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.service-item:hover {
    border-color: #1890ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.1);
}

.service-item.active {
    border-color: #1890ff;
    background: linear-gradient(135deg, #e6f7ff, #f0faff);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.service-item.new-message::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: #ff4d4f;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

.service-item .item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.service-item .item-time {
    font-size: 12px;
    color: #999;
}

.service-item .item-status {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.service-item .item-status.pending {
    background: #e6f7ff;
    color: #1890ff;
}

.service-item .item-status.success {
    background: #f6ffed;
    color: #52c41a;
}

.service-item .item-status.refuse {
    background: #fff2f0;
    color: #ff4d4f;
}

.service-item .item-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.service-item .item-id {
    font-size: 11px;
    color: #aaa;
}

/* 空状态 */
.service-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #bbb;
}

.service-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.service-empty p {
    font-size: 13px;
}

/* 右侧主区域 */
.service-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    position: relative;
}

.service-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #fff;
}

/* 欢迎状态 */
.service-welcome {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.service-welcome i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.service-welcome p {
    font-size: 14px;
}

/* 聊天消息 */
.chat-message {
    display: flex;
    margin-bottom: 12px;
    padding: 8px 0;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message .avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

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

.chat-message .message-body {
    max-width: 70%;
    margin: 0 12px;
}

.chat-message.user .message-body {
    text-align: right;
}

.chat-message .message-header {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    font-size: 12px;
}

.chat-message.user .message-header {
    flex-direction: row-reverse;
}

.chat-message .message-header .name {
    color: #1890ff;
    font-weight: 600;
    margin: 0 6px;
}

.chat-message.user .message-header .name {
    color: #52c41a;
}

.chat-message .message-header .time {
    color: #bbb;
    font-size: 11px;
}

.chat-message .message-content {
    display: inline-block;
    max-width: 100%;
    position: relative;
    padding: 10px 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    word-break: break-word;
    background: #eef1f5;
    border: 1px solid #e3e7ee;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.chat-message.user .message-content {
    color: #333;
    font-weight: 500;
    background: #d9f2dd;
    border-color: #cde9d2;
}

.chat-message .message-content::before {
    content: "";
    position: absolute;
    top: 12px;
    left: -7px;
    width: 0;
    height: 0;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 7px solid #eef1f5;
}

.chat-message .message-content::after {
    content: "";
    position: absolute;
    top: 12px;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid #e3e7ee;
    z-index: -1;
}

.chat-message.user .message-content::before {
    left: auto;
    right: -7px;
    border-right: 0;
    border-left: 7px solid #d9f2dd;
}

.chat-message.user .message-content::after {
    left: auto;
    right: -8px;
    border-right: 0;
    border-left: 8px solid #cde9d2;
}

.chat-message .message-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.chat-message .message-images img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #f0f0f0;
    transition: all 0.2s;
}

.chat-message .message-images img:hover {
    border-color: #1890ff;
}

/* 底部回复区 */
.service-reply {
    border-top: 1px solid #f0f0f0;
    background: #fff;
    padding: 12px 16px;
}

.reply-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.reply-toolbar i {
    font-size: 20px;
    color: #888;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.reply-toolbar i:hover {
    color: #1890ff;
    background: #f0faff;
}

.reply-toolbar i.active {
    color: #1890ff;
}

.reply-toolbar .tip {
    font-size: 11px;
    color: #bbb;
}

.reply-input-wrap {
    display: flex;
    gap: 10px;
}

.reply-textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 10px 14px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.reply-textarea:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.reply-textarea::placeholder {
    color: #bbb;
}

.reply-btn {
    padding: 0 20px;
    height: 44px;
    background: linear-gradient(135deg, #1890ff, #36cfc9);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.reply-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3);
}

.reply-btn:active {
    transform: translateY(0);
}

/* 图片上传区 */
.reply-imgs {
    display: none;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed #f0f0f0;
}

.reply-imgs.show {
    display: flex;
}

.img-upload {
    width: 64px;
    height: 64px;
    border: 2px dashed #d9d9d9;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.img-upload:hover {
    border-color: #1890ff;
    background: #f0faff;
}

.img-upload i {
    font-size: 24px;
    color: #bbb;
}

.img-preview {
    width: 64px;
    height: 64px;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

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

.img-preview .remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
}

.img-preview:hover .remove {
    opacity: 1;
}

/* 兼容旧版数据结构 */
.content-list-item-right,
.content-list-item-left {
    display: flex;
    margin-bottom: 12px;
    padding: 8px 0;
}

.content-list-item-right {
    flex-direction: row-reverse;
}

.content-list-item .body {
    max-width: 70%;
    margin: 0 12px;
}

.content-list-item .top {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    font-size: 12px;
}

.content-list-item-right .top {
    flex-direction: row-reverse;
}

.content-list-item .username {
    color: #1890ff;
    font-weight: 600;
    margin: 0 6px;
}

.content-list-item-right .username {
    color: #52c41a;
}

.content-list-item .time {
    color: #bbb;
    font-size: 11px;
}

.content-list-item .data {
    padding: 10px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
    word-break: break-word;
    border-bottom: 1px solid #f0f0f0;
}

.content-list-item-right .data {
    color: #333;
    font-weight: 500;
}

.content-list-item .data .images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #eee;
}

.content-list-item .data .images .van-image {
    width: 70px;
    height: 70px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.content-list-item .data .images .van-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 响应式 */
@media (max-width: 992px) {
    .service-sidebar {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .service-sidebar {
        width: 200px;
    }

    .service-item .item-name {
        font-size: 12px;
    }
}
