/* 遮罩层：全屏半透明背景 */
.fty-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* 深色背景 */
    backdrop-filter: blur(5px); /* 毛玻璃模糊效果 */
    z-index: 99999; /* 确保在最顶层 */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1; /* 初始不透明，用于动画 */
}

/* 弹窗主体盒子 */
.fty-modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: ftySlideDown 0.4s ease-out; /* 下滑动画 */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 头部样式 */
.fty-modal-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* 渐变紫背景 */
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fty-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fty-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.fty-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.fty-close-btn:hover {
    opacity: 1;
}

/* 内容区域 */
.fty-modal-body {
    padding: 20px;
    max-height: 70vh; /* 限制最大高度 */
    overflow-y: auto; /* 允许滚动 */
}

/* 表格样式 */
.fty-data-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: 14px;
}

.fty-data-table th {
    text-align: left;
    padding: 12px;
    background-color: #f8f9fa;
    color: #555;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.fty-data-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    color: #333;
}

.fty-data-table tr:last-child td {
    border-bottom: none;
}

.fty-data-table tr:hover td {
    background-color: #f1f3f5;
}

/* 标签样式 */
.fty-tag {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* 底部按钮 */
.fty-modal-footer {
    padding: 15px 20px;
    background-color: #f8f9fa;
    text-align: right;
    border-top: 1px solid #dee2e6;
}

.fty-confirm-btn {
    background-color: #764ba2;
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.fty-confirm-btn:hover {
    background-color: #5a387e;
}

/* 动画定义 */
@keyframes ftySlideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* 表格容器：负责控制高度和滚动条 */
.fty-table-container {
    max-height: 400px; /* 【关键】最大高度，超过这个高度会出现滚动条 */
    overflow-y: auto; /* 【关键】垂直方向出现滚动条 */
    margin-top: 15px;
}

/* 表格样式 */
.fty-data-table {
    width: 100%;
    border-collapse: collapse;
    /* 保持原有样式... */
}

/* 滚动条美化（可选，让滚动条更好看） */
.fty-table-container::-webkit-scrollbar {
    width: 6px;
}

.fty-table-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

/* 药品单元格内部样式 */
.fty-goods-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    padding: 2px 0;
}

/* 药品名称链接 */
.fty-goods-link {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* 文字过长显示省略号 */
}

.fty-goods-link:hover {
    text-decoration: underline;
}

/* 药品ID样式 */
.fty-goods-id {
    font-size: 12px;
    color: #999;
    margin-top: 2px;
}

/* 时间列微调 */
.fty-time {
    font-size: 13px;
    color: #555;
}