/* ===== 聊天图片 / 文件（订单对话、世界对话、组队房间、好友私信） ===== */
.gx-chat-file-input,
input.gx-chat-file-input[type="file"] {
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    pointer-events: none !important;
    display: none !important;
}
.gx-chat-file {
    display: block;
    max-width: 100%;
    margin: 2px 0;
    white-space: normal;
    line-height: 1.5;
    word-break: break-word;
}
.gx-chat-file__img-link {
    display: inline-block;
    max-width: min(240px, 100%);
    line-height: 0;
    vertical-align: top;
    cursor: zoom-in;
}
.gx-chat-file__img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    cursor: zoom-in;
}
.gx-chat-file__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.85;
}
.gx-chat-file__act {
    font-size: 11px;
    color: inherit;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    min-height: 0;
    cursor: pointer;
}
.gx-chat-file__act.gx-chat-file__del {
    color: #ff7675;
}
.gx-chat-file--doc {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 320px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(127, 140, 160, 0.35);
    background: rgba(127, 140, 160, 0.1);
}
.gx-chat-file__icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
}
.gx-chat-file__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.gx-chat-file__name {
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}
.gx-chat-file--gone {
    display: inline-block;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px dashed rgba(127, 140, 160, 0.55);
    font-size: 12px;
    opacity: 0.85;
}
.gx-chat-file-caption {
    margin-top: 6px;
}
.gx-chat-file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-shrink: 0;
    align-self: flex-end;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px dashed rgba(244, 196, 48, 0.65);
    background: rgba(244, 196, 48, 0.08);
    color: inherit;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
.gx-chat-file-btn:hover {
    border-style: solid;
    background: rgba(244, 196, 48, 0.16);
}
.gx-chat-file-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}
.gx-chat-file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 12px 0;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(244, 196, 48, 0.45);
    background: rgba(244, 196, 48, 0.08);
    font-size: 13px;
}
.gx-chat-file-preview[hidden] {
    display: none !important;
}
.gx-chat-file-preview__thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}
.gx-chat-file-preview__icon {
    font-size: 26px;
    flex-shrink: 0;
}
.gx-chat-file-preview__info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.gx-chat-file-preview__info strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gx-chat-file-preview__info small {
    opacity: 0.75;
}
.gx-chat-file-preview__remove {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    color: inherit;
    cursor: pointer;
}
.gx-chat-file-hint {
    margin: 4px 12px 8px;
    font-size: 12px;
    line-height: 1.6;
    opacity: 0.75;
}
@media (max-width: 768px) {
    .gx-chat-file__img-link {
        max-width: min(200px, 100%);
    }
    .gx-chat-file__img {
        max-height: 220px;
    }
    .gx-chat-file--doc {
        max-width: 100%;
    }
    .gx-chat-file-btn {
        width: 100%;
    }
}

/* 图片预览层：关闭按钮 / 点遮罩 / 按 Esc */
.gx-img-preview {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 16px 20px;
    box-sizing: border-box;
    background: rgba(8, 10, 14, 0.88);
    cursor: zoom-out;
}
.gx-img-preview[hidden] { display: none !important; }
.gx-img-preview__bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    color: #f5f6fa;
}
.gx-img-preview__title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    opacity: 0.9;
}
.gx-img-preview__close {
    flex-shrink: 0;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
}
.gx-img-preview__close:hover,
.gx-img-preview__close:focus {
    background: rgba(255, 255, 255, 0.28);
    outline: none;
}
.gx-img-preview__img {
    max-width: 100%;
    max-height: calc(100vh - 88px);
    object-fit: contain;
    border-radius: 8px;
}
@media (max-width: 768px) {
    .gx-img-preview { padding: 60px 10px 16px; }
    .gx-img-preview__close { min-width: 72px; }
}


