/* 通用样式 */
body {
    font-family: Arial, sans-serif;
    color: #333;
}

/* 对话列表样式 */
.conversation-item {
    display: block;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #73879C;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 4px;
}

.conversation-item:hover {
    background: #f5f7fa;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.mail_list .left {
    float: left;
    margin-right: 10px;
}

.mail_list .right {
    overflow: hidden;
}

.mail_list h3 {
    margin: 0;
    font-size: 14px;
    font-weight: normal;
}

.mail_list small {
    float: right;
    color: #BAB8B8;
    font-size: 12px;
}

/* 对话内容容器 */
#conversation-content {
    height: 70vh;
    overflow-y: scroll;
    padding: 10px;
    scrollbar-width: thin;
}

/* 美化滚动条 - Webkit浏览器 */
#conversation-content::-webkit-scrollbar {
    width: 8px;
}

#conversation-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

#conversation-content::-webkit-scrollbar-thumb {
       border-radius: 10px;
}

#conversation-content::-webkit-scrollbar-thumb:hover {
    background: #5568d3;
}

#conversation-content img {
    max-width: 200px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-top: 5px;
}

/* 消息容器 */
.user-message, .model-message {
    position: relative;
    margin: 15px 0 2px 0;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 90%;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.user-message {
    display: block;
    visibility: visible;
    background: transparent;
    border: 2px solid #667eea;
    margin-left: auto;
    text-align: left;
    color: #333333;
}

.user-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.model-message {
    background: #f5f7fa;
    border: 1px solid #e1e8ed;
    margin-right: auto;
    text-align: left;
}

.model-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* 消息中的附件区域 */
.user-message .attachment-area, .model-message .attachment-area {
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 0px;
}

.user-message .attachment-area.visible, .model-message .attachment-area.visible {
    display: flex;
}

.attachment-item {
    display: flex;
    align-items: center;
    white-space: nowrap;
    overflow: hidden;
}

.attachment-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 200px; /* 根据需要调整最大宽度 */
}


.user-message .attachment-item, .model-message .attachment-item {
    display: flex;
    align-items: center;
    background: #f0f0f0;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.user-message .attachment-item:hover, .model-message .attachment-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.user-message .attachment-item i, .model-message .attachment-item i {
    margin-right: 5px;
}

.user-message .attachment-item a, .model-message .attachment-item a {
    color: #007bff;
    text-decoration: none;
}

.user-message .attachment-item a:hover, .model-message .attachment-item a:hover {
    text-decoration: underline;
}

/* 按钮群容器 */
.message-buttons {
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s;
    margin-top: 2px;
}

.user-message + .message-buttons {
    margin-left: auto;
    max-width: 80%;
    justify-content: flex-end;
}

.model-message + .message-buttons {
    margin-right: auto;
    max-width: 80%;
    justify-content: flex-start;
}

.user-message:hover + .message-buttons,
.model-message:hover + .message-buttons,
.message-buttons:hover {
    opacity: 1;
}

.user-message p small {
    color: #666;
    font-size: 12px;
}

/* 按钮样式 */
.message-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
    color: #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.message-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* 分支切换样式 */
.branch-switch {
    display: flex;
    align-items: center;
    gap: 5px;
}

.branch-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    color: #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.branch-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.branch-btn:hover:not(:disabled) {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.branch-switch span {
    font-size: 12px;
    color: #666;
}

/* 编辑框样式 */
.edit-input {
    width: 100%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 5px;
    resize: vertical;
}

/* 调整历史对话模态框宽度 */
#history-modal .modal-dialog {
    max-width: 80%;
    width: 80%;
    margin: 30px auto;
}

/* 可选：调整modal-content的样式 */
#history-modal .modal-content {
    width: 100%;
    border-radius: 5px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    #history-modal .modal-dialog {
        width: 90%;
    }
}

@media (max-width: 576px) {
    #history-modal .modal-dialog {
        width: 95%;
    }
}

#conversation-panel {
    padding: 15px;
    width: 100%;
}

#conversation-list {
    height: 400px;
    overflow-y: auto;
    border: 1px solid #f7f7f7;
    background-color: #fff;
}

/* 云上传模态框样式 */
#cloud-data-list .data-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f7f7f7;
    cursor: pointer;
    transition: background-color 0.2s;
}

#cloud-data-list .data-item:hover {
    background-color: #f7f7f7;
}

#cloud-data-list .data-item img {
    max-width: 50px;
    max-height: 50px;
    margin-right: 10px;
    border-radius: 5px;
}

#cloud-data-list .data-item input[type="radio"] {
    margin-right: 10px;
}

#cloud-data-list .data-item span {
    font-size: 14px;
    color: #333;
}

/* 输入表单优化 */
.textarea-container {
    position: relative;
    width: 100%;
}

#multimodal-form .form-control {
    border-radius: 12px;
    border: 2px solid #e8ecf1;
    resize: none;
    height: 150px;
    width: 100%;
    box-sizing: border-box;
    padding-top: 10px;
    padding-bottom: 40px;
    padding-left: 15px;
    padding-right: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    font-size: 14px;
}

#multimodal-form .form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
    background: #ffffff;
}

#multimodal-form .attachment-area.visible + .form-control {
    padding-top: 30px;
}

#multimodal-form .attachment-area {
    position: absolute;
    top: 5px;
    left: 10px;
    right: 10px;
    display: none;
    align-items: center;
    gap: 5px;
    min-height: 20px;
}

#multimodal-form .attachment-area.visible {
    display: flex;
}

#multimodal-form .attachment-item {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 5px;
    padding: 2px 5px;
    direction: rtl;
    font-size: 12px;
}

#multimodal-form .attachment-item .remove-btn {
    cursor: pointer;
    color: #ff0000;
    margin-right: 5px;
    font-weight: bold;
}

#multimodal-form .attachment-item i {
    margin-right: 5px;
}

#multimodal-form .input-button-group {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#multimodal-form .button-group-left,
#multimodal-form .button-group-center,
#multimodal-form .button-group-right {
    display: flex;
    gap: 5px;
}

#multimodal-form .btn {
    border-radius: 8px;
    transition: all 0.3s ease;
    padding: 6px 12px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#multimodal-form .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

#multimodal-form .btn-primary {
    background: #667eea;
    border: none;
    color: #ffffff;
}

#multimodal-form .btn-primary:hover {
    background: #5568d3;
    color: #ffffff;
    opacity: 1;
}

#multimodal-form .btn i {
    margin-right: 4px;
}

/* 按钮文字样式 */
#multimodal-form .btn-text {
    display: inline;
}

/* 下拉菜单样式 */
#multimodal-form .btn-group.dropup {
    position: relative;
}

#multimodal-form .dropdown-menu {
    min-width: 100%; /* 至少与按钮宽度一致 */
    left: 0; /* 左对齐 */
    right: auto; /* 防止向右偏移 */
    margin-bottom: 0; /* 紧贴按钮上方 */
    border-radius: 5px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* 向上弹窗的阴影 */
    bottom: 100%; /* 确保菜单在按钮上方 */
    top: auto; /* 取消默认顶部定位 */
}

/* 历史对话列表中的提示文字 */
#conversation-list .text-muted {
    text-align: center;
    padding: 10px;
    color: #666;
}

#conversation-list .text-danger {
    text-align: center;
    padding: 10px;
    color: #dc3545;
}

/* 输入框和按钮对齐 */
#conversation-panel .input-group {
    margin-bottom: 10px;
}

#search-input {
    border-radius: 5px 0 0 5px;
}

#search-btn {
    border-radius: 0 5px 5px 0;
}

/* 消息片段样式 */
.snippet {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    word-wrap: break-word;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 高亮匹配关键词 */
.highlight {
    background-color: #ffff99;
    color: #333;
    padding: 1px 3px;
    border-radius: 3px;
}

/* 对话项调整 */
.conversation-item .right h3 {
    margin: 0 0 5px 0;
}

/* 加载和错误提示 */
#conversation-list .text-muted {
    text-align: center;
    padding: 10px;
    color: #666;
}

#conversation-list .text-danger {
    text-align: center;
    padding: 10px;
    color: #dc3545;
}


/* 对话列表样式 */
.conversation-item {
    display: block;
    padding: 10px;
    border-bottom: 1px solid #f7f7f7;
    text-decoration: none;
    color: #73879C;
    transition: background-color 0.2s;
    position: relative;
}

.edit-title-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #fff;
    border: 1px solid #ccc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background-color 0.2s;
    margin-left: 10px;
    vertical-align: middle;
}

.edit-title-btn:hover {
    background-color: #f0f0f0;
}

.edit-title-input {
    width: 60%;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

.save-title-btn, .cancel-title-btn {
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 5px;
    border-radius: 5px;
    cursor: pointer;
}

.save-title-btn {
    background-color: #1ABB9C;
    color: white;
    border: none;
}

.save-title-btn:hover {
    background-color: #17a689;
}

.cancel-title-btn {
    background-color: #d9534f;
    color: white;
    border: none;
}

.cancel-title-btn:hover {
    background-color: #c9302c;
}




/* 窄屏调整（手机端，宽度小于768px） */
@media (max-width: 767px) {
    /* 调整外层容器为垂直排列 */
    .x_content {
        display: flex;
        flex-direction: column;
    }

    /* 确保对话内容在上 */
    #conversation-content {
        order: -1;
        height: 50vh;
        margin-bottom: 15px;
    }

    /* 输入表单在下 */
    .form-container {
        order: 1;
    }

    /* 调整输入框高度以适应小屏幕 */
    #multimodal-form .form-control {
        height: 200px; /* 窄屏时加高 */
    }

    /* 保持按钮组为一行三列 */
    #multimodal-form .input-button-group {
        flex-direction: row;
        justify-content: space-between;
        flex-wrap: nowrap;
    }

    #multimodal-form .button-group-left,
    #multimodal-form .button-group-center,
    #multimodal-form .button-group-right {
        flex: 1;
        justify-content: center;
        gap: 2px;
    }

    /* 隐藏按钮文字，只保留图标 */
    #multimodal-form .btn-text {
        display: none;
    }

    /* 调整按钮样式以适应仅图标显示 */
    #multimodal-form .btn {
        padding: 6px;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    #multimodal-form .btn i {
        margin-right: 0;
        font-size: 16px;
    }

    /* 下拉菜单在窄屏时的调整 */
    #multimodal-form .btn-group.dropup {
        flex: 1;
    }

    #multimodal-form .dropdown-menu {
        min-width: 120px; /* 设置最小宽度，确保内容可见 */
        left: 0; /* 左对齐 */
        right: auto; /* 防止向右偏移 */
        bottom: 100%; /* 确保向上弹出 */
        top: auto;
    }

    #multimodal-form #model-dropdown {
        width: 36px;
        height: 36px;
        padding: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #multimodal-form #model-dropdown .caret {
        display: none;
    }
}

/* 超窄屏调整（小于576px） */
@media (max-width: 575px) {
    #conversation-content {
        height: 30vh;
    }

    #multimodal-form .form-control {
        height: 150px;
    }

    #multimodal-form .btn {
        width: 32px;
        height: 32px;
        padding: 4px;
    }

    #multimodal-form .btn i {
        font-size: 14px;
    }

    #multimodal-form .button-group-left,
    #multimodal-form .button-group-center,
    #multimodal-form .button-group-right {
        gap: 1px;
    }

    #multimodal-form #model-dropdown {
        width: 32px;
        height: 32px;
        padding: 4px;
    }

    #multimodal-form .dropdown-menu {
        min-width: 100px;
    }
}








#welcome-container {
    color: #666;
}
#welcome-message-llm {
    text-align: center;
}
#conversation-content.has-messages #welcome-container {
    display: none;
}

























/* 打字指示器动画 */
.typing-indicator {
    display: inline-block;
    color: #999;
    font-style: italic;
}

.typing-indicator:after {
    content: '';
    display: inline-block;
    width: 0;
    animation: typing 1.5s infinite;
}

@keyframes typing {
    0%, 50% { content: ''; }
    25% { content: '.'; }
    50% { content: '..'; }
    75% { content: '...'; }
}

/* 思考指示器 */
.thinking-indicator {
    display: inline-block;
    color: #007bff;
    font-style: italic;
    animation: thinking 2s infinite;
}

@keyframes thinking {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 打字光标效果 */
.typing-cursor {
    display: inline-block;
    background-color: #333;
    color: #333;
    animation: blink 1s infinite;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* 流式消息容器 - 继承原有的model-message样式 */
.streaming-message {
    /* 继承 .model-message 的所有样式 */
    position: relative;
    margin: 15px 0 2px 0;
    padding: 12px 18px;
    border-radius: 20px;
    max-width: 90%;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background: #f5f7fa;
    border: 1px solid #e1e8ed;
    margin-right: auto;
    text-align: left;
    transition: all 0.3s ease;

    /* 流式特有的样式 */
    opacity: 0.95;
    border-left: 3px solid #667eea;
}

.streaming-message.completed {
    opacity: 1;
    border-left: 1px solid #e1e8ed;
    transition: all 0.3s ease;
}

/* 确保流式消息中的段落样式与原有消息一致 */
.streaming-message p,
.model-message p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    word-wrap: break-word;
}

.streaming-message p:last-child,
.model-message p:last-child {
    margin-bottom: 0;
}

/* 消息淡入效果 */
.model-message,
.streaming-message {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 错误消息样式 */
.error-message {
    color: #ffffff;
    background: #ff6b6b;
    border: none;
    border-radius: 20px;
    padding: 12px 18px;
    margin: 5px 0;
    max-width: 90%;
    margin-right: auto;
    box-shadow: 0 4px 12px rgba(238, 90, 111, 0.3);
}

/* 加载状态样式 */
.loading-message {
    color: #667eea;
    font-style: italic;
    background: #f5f7fa;
    padding: 12px 18px;
    border-radius: 20px;
    border-left: 3px solid #667eea;
    max-width: 90%;
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* 流式消息中的附件区域样式 */
.streaming-message .attachment-area,
.streaming-message .attachment-area.visible {
    /* 继承原有附件样式 */
    display: none;
    align-items: center;
    gap: 5px;
    margin-top: 0px;
}

.streaming-message .attachment-area.visible {
    display: flex;
}

.streaming-message .attachment-item {
    display: flex;
    align-items: center;
    background-color: #f0f0f0;
    border-radius: 5px;
    padding: 2px 5px;
    font-size: 12px;
}

.streaming-message .attachment-item i {
    margin-right: 5px;
}

.streaming-message .attachment-item a {
    color: #007bff;
    text-decoration: none;
}

.streaming-message .attachment-item a:hover {
    text-decoration: underline;
}

/* 修复流式消息按钮组的显示 */
.streaming-message + .message-buttons,
.model-message + .message-buttons {
    margin-right: auto;
    max-width: 80%;
    justify-content: flex-start;
}

/* 确保流式消息的hover效果与原有消息一致 */
.streaming-message:hover + .message-buttons,
.model-message:hover + .message-buttons,
.message-buttons:hover {
    opacity: 1;
}

/* 流式消息完成后的样式重置 */
.streaming-message.completed {
    /* 完全恢复为普通model-message样式 */
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    opacity: 1;
}

/* 确保代码块在流式消息中正确显示 */
.streaming-message pre,
.model-message pre {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    padding: 10px;
    overflow-x: auto;
    margin: 10px 0;
}

.streaming-message code,
.model-message code {
    background-color: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* JSON代码块特殊样式 */
.streaming-message pre code,
.model-message pre code {
    background-color: transparent;
    padding: 0;
}

/* 响应式调整 */
@media (max-width: 767px) {
    .streaming-message,
    .model-message {
        max-width: 95%;
        margin-left: 5px;
        margin-right: 5px;
    }

    .streaming-message + .message-buttons,
    .model-message + .message-buttons {
        max-width: 95%;
        margin-left: 5px;
        margin-right: 5px;
    }
}

/* 确保流式消息中的图片样式一致 */
.streaming-message img,
.model-message img {
    max-width: 200px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-top: 5px;
}

/* 流式传输进度提示 */
.streaming-progress {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* 流式消息的特殊状态样式 */
.streaming-message .status-thinking {
    color: #007bff;
    font-weight: bold;
}

.streaming-message .status-generating {
    color: #28a745;
    font-weight: bold;
}

.streaming-message .status-error {
    color: #dc3545;
    font-weight: bold;
}

















/* 医学文件容器样式 */
.medical-file-container {
    border: 2px dashed #ccc;
    padding: 20px;
    margin: 10px 0;
    border-radius: 8px;
    background-color: #f9f9f9;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.medical-file-container:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.medical-file-info {
    position: relative;
}

.medical-file-actions {
    margin: 10px 0;
}

.medical-file-actions .btn {
    margin: 2px;
    border-radius: 4px;
    font-size: 0.85em;
    padding: 6px 12px;
    transition: all 0.2s ease;
}

.medical-file-actions .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 预览模态框样式 */
#medicalPreviewModal .modal-dialog {
    margin: 20px auto;
}

#medicalPreviewModal .preview-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

#medicalPreviewModal .preview-image-container img {
    transition: transform 0.3s ease;
    max-width: 100%;
    height: auto;
}

#medicalPreviewModal .zoom-hint {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#medicalPreviewModal .preview-image-container:hover .zoom-hint {
    opacity: 1;
}

/* 查看器模态框样式 */
#medicalViewerModal .modal-dialog {
    margin: 20px auto;
}

#medicalViewerModal .modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

#medicalViewerModal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
}

#medicalViewerModal .modal-body {
    padding: 0;
    background-color: #f5f5f5;
}

#medical-viewer-container {
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

/* 元数据显示样式 */
.metadata-section {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    font-size: 0.9em;
    text-align: left;
}

.metadata-section h6 {
    color: #495057;
    margin-bottom: 10px;
    font-weight: 600;
}

.metadata-section div {
    margin-bottom: 5px;
    line-height: 1.4;
}

.metadata-section strong {
    color: #343a40;
    font-weight: 600;
}

/* 查看器信息样式 */
.viewer-info {
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 8px;
    padding: 15px;
    font-size: 0.9em;
    line-height: 1.5;
}

.viewer-info p {
    margin-bottom: 8px;
}

.viewer-info p:last-child {
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .medical-file-container {
        padding: 15px;
        margin: 8px 0;
    }

    .medical-file-actions .btn {
        font-size: 0.8em;
        padding: 5px 10px;
        margin: 1px;
    }

    #medicalViewerModal .modal-dialog {
        max-width: 95vw;
        margin: 10px auto;
    }

    #medicalViewerModal .modal-content {
        height: 95vh;
    }

    #medicalViewerModal .modal-body {
        height: calc(95vh - 120px);
    }

    .metadata-section {
        padding: 10px;
        font-size: 0.85em;
    }

    .viewer-info {
        padding: 10px;
        font-size: 0.85em;
    }
}

/* 加载动画 */
.medical-file-container.loading {
    position: relative;
}

.medical-file-container.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.medical-file-container.loading::after {
    content: '\f110'; /* Font Awesome spinner */
    font-family: 'FontAwesome';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    color: #007bff;
    animation: fa-spin 1s infinite linear;
    z-index: 10;
}

/* Font Awesome 旋转动画 */
@keyframes fa-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* 文件类型图标特殊样式 */
.medical-file-container .fa-file-image-o {
    color: #28a745;
}

.medical-file-container .fa-heartbeat {
    color: #dc3545;
}

.medical-file-container .fa-file-o {
    color: #6c757d;
}

/* 按钮特殊样式 */
.medical-file-actions .btn-primary {
    background-color: #007bff;
    border-color: #007bff;
}

.medical-file-actions .btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.medical-file-actions .btn-success {
    background-color: #28a745;
    border-color: #28a745;
}

/* 模态框动画效果 */
.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.modal.show .modal-dialog {
    transform: none;
}

/* 预览图片缩放效果 */
.preview-image-container img.zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.preview-image-container img:not(.zoomed) {
    cursor: zoom-in;
}

/* 滚动条样式优化 */
#medical-viewer-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#medical-viewer-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#medical-viewer-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#medical-viewer-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 工具提示样式 */
.medical-file-container [title] {
    position: relative;
}

/* 确保模态框层级正确 */
#medicalPreviewModal,
#medicalViewerModal {
    z-index: 9999;
}

#medicalPreviewModal .modal-backdrop,
#medicalViewerModal .modal-backdrop {
    z-index: 9998;
}



















