/**
 * Panda Seek - 前台样式
 * 外贸多语言商城系统
 */

:root {
    --primary: #1e40af;
    --primary-dark: #1e3a8a;
    --secondary: #f97316;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray: #6b7280;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
    color: #1f2937;
    background-color: #f8fafc;
}

/* 导航栏 */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: all 0.3s;
}

.nav-link:hover {
    opacity: 0.8;
}

/* Hero区 */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
    border-radius: 0;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* 商品卡片 */
.product-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important;
}

.product-card .card-img-top {
    transition: transform 0.3s ease;
}

.product-card:hover .card-img-top {
    transform: scale(1.05);
}

.product-card .card-title a:hover {
    color: var(--primary) !important;
}

/* 分类卡片 */
.category-card {
    transition: all 0.3s ease;
    border-radius: 12px;
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
    background: var(--primary);
    color: white !important;
}

.category-card:hover .card-title {
    color: white !important;
}

/* 文章卡片 */
.article-card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.article-card:hover .card-title {
    color: var(--primary);
}

/* 按钮 */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 500;
}

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

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
}

/* AI浮动按钮 */
.ai-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.ai-float-btn .btn {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(30, 64, 175, 0); }
    100% { box-shadow: 0 0 0 0 rgba(30, 64, 175, 0); }
}

/* 页脚 */
footer {
    background-color: #1f2937 !important;
}

.footer-links a:hover {
    color: white !important;
}

.social-links a:hover {
    color: var(--primary) !important;
    transform: translateY(-2px);
    display: inline-block;
}

.payment-icon {
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s;
}

.payment-icon:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* 轮播图 */
.carousel-item img {
    height: 500px;
    object-fit: cover;
}

.carousel-caption {
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    left: 0;
    right: 0;
    bottom: 0;
    padding: 60px 50px 40px;
}

/* 表格 */
.table {
    vertical-align: middle;
}

/* 表单 */
.form-control, .form-select {
    border-radius: 8px;
    padding: 0.6rem 0.875rem;
    border: 1px solid #e5e7eb;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(30, 64, 175, 0.15);
}

/* 卡片 */
.card {
    border-radius: 12px;
    transition: all 0.3s;
}

/* 聊天 */
.chat-messages {
    background: #f8fafc;
}

.chat-messages .bg-light {
    max-width: 80%;
    border-radius: 0 15px 15px 15px;
}

.chat-messages .bg-primary {
    max-width: 80%;
    border-radius: 15px 0 15px 15px;
}

/* 缩略图 */
.thumbnail-img {
    border-radius: 8px;
    transition: all 0.2s;
}

.thumbnail-img:hover {
    opacity: 0.8;
}

/* 面包屑 */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb a {
    color: var(--gray);
}

.breadcrumb a:hover {
    color: var(--primary);
}

/* 分页 */
.pagination .page-link {
    color: var(--primary);
    border-radius: 8px;
    margin: 0 2px;
    border: none;
    padding: 0.5rem 0.875rem;
}

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

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

/* 商品内容 */
.product-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.product-content h1, .product-content h2, .product-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.product-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

/* 文章内容 */
.article-content {
    line-height: 1.9;
    font-size: 1.05rem;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.article-content p {
    margin-bottom: 1.25rem;
}

.article-content h2, .article-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* 富文本内容通用样式 - 视频响应式 */
.product-content video,
.article-content video,
.product-content iframe,
.article-content iframe {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.product-content video,
.article-content video {
    width: 100%;
    max-height: 500px;
    background: #000;
}

.product-content iframe,
.article-content iframe {
    aspect-ratio: 16/9;
    width: 100%;
}

/* 富文本表格样式 */
.product-content table,
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

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

.product-content table th,
.article-content table th {
    background: #f9fafb;
    font-weight: 600;
}

/* 富文本列表样式 */
.product-content ul, .product-content ol,
.article-content ul, .article-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.product-content li,
.article-content li {
    margin-bottom: 0.5rem;
    line-height: 1.8;
}

/* 富文本引用样式 */
.product-content blockquote,
.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #6b7280;
    font-style: italic;
}

/* 富文本代码样式 */
.product-content pre,
.article-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.product-content code,
.article-content code {
    background: #f3f4f6;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.product-content pre code,
.article-content pre code {
    background: none;
    padding: 0;
}

/* 响应式 */
@media (max-width: 768px) {
    .carousel-item img {
        height: 300px;
    }
    
    .carousel-caption h2 {
        font-size: 1.5rem !important;
    }
    
    .ai-float-btn {
        bottom: 20px;
        right: 20px;
    }
    
    .ai-float-btn .btn {
        width: 50px;
        height: 50px;
    }
}

/* 加载动画 */
.btn-social {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* 徽章 */
.badge {
    font-weight: 500;
    padding: 0.4em 0.7em;
    border-radius: 6px;
}

/* 列表组 */
.list-group-item {
    border: none;
    padding: 0.875rem 1.25rem;
}

.list-group-item.active {
    background-color: var(--primary);
    border-color: var(--primary);
}
