@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
}

.hero-section {
    background: #0ea5e9;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

.hero-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.nav-link {
    position: relative;
    transition: all 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #0ea5e9;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.service-card {
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-5px);
}

.service-card:hover .service-icon {
    background-color: #0ea5e9;
    color: white;
}

.animate-fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animate-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.counter {
    font-variant-numeric: tabular-nums;
}

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

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

::-webkit-scrollbar-thumb {
    background: #0ea5e9;
    border-radius: 4px;
}

/* 搜索功能相关样式 */
.search-submitted {
    animation: search-submit 0.3s ease-in-out;
}

@keyframes search-submit {
    0% { transform: scale(1); }
    50% { transform: scale(0.98); }
    100% { transform: scale(1); }
}

.search-focused {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transition: box-shadow 0.2s ease-in-out;
}

/* 搜索框清空按钮样式优化 */
.clear-search-btn {
    background: white;
    color: #9ca3af;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    outline: none;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.clear-search-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
    transform: scale(1.1);
}

.clear-search-btn:active {
    transform: scale(0.95);
    background: #e5e7eb;
}

/* 确保在深色模式下也有良好的显示效果 */
.dark .clear-search-btn {
    background: #1f2937;
    color: #d1d5db;
    box-shadow: 0 1px 3px rgba(255, 255, 255, 0.1);
}

.dark .clear-search-btn:hover {
    background: #374151;
    color: #f3f4f6;
}

.dark .clear-search-btn:active {
    background: #374151;
}

/* 搜索输入框样式增强，确保有足够空间容纳清空按钮 */
.search-input-with-clear {
    padding-right: 2.5rem;
}

/* 动画类 */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOutScale {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

.fade-in-scale {
    animation: fadeInScale 0.2s ease-out forwards;
}

.fade-out-scale {
    animation: fadeOutScale 0.15s ease-in forwards;
}

/* 搜索结果样式 */
#search-results {
    position: absolute;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 50;
    max-height: 24rem;
    overflow-y: auto;
}

/* 搜索结果头部 */
.search-results-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background-color: #f9fafb;
}

.search-results-header p {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0;
}

.search-results-header .font-medium {
    font-weight: 500;
    color: #1f2937;
}

/* 清除历史按钮 */
#clear-history-btn {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease-in-out;
}

#clear-history-btn:hover {
    color: #4b5563;
}

/* 搜索历史样式 - 优化版 */
#search-history {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

#search-history h4 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

/* 历史记录日期分组样式 */
.history-date-group {
    margin-bottom: 1rem;
}

.history-date-header {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #f9fafb;
    border-radius: 0.25rem;
}

/* 历史记录项样式增强 */
.history-item {
    display: inline-block;
    font-size: 0.75rem;
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    overflow: hidden;
}

.history-item:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.history-item:active {
    transform: translateY(0);
}

/* 优化版历史记录项样式 */
.search-history-item {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-history-item:hover {
    background-color: #eff6ff;
}

.search-history-item:active {
    background-color: #dbeafe;
}

/* 搜索历史计数徽章 */
.search-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    background-color: #e5e7eb;
    color: #374151;
    border-radius: 0.625rem;
}

/* 热门搜索标记 */
.hot-search-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    animation: pulse-hot 2s infinite;
}

@keyframes pulse-hot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

/* 清除历史按钮动画 */
.clear-history-btn {
    transition: all 0.2s ease-in-out;
}

.clear-history-btn:hover {
    transform: scale(1.05);
}

.clear-history-btn:active {
    transform: scale(0.95);
}

/* 移除按钮悬停效果 */
.history-remove-btn {
    opacity: 0;
    transition: all 0.2s ease-in-out;
    transform: translateX(4px);
}

.search-history-item:hover .history-remove-btn {
    opacity: 1;
    transform: translateX(0);
}

/* 搜索建议入口样式 */
.suggest-entry {
    position: relative;
    overflow: hidden;
}

.suggest-entry::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.suggest-entry:hover::after {
    left: 100%;
}

/* 历史记录渐入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history-fade-in {
    animation: fadeInUp 0.3s ease-out;
}

/* 骨架屏效果 */
.history-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 响应式调整 */
@media (max-width: 640px) {
    .search-history-item {
        padding: 0.75rem;
    }
    
    .history-date-header {
        font-size: 0.7rem;
    }
}

/* 类别分组样式 */
.category-section {
    border-bottom: 1px solid #e5e7eb;
}

.category-section:last-child {
    border-bottom: none;
}

.category-header {
    padding: 0.75rem 1rem;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.category-header h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin: 0;
}

.category-results {
    /* 类别结果容器 */
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* 搜索结果项样式 */
.search-result-item {
    padding: 1rem;
    transition: background-color 0.2s ease-in-out;
    border-bottom: 1px solid #f3f4f6;
}

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

.search-result-item:hover {
    background-color: #f9fafb;
}

.search-result-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

.search-result-item h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.search-result-item p {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0;
    line-height: 1.4;
}

/* 搜索建议样式 */
.suggestion-item {
    display: inline-block;
    font-size: 0.75rem;
    background-color: #f3f4f6;
    color: #4b5563;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.suggestion-item:hover {
    background-color: #e5e7eb;
}

/* 搜索按钮样式 */
.search-submit-button {
    background-color: #2563eb;
    color: white;
    border: none;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out;
}

.search-submit-button:hover {
    background-color: #1d4ed8;
}

/* 高亮标记样式 */
mark {
    background-color: #fef3c7;
    color: #78350f;
    padding: 0.125rem 0.25rem;
    border-radius: 0.125rem;
}

/* 滚动条样式优化 */
#search-results::-webkit-scrollbar {
    width: 4px;
}

#search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

#search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

#search-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

::-webkit-scrollbar-thumb:hover {
    background: #0284c7;
}

/* 移动端菜单 */
.mobile-menu {
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu.open {
    transform: translateX(0);
}

/* 3D产品展示容器 */
#product3DContainer {
    width: 100%;
    height: 400px;
    background-color: rgba(14, 165, 233, 0.05);
    border-radius: 8px;
    overflow: hidden;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        height: auto;
        min-height: 100vh;
    }

    #product3DContainer {
        height: 300px;
    }
}


html, body {
  overflow-x: hidden;
}

/* 通用：禁用父容器内链接但保留文本 */
.disable-links a {
  pointer-events: none;
  text-decoration: none;
  /* 移除颜色覆盖，保留原始文本/图标颜色 */
  cursor: default;
}
.disable-links a:focus {
  outline: none;
}
.disable-links a i,
.disable-links a img {
  pointer-events: none;
}

/* Toast 提示样式 */
.toast-container {
    position: fixed;
    inset: 0; /* 占满视窗用于居中 */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 9999;
    pointer-events: none; /* 不阻挡页面交互 */
}

.toast {
    pointer-events: auto; /* 允许自身动画 */
    background: rgba(17, 24, 39, 0.92); /* slate-900 近似 */
    color: #fff;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    transform: translateY(-8px);
    opacity: 0;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
    border-left: 3px solid rgba(255,255,255,0.2);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.hide {
    transform: translateY(-8px);
    opacity: 0;
}

.toast-success {
    border-left-color: #10b981; /* emerald-500 */
}

.toast-error {
    border-left-color: #ef4444; /* red-500 */
}