/**
 * DappWeb Critical CSS
 * 首屏关键样式 - 用于优化首次内容渲染
 */

/* 关键CSS - 首屏渲染必需 */
html {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #1f2937;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #fff;
}

/* 加载状态 */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* 导航栏 */
nav {
    background: #111827;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 50;
}

/* Hero区域 */
header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: #fff;
    padding: 5rem 1rem;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.5rem;
    }
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #4f46e5;
    color: #fff;
}

.btn-primary:hover {
    background: #4338ca;
    transform: translateY(-2px);
}

/* 动画 */
.fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 语言下拉菜单 */
.language-dropdown .dropdown-menu {
    display: none;
    position: absolute;
    background-color: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 50;
    min-width: 120px;
    border-radius: 8px;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    right: 0;
}

.language-dropdown:hover .dropdown-menu,
.language-dropdown .dropdown-menu.active {
    display: block;
}

.dropdown-menu a {
    color: #374151;
    padding: 0.75rem 1rem;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 0.875rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-menu a:hover {
    background-color: #f3f4f6;
    color: #4f46e5;
}

.dropdown-menu a.selected {
    font-weight: 600;
    color: #4f46e5;
}

/* 卡片悬停效果 */
.card-hover {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* 服务图标包装器 */
.service-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.5rem;
    width: 3.5rem;
    border-radius: 0.5rem;
    background-image: linear-gradient(to right, #4f46e5, #7c3aed);
    color: white;
    margin-bottom: 1.25rem;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.service-icon-wrapper i {
    font-size: 1.75rem;
}

/* 合作伙伴Logo */
.partner-logo {
    max-height: 45px;
    width: auto;
    margin: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.partner-logo:hover {
    filter: grayscale(0%);
    opacity: 1;
}

/* 社交按钮 */
.social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0.5rem;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

.social-button i {
    margin-right: 0.6rem;
    font-size: 1.1rem;
}

.social-twitter { background-color: #1DA1F2; color: white; }
.social-twitter:hover { background-color: #0c85d0; }
.social-linkedin { background-color: #0A66C2; color: white; }
.social-linkedin:hover { background-color: #004182; }
.social-wechat { background-color: #07C160; color: white; }
.social-wechat:hover { background-color: #06ad56; }
.social-telegram { background-color: #2AABEE; color: white; }
.social-telegram:hover { background-color: #1798d4; }

/* 博客卡片 */
.blog-card img {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 9999px;
    margin-right: 0.25rem;
    margin-bottom: 0.5rem;
}

/* 背景色区分 */
#why-us, #cooperation, #social-news, #about {
    background-color: #f9fafb;
}

#blog-posts {
    background-color: #f3f4f6;
}

footer a:hover {
    color: white;
    text-decoration: underline;
}

:target::before {
    content: "";
    display: block;
    height: 80px;
    margin-top: -80px;
    visibility: hidden;
}

/* 在线客服样式 */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.chat-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.chat-panel {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-body {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.chat-input {
    border-top: 1px solid #e5e7eb;
    padding: 16px;
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 20px;
    padding: 8px 16px;
    outline: none;
}

.chat-input button {
    background: #4f46e5;
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
}

.message {
    margin-bottom: 12px;
}

.message.bot {
    text-align: left;
}

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

.message-content {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 12px;
    max-width: 80%;
}

.message.bot .message-content {
    background: #f3f4f6;
    color: #374151;
}

.message.user .message-content {
    background: #4f46e5;
    color: white;
}

/* 浮动通知 */
.floating-notification {
    position: fixed;
    top: 100px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    max-width: 300px;
    z-index: 999;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.floating-notification.show {
    transform: translateX(0);
}

.floating-notification .close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #9ca3af;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .chat-panel {
        width: calc(100vw - 40px);
        height: 400px;
    }
    
    .floating-notification {
        max-width: calc(100vw - 40px);
    }
}

/* B2B平台集成样式 */
.platform-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.platform-stat {
    transition: color 0.3s ease;
}

.platform-reviews {
    max-height: 200px;
    overflow-y: auto;
}

.review-item {
    border-left: 4px solid #10b981;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.linkedin-post {
    border-left: 4px solid #0a66c2;
    padding-left: 1rem;
    margin-bottom: 0.75rem;
}

.platform-link {
    transition: all 0.3s ease;
}

.platform-link:hover {
    transform: translateX(5px);
}

/* 平台图标动画 */
.platform-icon {
    transition: transform 0.3s ease;
}

.platform-card:hover .platform-icon {
    transform: scale(1.1);
}

/* 数据统计动画 */
@keyframes countUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-number {
    animation: countUp 0.6s ease-out;
}
