/* 优选农品 B2B蔬菜采购平台样式 */

:root {
    --primary-color: #2a6b3c;
    --secondary-color: #e67e22;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.text-secondary {
    color: var(--secondary-color) !important;
}

.btn-secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* 头部样式 */
.header .top-bar {
    font-size: 0.9rem;
}

.header .contact-info span {
    color: #666;
}

.header .user-actions a {
    color: #666;
    text-decoration: none;
}

.header .user-actions a:hover {
    color: var(--primary-color);
}

.navbar-brand .brand-text {
    color: var(--primary-color) !important;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary-color) !important;
}

/* 搜索框样式 */
.input-group .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(42, 107, 60, 0.25);
}

.btn-outline-success {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-success:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 面包屑样式 */
.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* 产品卡片 */
.product-card {
    height: 100%;
}

.product-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.product-card .grade-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.product-card .price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.product-card .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 表单样式 */
.form-control {
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(42, 107, 60, 0.25);
}

.form-select {
    border-radius: var(--border-radius);
}

/* 徽章样式 */
.badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

/* 等级徽章 */
.grade-a {
    background-color: #ffc107;
    color: #000;
}

.grade-b {
    background-color: #17a2b8;
    color: #fff;
}

.grade-c {
    background-color: #28a745;
    color: #fff;
}

/* 首页轮播图 */
.hero-carousel .carousel-item {
    height: 400px;
}

.hero-carousel .carousel-item img {
    height: 100%;
    object-fit: cover;
}

.hero-carousel .carousel-caption {
    background: rgba(0,0,0,0.5);
    border-radius: var(--border-radius);
    padding: 2rem;
}

/* 特色区块 */
.feature-box {
    text-align: center;
    padding: 2rem 1rem;
    border-radius: var(--border-radius);
    background: #fff;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.feature-box:hover {
    transform: translateY(-5px);
}

.feature-box .icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 产品筛选 */
.filter-sidebar {
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h6 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.filter-option {
    display: block;
    padding: 0.5rem 0;
    color: #666;
    text-decoration: none;
    transition: var(--transition);
}

.filter-option:hover,
.filter-option.active {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

/* 产品详情 */
.product-gallery {
    position: sticky;
    top: 20px;
}

.product-gallery .main-display-area {
    position: relative;
    width: 100%;
    height: 400px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f8f9fa;
}

.product-gallery .main-image,
.product-gallery .main-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.product-gallery .thumbnails .thumbnail-slot {
    width: 100%;
    height: 80px;
    border-radius: var(--border-radius);
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
    border: 2px solid #e9ecef;
    overflow: hidden;
    position: relative;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery .thumbnails .thumbnail-slot:hover,
.product-gallery .thumbnails .thumbnail-slot.active {
    opacity: 1;
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(42, 107, 60, 0.3);
}

.product-gallery .thumbnails .thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
}

.product-gallery .thumbnails .thumbnail-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.product-gallery .thumbnails .video-slot {
    position: relative;
    background: #000;
}

.product-gallery .thumbnails .video-thumbnail-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery .thumbnails .video-placeholder {
    color: white;
    font-size: 24px;
}

.product-gallery .thumbnails .play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    color: var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    z-index: 2;
}

.product-gallery .thumbnails .upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 11px;
    text-align: center;
    height: 100%;
    width: 100%;
}

.product-gallery .thumbnails .upload-placeholder i {
    font-size: 18px;
    margin-bottom: 4px;
}

/* 规格选择样式 */
.grade-selection .grade-option {
    border: 2px solid #e9ecef;
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: var(--transition);
    cursor: pointer;
    background: white;
}

.grade-selection .grade-option:hover {
    border-color: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.grade-selection .grade-option.selected,
.grade-selection .grade-option.border-primary {
    border-color: var(--primary-color);
    background: rgba(42, 107, 60, 0.05);
}

.grade-selection .grade-image-container {
    width: 100%;
    height: 120px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 1rem;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.grade-selection .grade-image-container:hover {
    transform: scale(1.02);
}

.grade-selection .grade-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f8f9fa;
}

.grade-selection .grade-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.grade-selection .grade-placeholder i {
    font-size: 24px;
    margin-bottom: 8px;
}

.grade-selection .grade-badge-container {
    text-align: center;
    margin-bottom: 0.5rem;
}

.grade-selection .price-info {
    text-align: center;
    margin-bottom: 0.5rem;
}

.grade-selection .stock-info {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

.product-info .price {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.product-info .grade-badge {
    font-size: 1rem;
    margin-bottom: 1rem;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.quantity-selector .btn {
    width: 40px;
    height: 40px;
    padding: 0;
}

.quantity-selector input {
    width: 100px;
    text-align: center;
}

/* 购物车/采购单 */
.cart-item {
    border-bottom: 1px solid #eee;
    padding: 1rem 0;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item .product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.cart-summary {
    background: var(--light-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.cart-summary .total {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--secondary-color);
}

/* 订单状态 */
.order-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 2rem 0;
}

.order-status .step {
    flex: 1;
    text-align: center;
    position: relative;
}

.order-status .step::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #ddd;
    z-index: 1;
}

.order-status .step:last-child::after {
    display: none;
}

.order-status .step.active::after {
    background: var(--primary-color);
}

.order-status .step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ddd;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    position: relative;
    z-index: 2;
}

.order-status .step.active .step-icon {
    background: var(--primary-color);
}

/* 数据表格 */
.table {
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.table th {
    background: var(--light-color);
    border: none;
    font-weight: 600;
    color: var(--primary-color);
}

.table td {
    border: none;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

/* 分页 */
.pagination .page-link {
    color: var(--primary-color);
    border-color: #ddd;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-link:hover {
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 警告框 */
.alert {
    border: none;
    border-radius: var(--border-radius);
}

/* 模态框 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #eee;
}

.modal-footer {
    border-top: 1px solid #eee;
}

/* 底部样式 */
.footer {
    margin-top: auto;
}

.footer h5,
.footer h6 {
    color: var(--success-color);
}

.footer a:hover {
    color: var(--success-color) !important;
}

/* 返回顶部按钮 */
#backToTop {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    box-shadow: var(--box-shadow);
}

/* 客服悬浮窗 */
.customer-service .btn {
    box-shadow: var(--box-shadow);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-carousel .carousel-item {
        height: 250px;
    }
    
    .hero-carousel .carousel-caption {
        padding: 1rem;
    }
    
    .feature-box {
        margin-bottom: 1rem;
    }
    
    .product-gallery .main-image {
        height: 300px;
    }
    
    .filter-sidebar {
        margin-bottom: 2rem;
    }
    
    .order-status {
        flex-direction: column;
        gap: 1rem;
    }
    
    .order-status .step::after {
        display: none;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1e4d2b;
}

/* 管理后台图片预览样式 */
.admin-image-preview,
.admin-video-preview,
.admin-grade-preview {
    width: 100%;
    height: 120px;
    border: 2px dashed #e9ecef;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    overflow: hidden;
}

.admin-preview-img,
.admin-grade-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

.admin-preview-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 4px;
}

.admin-image-placeholder,
.admin-video-placeholder,
.admin-gallery-placeholder,
.admin-grade-placeholder {
    width: 100%;
    height: 120px;
    border: 2px dashed #dee2e6;
    border-radius: var(--border-radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 14px;
}

.admin-image-placeholder i,
.admin-video-placeholder i,
.admin-gallery-placeholder i,
.admin-grade-placeholder i {
    font-size: 24px;
    margin-bottom: 8px;
}

.admin-gallery-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    background: #f8f9fa;
}

.admin-gallery-item {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.admin-gallery-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: white;
}
/* 
FCKeditor富文本内容样式 */
.product-rich-content {
    line-height: 1.8;
}

.product-rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 10px 0;
    box-shadow: var(--box-shadow);
}

.product-rich-content p {
    margin-bottom: 1rem;
    text-align: justify;
}

.product-rich-content h1,
.product-rich-content h2,
.product-rich-content h3,
.product-rich-content h4,
.product-rich-content h5,
.product-rich-content h6 {
    color: var(--primary-color);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.product-rich-content ul,
.product-rich-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.product-rich-content li {
    margin-bottom: 0.5rem;
}

.product-rich-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border: 1px solid #dee2e6;
}

.product-rich-content table th,
.product-rich-content table td {
    padding: 0.75rem;
    border: 1px solid #dee2e6;
    text-align: left;
}

.product-rich-content table th {
    background-color: var(--light-color);
    font-weight: 600;
    color: var(--primary-color);
}

.product-rich-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    background-color: var(--light-color);
    padding: 1rem;
    border-radius: var(--border-radius);
}

.product-rich-content a {
    color: var(--primary-color);
    text-decoration: none;
}

.product-rich-content a:hover {
    text-decoration: underline;
}

/* 产品描述区域样式优化 */
.product-description {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}