/**
 * SAM Shortcode Styles
 * 版本：v260609
 */

/* 主容器 */
.sam-tabs-wrapper {
    margin: 30px 0;
    font-family: inherit;
}

/* Tab 头部 - 添加横向滚动支持 */
.sam-tabs-header {
    display: flex;
    flex-wrap: nowrap;           /* 禁止换行 */
    overflow-x: auto;            /* 横向滚动 */
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;  /* 苹果设备平滑滚动 */
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
    scrollbar-width: thin;       /* 细滚动条（Firefox） */
}

/* 自定义滚动条样式（Webkit浏览器：Chrome、Safari、Edge） */
.sam-tabs-header::-webkit-scrollbar {
    height: 3px;
}

.sam-tabs-header::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sam-tabs-header::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sam-tabs-header::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Tab 按钮 */
.sam-tab-btn {
    background: transparent;
    border: 1px solid #f6f6f6;
    padding: 10px 10px;
    font-size: 16px;
    font-weight: 500;
    color: #000;
    cursor: pointer;
    transition: all 0.5s ease;
    position: relative;
    margin-right: 5px;
    white-space: nowrap;         /* 按钮文字不换行 */
    flex-shrink: 0;              /* 防止按钮被压缩 */
}

.sam-tab-btn:hover {
    color: #fff;
    background-color: #000;
}

.sam-tab-btn.active {
    color: #000000;
    font-weight: bold;
    background: #eeeeee;
}

.sam-tab-btn.active:hover {
    font-weight: bold;
    background-color: #eeeeee;
}

.sam-tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: #000000;
    border-radius: 2px;
}

/* Tab 内容区域 */
.sam-tabs-content {
    position: relative;
    min-height: 500px;
}

.sam-tab-pane {
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sam-tab-pane.active {
    display: block;
    opacity: 1;
}

/* PDF iframe */
.sam-tab-pane iframe {
    width: 100%;
    height: 850px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 加载状态 */
.sam-tab-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
}

.sam-loading-spinner {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    color: #6b7280;
    font-size: 14px;
}

.sam-loading-spinner::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: sam-spin 0.8s linear infinite;
}

@keyframes sam-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 错误状态 */
.sam-tab-pane .sam-error-message {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 500px;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
}

/* 普通内容 */
.sam-tab-content {
    padding: 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 5px;
    min-height: 300px;
}

/* 响应式 - 移动端优化 */
@media (max-width: 768px) {
    .sam-tab-btn {
        padding: 8px 14px;
        font-size: 14px;
    }
    
    .sam-tab-pane iframe {
        height: 400px;
    }
    
    .sam-tab-loader {
        min-height: 400px;
    }
}