/* 自定义工具类 */
/* 标签切换样式 */
.tab-item {
    position: relative;
    cursor: pointer;
    transition: color 0.3s ease;
}

.tab-item:hover {
    color: #2D7FF9;
}

.tab-active {
    color: #2D7FF9;
    font-weight: 500;
}

.tab-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #2D7FF9;
    border-radius: 3px;
}

/* 导航项样式 */
.nav-item {
    display: inline-block;
    padding: 6px 12px;
    margin-right: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #ffffff;
    border-radius: 4px;
}

.nav-item:hover {
    background-color: #e6edff;
}

.nav-item.active {
    background-color: #e6edff;
    color: #2D7FF9;
    font-weight: 500;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* 产品列表样式 */
.product-item {
    transition: background-color 0.3s ease;
    padding-left: 16px !important; /* 移除额外左边距，使用正常内边距 */
}

.product-list-container {
    padding-left: 0; /* 移除容器左边距 */
    position: relative;
    overflow: hidden;
    height: 100%; /* 确保容器有固定高度 */
}

.product-list {
    height: 100%;
    overflow-y: auto;
    margin-left: 0;
}

/* 确保字母索引固定在左侧 */
.alphabet-index {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 25px;
    z-index: 20;
    background-color: white;
    border-right: 1px solid #E5E5E5;
}

.product-group-header {
    padding-left: 16px !important; /* 移除字母分组标题的额外左边距 */
}

.product-item:hover {
    background-color: rgba(45, 127, 249, 0.15);
}

.product-item.product-item-search-active {
    background-color: rgba(45, 127, 249, 0.2);
    border-left: 4px solid #2D7FF9;
}

/* 搜索框样式优化 */
#search-input:focus {
    box-shadow: 0 0 0 2px rgba(45, 127, 249, 0.3);
}

/* 字母索引样式 */
.alphabet-item {
    cursor: pointer;
    padding: 2px 5px;
    transition: all 0.2s ease;
    border-radius: 2px;
}

.alphabet-item:hover {
    background-color: #2D7FF9;
    color: white;
    transform: scale(1.2);
}

.alphabet-item.active {
    background-color: #2D7FF9;
    color: white;
    font-weight: bold;
}

/* 筛选按钮样式 */
.filter-btn {
    padding: 6px 12px;
    margin-right: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

/* 筛选按钮基本样式 - 移除边框 */
.filter-btn {
    border: none;
    background-color: #ffffff;
    color: #4b5563;
}
.filter-btn:hover {
    background-color: #e6edff;
    color: #2D7FF9;
}
.filter-btn.active {
    background-color: #e6edff;
    color: #2D7FF9;
    font-weight: 500;
}
.filter-btn.active:hover {
    background-color: #bae7ff;
}

/* 供应商详情样式 */
.supplier-detail-card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 相关产品卡片样式 */
.related-product-card {
    min-height: 200px;
}

.related-product-card img {
    min-height: 160px;
    max-height: 160px;
}

.supplier-detail-header {
    background-color: #f8fafc;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.supplier-detail-body {
    padding: 16px;
}

.supplier-detail-item {
    margin-bottom: 12px;
}

.supplier-detail-label {
    font-weight: 500;
    color: #4b5563;
    margin-right: 8px;
}

.supplier-detail-value {
    color: #1f2937;
}

/* 产品详情样式 */
.product-detail-card {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.product-detail-header {
    background-color: #f8fafc;
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.product-detail-body {
    padding: 16px;
}

.product-detail-item {
    margin-bottom: 12px;
}

.product-detail-label {
    font-weight: 500;
    color: #4b5563;
    margin-right: 8px;
}

.product-detail-value {
    color: #1f2937;
}

/* 响应式设计 */
@media (max-width: 640px) {
    .product-item {
        padding: 12px 8px;
    }
    
    .filter-btn {
        margin-bottom: 8px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #2D7FF9;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 卡片阴影效果 */
.card-shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.3s ease;
}

.card-shadow:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 平滑过渡动画 */
.smooth-transition {
    transition: all 0.3s ease;
}

/* 文本截断 */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 多行文本截断 */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 居中工具类 */
.center-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 按钮通用样式 */
.btn {
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: #2D7FF9;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #1E6AE8;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-outline {
    background-color: transparent;
    border: 1px solid #2D7FF9;
    color: #2D7FF9;
}

.btn-outline:hover {
    background-color: #2D7FF9;
    color: white;
}

/* 表单元素样式 */
.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.form-control:focus {
    outline: none;
    border-color: #2D7FF9;
    box-shadow: 0 0 0 2px rgba(45, 127, 249, 0.25);
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.table th {
    background-color: #f8fafc;
    font-weight: 500;
    color: #4b5563;
}

.table tr:hover {
    background-color: #f8fafc;
}

/* 模态框样式 */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    padding: 16px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 18px;
    font-weight: 500;
    color: #1f2937;
}

.modal-body {
    padding: 16px;
}

.modal-footer {
    padding: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 面包屑导航 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #1f2937;
    font-weight: 500;
}

.breadcrumb-separator {
    color: #6c757d;
}

/* 徽章样式 */
.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background-color: #2D7FF9;
    color: white;
}

.badge-success {
    background-color: #10B981;
    color: white;
}

.badge-warning {
    background-color: #F59E0B;
    color: white;
}

.badge-danger {
    background-color: #EF4444;
    color: white;
}

/* 标签样式 */
.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.tag-primary {
    background-color: rgba(45, 127, 249, 0.1);
    color: #2D7FF9;
}

.tag-secondary {
    background-color: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

/* 提示框样式 */
.alert {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 16px;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-danger {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

/* 进度条样式 */
.progress {
    width: 100%;
    height: 8px;
    background-color: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #2D7FF9;
    transition: width 0.3s ease;
}

/* 分隔线样式 */
.divider {
    height: 1px;
    background-color: #e2e8f0;
    margin: 16px 0;
}

/* 悬停效果 */
.hover-lift {
    transition: transform 0.2s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
}

/* 焦点样式 */
.focus-ring:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(45, 127, 249, 0.25);
}

/* 禁用状态 */
.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* 网格系统辅助类 */
.grid-cols-2-sm {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3-md {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4-lg {
    grid-template-columns: repeat(4, 1fr);
}

/* 间距辅助类 */
.gap-sm {
    gap: 8px;
}

.gap-md {
    gap: 16px;
}

.gap-lg {
    gap: 24px;
}

/* 文本样式 */
.text-primary {
    color: #2D7FF9;
}

.text-secondary {
    color: #6c757d;
}

.text-success {
    color: #10B981;
}

.text-warning {
    color: #F59E0B;
}

.text-danger {
    color: #EF4444;
}

.text-info {
    color: #3B82F6;
}

/* 背景样式 */
.bg-primary {
    background-color: #2D7FF9;
}

.bg-secondary {
    background-color: #6c757d;
}

.bg-success {
    background-color: #10B981;
}

.bg-warning {
    background-color: #F59E0B;
}

.bg-danger {
    background-color: #EF4444;
}

.bg-info {
    background-color: #3B82F6;
}

/* 边框样式 */
.border-primary {
    border-color: #2D7FF9;
}

.border-secondary {
    border-color: #6c757d;
}

.border-success {
    border-color: #10B981;
}

.border-warning {
    border-color: #F59E0B;
}

.border-danger {
    border-color: #EF4444;
}

.border-info {
    border-color: #3B82F6;
}

/* 圆角样式 */
.rounded-sm {
    border-radius: 2px;
}

.rounded-md {
    border-radius: 4px;
}

.rounded-lg {
    border-radius: 8px;
}

.rounded-full {
    border-radius: 9999px;
}

/* 阴影样式 */
.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.shadow-md {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* 字体粗细 */
.font-light {
    font-weight: 300;
}

.font-normal {
    font-weight: 400;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* 字体大小 */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.text-lg {
    font-size: 1.125rem;
}

.text-xl {
    font-size: 1.25rem;
}

.text-2xl {
    font-size: 1.5rem;
}

.text-3xl {
    font-size: 1.875rem;
}

/* 行高 */
.leading-tight {
    line-height: 1.25;
}

.leading-normal {
    line-height: 1.5;
}

.leading-relaxed {
    line-height: 1.75;
}

.leading-loose {
    line-height: 2;
}

/* 文本对齐 */
.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-justify {
    text-align: justify;
}

/* 文本转换 */
.text-uppercase {
    text-transform: uppercase;
}

.text-lowercase {
    text-transform: lowercase;
}

.text-capitalize {
    text-transform: capitalize;
}

/* 文本装饰 */
.underline {
    text-decoration: underline;
}

.line-through {
    text-decoration: line-through;
}

.no-underline {
    text-decoration: none;
}

/* 显示隐藏 */
.hidden {
    display: none;
}

.block {
    display: block;
}

.inline {
    display: inline;
}

.inline-block {
    display: inline-block;
}

.flex {
    display: flex;
}

.inline-flex {
    display: inline-flex;
}

.grid {
    display: grid;
}

.table {
    display: table;
}

/* Flex 布局 */
.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-nowrap {
    flex-wrap: nowrap;
}

.justify-start {
    justify-content: flex-start;
}

.justify-end {
    justify-content: flex-end;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.items-start {
    align-items: flex-start;
}

.items-end {
    align-items: flex-end;
}

.items-center {
    align-items: center;
}

.items-baseline {
    align-items: baseline;
}

.items-stretch {
    align-items: stretch;
}

/* 间距 */
.m-0 {
    margin: 0;
}

.m-1 {
    margin: 0.25rem;
}

.m-2 {
    margin: 0.5rem;
}

.m-3 {
    margin: 0.75rem;
}

.m-4 {
    margin: 1rem;
}

.m-5 {
    margin: 1.25rem;
}

.m-6 {
    margin: 1.5rem;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 0.75rem;
}

.p-4 {
    padding: 1rem;
}

.p-5 {
    padding: 1.25rem;
}

.p-6 {
    padding: 1.5rem;
}

/* 定位 */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.sticky {
    position: sticky;
}

/* Z-index */
.z-0 {
    z-index: 0;
}

.z-10 {
    z-index: 10;
}

.z-20 {
    z-index: 20;
}

.z-30 {
    z-index: 30;
}

.z-40 {
    z-index: 40;
}

.z-50 {
    z-index: 50;
}

/* 宽高 */
.w-full {
    width: 100%;
}

.h-full {
    height: 100%;
}

.max-w-full {
    max-width: 100%;
}

.max-h-full {
    max-height: 100%;
}

/* 溢出 */
.overflow-hidden {
    overflow: hidden;
}

.overflow-auto {
    overflow: auto;
}

.overflow-x-auto {
    overflow-x: auto;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* 可见性 */
.visibility-visible {
    visibility: visible;
}

.visibility-hidden {
    visibility: hidden;
}

/* 光标 */
.cursor-pointer {
    cursor: pointer;
}

.cursor-default {
    cursor: default;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

/* 选择 */
.user-select-none {
    user-select: none;
}

.user-select-auto {
    user-select: auto;
}

/* 过渡 */
.transition-none {
    transition-property: none;
}

.transition-all {
    transition-property: all;
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
}

.transition-opacity {
    transition-property: opacity;
}

.transition-transform {
    transition-property: transform;
}

.transition-all-200 {
    transition: all 0.2s ease;
}

.transition-all-300 {
    transition: all 0.3s ease;
}

.transition-all-500 {
    transition: all 0.5s ease;
}

/* 动画 */
.animate-none {
    animation: none;
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 响应式断点 */
@media (max-width: 640px) {
    .sm\:hidden {
        display: none;
    }
    
    .sm\:block {
        display: block;
    }
    
    .sm\:flex {
        display: flex;
    }
}

@media (max-width: 768px) {
    .md\:hidden {
        display: none;
    }
    
    .md\:block {
        display: block;
    }
    
    .md\:flex {
        display: flex;
    }
}

@media (max-width: 1024px) {
    .lg\:hidden {
        display: none;
    }
    
    .lg\:block {
        display: block;
    }
    
    .lg\:flex {
        display: flex;
    }
}

@media (max-width: 1280px) {
    .xl\:hidden {
        display: none;
    }
    
    .xl\:block {
        display: block;
    }
    
    .xl\:flex {
        display: flex;
    }
}