<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>NET.DEAL - Premium Domains</title>
    <link rel="icon" type="image/x-icon" href="/logo.ico">
    <link rel="shortcut icon" type="image/x-icon" href="/logo.ico">
    <script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="1e3902d5ea8b33bc42169c10-|49"></script><link rel="stylesheet" href="styles.css" media="print" onload="this.media='all'">
    <script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="1e3902d5ea8b33bc42169c10-|49"></script><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" media="print" onload="this.media='all'">
    <noscript>
        <link rel="stylesheet" href="styles.css">
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css">
    </noscript>
    <!-- Matomo -->
    <script type="1e3902d5ea8b33bc42169c10-text/javascript">
      var _paq = window._paq = window._paq || [];
      _paq.push(['trackPageView']);
      _paq.push(['enableLinkTracking']);
      _paq.push(['enableHeartBeatTimer', 5]);
      (function() {
        var u="//data.net.deal/";
        _paq.push(['setTrackerUrl', u+'matomo.php']);
        _paq.push(['setSiteId', '1']);
        var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
        g.async=true; g.defer=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
      })();
    </script>
    <!-- End Matomo Code -->
    <style>
        :root {
            --primary-color: #0052cc;
            --secondary-color: #0747a6;
            --background-color: #ffffff;
            --card-background: #ffffff;
            --text-color: #172b4d;
            --text-muted: #5e6c84;
            --border-color: #dfe1e6;
            --hover-color: #0065ff;
            --card-shadow: 0 1px 2px rgba(9, 30, 66, 0.1);
            --card-hover-shadow: 0 2px 4px rgba(9, 30, 66, 0.15);
            --gradient-start: #0052cc;
            --gradient-end: #0747a6;
            --card-radius: 4px;
            --button-radius: 3px;
            --gold-gradient: linear-gradient(135deg, #0052cc, #0747a6);
        }

        .faq-link-in-modal { /* 新增FAQ链接样式 */
            font-weight: bold;
            color: var(--primary-color);
            text-decoration: underline;
        }

        .faq-link-in-modal:hover { /* 新增FAQ链接悬停样式 */
            color: var(--hover-color);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            margin: 0;
            padding: 0;
            background-color: var(--background-color);
            color: var(--text-color);
            line-height: 1.6;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            overflow-y: scroll;
            position: relative;
        }

        .container {
            max-width: 100%;
            padding: 0;
            flex: 1;
            display: flex;
            flex-direction: column;
            min-height: 100vh; /* 确保最小高度 */
            max-height: 100vh; /* 限制最大高度 */
            overflow: hidden; /* 防止容器溢出 */
        }

        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 2rem;
            margin-bottom: 1rem;
            border-bottom: 1px solid var(--border-color);
            background-color: white;
            position: relative;
            z-index: 1000;
            overflow: visible;
            gap: 1rem;
        }

        .logo {
            font-size: 2rem;
            font-weight: 800;
            text-decoration: none;
            letter-spacing: -0.05em;
            color: #1e40af;
            flex-shrink: 0;
            max-width: 140px;
        }

        .nav-links {
            display: flex;
            gap: 24px;
            align-items: center;
            overflow: visible;
            white-space: nowrap;
            padding: 0 4px;
            position: relative;
            justify-content: center;
        }

        .nav-links::-webkit-scrollbar {
            display: none; /* Chrome, Safari, Opera */
        }

        .nav-links a {
            color: var(--text-color);
            text-decoration: none;
            padding: 0.5rem 0.75rem;
            border-radius: var(--button-radius);
            transition: all 0.2s ease;
            font-weight: 500;
            position: relative;
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .nav-dropdown {
            position: relative;
            display: inline-block;
            z-index: 1001;
        }

        .nav-dropdown-content {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background-color: white;
            min-width: 160px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            border-radius: var(--button-radius);
            z-index: 1002;
            padding: 0;
            margin-top: 0.25rem;
            transition: opacity 0.2s ease;
            pointer-events: auto;
        }

        .nav-dropdown-content:before {
            display: none;
        }

        .nav-dropdown:hover .nav-dropdown-content {
            display: block;
        }

        /* 添加子菜单悬停区域 */
        .nav-dropdown::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 0;
            width: 100%;
            height: 20px;
            display: block;
            z-index: 1000;
        }

        .nav-dropdown-content a {
            color: var(--text-color);
            padding: 0.75rem 1rem;
            text-decoration: none;
            display: block;
            transition: all 0.2s ease;
            white-space: nowrap;
            font-size: 0.875rem;
        }

        .nav-dropdown-content a:first-child {
            border-top-left-radius: var(--button-radius);
            border-top-right-radius: var(--button-radius);
        }

        .nav-dropdown-content a:last-child {
            border-bottom-left-radius: var(--button-radius);
            border-bottom-right-radius: var(--button-radius);
        }

        .nav-dropdown-content a:hover {
            background-color: rgba(14, 165, 233, 0.1);
        }

        .nav-links a:hover {
            background-color: rgba(14, 165, 233, 0.1);
            transform: none;
            box-shadow: none;
        }

        .nav-links a.active {
            background: var(--primary-color);
            color: white;
        }

        .language-switch {
            display: flex;
            align-items: center;
            gap: 4px;
            margin-left: 12px;
            flex-shrink: 0;
            background: #f3f4f6;
            padding: 2px;
            border-radius: 4px;
        }

        .language-switch span {
            cursor: pointer;
            padding: 4px 8px;
            border-radius: 3px;
            transition: all 0.2s ease;
            font-size: 0.875rem;
            color: #64748b;
        }

        .language-switch span.active {
            background: #1e40af;
            color: white;
        }

        .language-switch span:not(.active):hover {
            color: #1e40af;
        }

        @media (max-width: 480px) {
            .language-switch {
                display: none;
            }
        }

        .filter-section {
            display: flex;
            gap: 1rem;
            margin: 0 2rem 1rem; /* 减小margin */
            align-items: flex-end;
            flex-wrap: nowrap;
            flex-shrink: 0; /* 防止过度压缩 */
        }

        .filter-group {
            flex: 1;
            min-width: 0; /* 防止内容溢出 */
            box-sizing: border-box;
            padding-right: 0.5rem;
        }

        .filter-group:last-child {
            padding-right: 0;
        }

        .filter-group label {
            font-size: 0.75rem;
            margin-bottom: 0.25rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--text-muted);
            font-weight: 500;
            display: block;
        }

        .filter-group input, .filter-group select {
            width: 100%;
            padding: 0.375rem 0.5rem;
            border: 1px solid var(--border-color);
            border-radius: var(--button-radius);
            font-size: 0.875rem;
            background-color: white;
            color: var(--text-color);
            transition: all 0.2s ease;
            box-sizing: border-box;
        }

        .filter-group input:hover, .filter-group select:hover {
            border-color: var(--hover-color);
        }

        .filter-group input:focus, .filter-group select:focus {
            border-color: var(--hover-color);
            box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
            outline: none;
        }

        .domain-cards {
            padding: 0 2rem;
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1rem;
            margin-bottom: 1rem;
            flex: 1;
            overflow-y: auto;
            height: auto;
            min-height: 0;
            align-content: start;
        }

        .domain-card {
            background: white;
            border: 1px solid var(--border-color);
            padding: 1rem;
            transition: all 0.15s ease;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            position: relative;
            height: 90px;
            max-height: 90px;
            min-height: 90px;
            box-sizing: border-box;
        }

        .domain-card-info {
            display: flex;
            flex-direction: column;
            flex: 1;
            gap: 0.25rem;
        }

        .domain-card-meta {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.75rem;
            color: var(--text-muted);
        }

        .domain-card-type-container {
            position: absolute;
            right: -4px;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: row; /* 改为水平排列 */
            gap: 4px;
            align-items: center; /* 居中对齐 */
            z-index: 1;
        }

        .domain-card-type {
            position: relative;
            right: 0;
            top: 0;
            transform: none;
            margin-bottom: 0; /* 移除底部间距 */
            margin-left: 4px; /* 添加左侧间距 */
            box-shadow: none;
            transition: all 0.1s ease;
            padding: 0.125rem 0.375rem;
            border-radius: 2px;
            font-size: 0.8rem;
            white-space: nowrap;
            font-weight: 500;
            letter-spacing: 0.02em;
            line-height: 1.5;
        }

        .domain-card-type:first-child {
            margin-left: 0; /* 第一个标签不需要左侧间距 */
        }

        .domain-card-type:last-child {
            margin-bottom: 0;
        }

        .domain-card-type:hover {
            border-color: rgba(0, 0, 0, 0.12);
        }

        .domain-card-bottom {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: auto;
        }

        .domain-card-note {
            color: var(--text-muted);
            font-size: 0.75rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            flex: 1;
            margin-right: 0.5rem;
            text-align: left;
        }

        .domain-card-price {
            font-size: 0.875rem;
            color: var(--text-muted);
            white-space: nowrap;
            text-align: right;
            margin-left: auto;
        }

        .domain-card-header {
            display: flex;
            align-items: flex-start;
            gap: 0.5rem;
            justify-content: space-between;
        }

        .domain-card:hover {
            border-color: var(--hover-color);
            box-shadow: var(--card-hover-shadow);
        }

        .domain-card-name {
            font-size: 1rem;
            font-weight: 500;
            color: var(--text-color);
            cursor: pointer;
            line-height: 1.4;
            flex: 1;
            display: inline-flex;
            align-items: flex-start;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: visible;
            word-break: break-word;
            position: relative;
            max-width: fit-content;
        }

        .domain-card-name:hover {
            color: var(--hover-color);
        }

        .copied-tooltip {
            position: absolute;
            background: var(--secondary-color);
            color: white;
            padding: 0.375rem 0.75rem;
            border-radius: var(--button-radius);
            font-size: 0.75rem;
            pointer-events: none;
            opacity: 0;
            left: 100%;
            top: 50%;
            transform: translateY(-50%);
            margin-left: 4px;
            transition: opacity 0.2s ease;
            z-index: 1000;
            white-space: nowrap;
        }

        .copied-tooltip.show {
            opacity: 1;
        }

        .pagination {
            padding: 1rem 2rem;
            display: flex;
            justify-content: center;
            gap: 0.75rem;
            margin-top: auto;
            flex-shrink: 0;
            background: white;
            border-top: 1px solid var(--border-color);
        }

        .pagination button {
            background: white;
            border: 1px solid var(--border-color);
            color: var(--text-color);
            padding: 0.5rem 1rem;
            border-radius: var(--button-radius);
            cursor: pointer;
            transition: all 0.2s ease;
            min-width: 40px;
            font-size: 0.875rem;
        }

        .pagination button.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }

        .pagination button:hover:not(:disabled):not(.active) {
            border-color: var(--primary-color);
            background: #f0f7ff;
        }

        .pagination button.active:hover {
            background: var(--secondary-color);
            border-color: var(--secondary-color);
        }

        #loadingIndicator {
            flex: 1;
            display: flex;
            flex-direction: column;
            justify-content: flex-start; /* 从顶部开始显示 */
            align-items: center;
            margin: 2rem;
            padding: 2rem;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: var(--card-radius);
        }

        .loading {
            width: 100%;
            text-align: center;
            padding: 2rem;
            background-color: var(--card-background);
            border-radius: var(--card-radius);
            box-shadow: var(--card-shadow);
            border: 1px solid var(--border-color);
            margin-top: 2rem; /* 增加顶部间距 */
        }

        .spinner {
            border: 4px solid rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            border-top: 4px solid var(--primary-color);
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
            margin: 0 auto 20px;
        }

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

        @keyframes flowingBackground {
            0% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
            100% {
                background-position: 0% 50%;
            }
        }

        @media (max-width: 768px) {
            .container {
                padding: 0;
                height: auto;
                min-height: 100vh;
                max-height: none;
                overflow: visible;
            }

            .domain-cards {
                grid-template-columns: 1fr;
                overflow: visible;
                height: auto;
                padding: 0 1rem;
            }

            .filter-section {
                flex-wrap: wrap;
                margin: 0 1rem 1rem;
                background: white;
                padding: 1rem 0;
            }

            .nav-links {
                gap: 8px;
                max-width: calc(100vw - 160px);
                justify-content: flex-start;
            }

            .nav-links a {
                max-width: 80px;
                padding: 0.5rem;
                font-size: 0.875rem;
            }

            .header {
                padding: 0.75rem 1rem;
                gap: 0.75rem;
            }

            .logo {
                font-size: 1.5rem;
                max-width: 120px;
            }

            .language-switch {
                flex-shrink: 0;
            }

            .filter-group {
                flex: 1 1 calc(50% - 0.5rem);
                min-width: 120px;
                padding-right: 0.5rem;
                margin-bottom: 0.5rem;
            }

            .filter-group:nth-child(2n) {
                padding-right: 0;
            }
        }

        @media (max-width: 480px) {
            .nav-dropdown-content {
                left: 0;
                right: auto;
                min-width: 100px;
                max-width: 140px;
            }

            .nav-links {
                max-width: calc(100vw - 120px);
                gap: 4px;
            }

            .nav-links a {
                max-width: 60px;
                font-size: 0.875rem;
                padding: 0.5rem 0.375rem;
            }

            .header {
                padding: 0.5rem;
                gap: 0.5rem;
            }

            .logo {
                font-size: 1.25rem;
                max-width: 100px;
            }
        }

        #noResults {
            flex: 1;
            display: flex;
            justify-content: flex-start; /* 从顶部开始显示 */
            align-items: flex-start; /* 从顶部开始显示 */
            margin: 2rem;
            padding: 2rem;
            background: white;
            border: 1px solid var(--border-color);
            border-radius: var(--card-radius);
        }

        /* 添加滚动横幅样式 */
        .marquee-container {
                width: 100%;
            height: 28px;
            min-height: 28px;
            background: linear-gradient(135deg, #1e40af 0%, #0a2d5e 100%);
            overflow: hidden;
            position: relative;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 0;
            display: flex;
            align-items: center;
        }

        .marquee {
            display: flex;
            align-items: center;
            position: absolute;
            width: max-content;
            animation: scroll var(--scroll-duration) linear infinite;
            padding: 0;
            gap: 0;
            left: 0;
            height: 100%;
        }

        .marquee-item {
            color: #ffffff;
            cursor: pointer;
            font-weight: 500;
            white-space: nowrap;
            line-height: 28px;
            display: flex;
            align-items: center;
        }

        .domain-separator {
            margin: 0 20px;
            color: rgba(255, 255, 255, 0.5);
            user-select: none;
        }

        @keyframes scroll {
            0% {
                transform: translateX(0);
            }
            100% {
                transform: translateX(-50%);
            }
        }

        @media (max-width: 768px) {
            .marquee {
                animation-duration: calc(var(--scroll-duration) * 0.5); /* 移动端速度加快一倍 */
            }
        }

        /* 添加模态窗口样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.25s ease; /* 缩短过渡时间 */
            backdrop-filter: blur(3px); /* 减轻模糊效果 */
            will-change: opacity; /* 提示浏览器进行优化 */
            overscroll-behavior: contain; /* 防止滚动穿透 */
        }

        .modal.show {
            opacity: 1;
        }

        /* 添加报价窗口样式 */
        .modal-content {
            position: relative;
            background: #ffffff;
            margin: 5vh auto;
            padding: 1.25rem;
            width: 90%;
            max-width: 450px;
            border-radius: 2px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
            transform: translateY(-20px) scale(0.95);
            opacity: 0;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1); /* 缩短过渡时间 */
            box-sizing: border-box;
            will-change: transform, opacity; /* 提示浏览器优化这两个属性 */
            contain: layout; /* 布局包含，减少重排影响范围 */
        }

        .modal.show .modal-content {
            transform: translateY(0) scale(1);
            opacity: 1;
        }

        /* 添加窗口切换效果 */
        .offer-view {
            display: none;
        }

        .modal.offer-mode .main-view {
            display: none;
        }

        .modal.offer-mode .offer-view {
            display: block;
        }

        /* 统一按钮样式 */
        .modal-button, .pay-with-atom, .more-options-button {
            width: 100%;
            height: 44px !important; /* 统一高度为44px */
            line-height: 1;
            padding: 0 1rem;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            border: none;
            margin-bottom: 0.5rem;
            box-sizing: border-box;
            overflow: hidden; /* 防止内容溢出 */
            position: relative; /* 为绝对定位子元素提供参考 */
        }

        .modal-button:last-child, .pay-with-atom:last-child, .more-options-button:last-child {
            margin-bottom: 0;
        }

        /* 移除悬浮效果 */
        .main-view .modal-button:hover, .main-view .pay-with-atom:hover, .main-view .more-options-button:hover {
            transform: none;
            box-shadow: none;
        }

        .modal-buttons {
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
            width: 100%;
            margin-bottom: 0.8rem; /* 添加底部间距 */
        }

        .more-options {
            width: 100%;
            margin-top: 0;
        }

        .more-options-button {
            background: white !important; /* 白色背景 */
            color: #1e293b !important; /* 深灰色文字 */
            border: 2px solid #e2e8f0 !important; /* 浅灰色边框 */
            border-radius: 12px !important; /* 更圆润的边角 */
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important; /* 柔和阴影 */
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease !important;
        }

        /* 添加马卡龙效果的高光 */
        .more-options-button::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
            pointer-events: none;
        }

        .more-options-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08) !important;
            border-color: #cbd5e1 !important; /* 悬停时边框颜色变化 */
            background: #f8fafc !important; /* 悬停时背景色微调 */
        }

        .more-options-button i {
            color: #64748b !important; /* 图标颜色调整为中灰色 */
        }

        .modal-submit {
            background: white;
            color: #1e40af;
            border: 2px solid #1e40af;
        }

        .modal-submit:hover {
            background: rgba(30, 64, 175, 0.05);
        }

        .go-back-button {
            background: transparent;
            border: 1px solid #e2e8f0;
            color: #64748b;
            font-weight: 500;
            margin-bottom: 1rem;
        }

        .go-back-button:hover {
            background: rgba(0, 0, 0, 0.05);
        }

        .modal-close {
            position: absolute;
            top: 1rem;
            right: 1rem;
            font-size: 1.5rem;
            cursor: pointer;
            color: #64748b;
            transition: all 0.2s ease;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.05);
            z-index: 10; /* 确保关闭按钮在最上层 */
        }

        .modal-close:hover {
            background: rgba(0, 0, 0, 0.1);
            color: #1e293b;
            transform: rotate(90deg);
        }

        .modal-title-row {
            display: flex;
            align-items: center; /* 改为居中对齐，适应新的样式 */
            justify-content: flex-start;
            margin-bottom: 1.5rem; /* 增加底部间距 */
            position: relative;
            min-height: 60px; /* 增加高度以适应新样式 */
            padding-right: 40px; /* 为关闭按钮留出空间 */
        }

        .modal-title {
            font-size: 1.8rem;
            color: #1e40af;
            margin: 0;
            padding: 0.3rem 0.5rem 0.5rem 0;
            width: fit-content;
            min-width: 0;
            line-height: 1.3;
            display: inline-block;
            vertical-align: baseline;
            font-family: 'Open Sans', sans-serif;
            letter-spacing: 0.5px;
            font-weight: 700;
            max-width: 60%;
            overflow: hidden;
            text-overflow: ellipsis;
            /* 新样式 - 去除方框感 */
            position: relative;
            transition: all 0.3s ease;
            border: none;
            background: none;
            box-shadow: none;
            text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
        }

        /* 添加域名的下划线效果 */
        .modal-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, #3b82f6, transparent);
            transition: all 0.3s ease;
        }

        /* 添加域名的悬停效果 */
        .modal-title:hover {
            transform: translateY(-1px);
            color: #2563eb;
        }

        .modal-title:hover::after {
            height: 3px;
            background: linear-gradient(90deg, #2563eb, transparent);
        }

        /* 创意结合：域名和价格的连接线 */
        .modal-title-price-connector {
            position: absolute;
            top: 50%;
            right: -15px;
            width: 15px;
            height: 2px;
            background: linear-gradient(90deg, #3b82f6, transparent);
            transform: translateY(-50%);
            opacity: 0.7;
            transition: all 0.3s ease;
        }

        /* 价格容器样式 */
        .modal-price-container {
            position: relative;
            display: inline-block;
        }

        .modal-price {
            font-size: 1.3rem;
            font-weight: 700;
            color: white;
            margin: 0 0.5rem 0 1rem;
            white-space: nowrap;
            display: inline-block;
            vertical-align: baseline;
            font-family: 'Open Sans', sans-serif;
            flex-shrink: 0;
            line-height: 1.3;
            /* 销售标签样式 */
            padding: 0.3rem 0.9rem;
            position: relative;
            background: #3b82f6; /* 蓝色，与网站主题色调协调 */
            border-radius: 0;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            transform: rotate(-2deg); /* 轻微倾斜 */
            clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%); /* 创建不规则形状 */
            z-index: 1;
        }

        /* 添加价格的悬停效果 */
        .modal-price:hover {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
            transform: rotate(-2deg) translateY(-2px);
            background: #2563eb; /* 悬停时颜色加深，保持蓝色系 */
        }

        /* 添加销售标签的装饰元素 */
        .modal-price::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
            pointer-events: none;
        }

        /* 添加销售标签的阴影效果 */
        .modal-price::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: repeating-linear-gradient(
                -45deg,
                rgba(0, 0, 0, 0.05),
                rgba(0, 0, 0, 0.05) 5px,
                rgba(0, 0, 0, 0) 5px,
                rgba(0, 0, 0, 0) 10px
            );
            pointer-events: none;
        }

        /* 丝带效果已移除 */

        .modal-type-container {
            position: absolute;
            right: 40px; /* 为关闭按钮留出空间 */
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: row; /* 改为水平排列 */
            gap: 4px;
            align-items: center; /* 居中对齐 */
            z-index: 1;
            max-width: calc(100% - 100px); /* 限制最大宽度 */
            flex-wrap: wrap; /* 允许标签换行 */
        }

        .modal-type {
            position: relative;
            right: 0;
            top: 0;
            transform: none;
            margin-bottom: 0; /* 移除底部间距 */
            margin-left: 4px; /* 添加左侧间距 */
            box-shadow: none;
            transition: all 0.1s ease;
            padding: 0.125rem 0.375rem;
            border-radius: 2px;
            font-size: 0.8rem;
            white-space: nowrap;
            font-weight: 500;
            letter-spacing: 0.02em;
            line-height: 1.5;
        }

        .modal-type:first-child {
            margin-left: 0; /* 第一个标签不需要左侧间距 */
        }

        .modal-type:last-child {
            margin-bottom: 0;
        }

        .modal-discount {
            text-align: center;
            margin: 0 0 0.75rem;
            padding: 0.5rem 0.75rem;
            background: linear-gradient(135deg, rgba(30, 64, 175, 0.05), rgba(10, 45, 94, 0.05));
            border-radius: 6px;
            color: #1e40af;
            font-weight: 500;
            font-size: 0.875rem;
            cursor: pointer;
            transition: background-color 0.2s ease;
        }

        .modal-discount:hover {
            background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(10, 45, 94, 0.1));
        }

        .modal-input-group {
            margin-bottom: 0.5rem;
                width: 100%;
            box-sizing: border-box;
        }

        .modal-input-group input,
        .modal-input-group textarea {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            font-size: 0.875rem;
            font-family: inherit;
            color: #1e293b;
            transition: border-color 0.2s ease, box-shadow 0.2s ease;
            background: white;
            box-sizing: border-box;
            resize: vertical;
            line-height: 1.4;
        }

        .modal-input-group textarea {
            min-height: 60px;
            max-height: 150px;
        }

        .modal-input-group input:focus,
        .modal-input-group textarea:focus {
            outline: none;
            border-color: #1e40af;
            box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
        }

        .modal-error {
            display: none;
            color: #dc2626;
            font-size: 0.875rem;
            margin-top: 0.375rem;
        }

        .modal-button {
            padding: 0.625rem 1rem;
            border: none;
            border-radius: 6px;
            font-weight: 600;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .pay-with-atom {
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px !important; /* 更圆润的边角 */
            padding: 0.625rem 1rem !important;
            background: linear-gradient(135deg, #60a5fa, #3b82f6) !important; /* 马卡龙蓝色渐变 */
            border: none !important;
            box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important; /* 柔和阴影 */
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease !important;
        }

        /* 添加马卡龙效果的高光 */
        .pay-with-atom::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
            pointer-events: none;
        }

        .pay-with-atom:hover {
            transform: translateY(-2px) !important;
            box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4) !important;
            background: linear-gradient(135deg, #3b82f6, #2563eb) !important; /* 悬停时颜色加深 */
        }

        .pay-with-atom span {
            font-size: 0.875rem !important;
            font-weight: 600 !important;
            vertical-align: middle;
            line-height: 1;
            top: 0px !important;
            padding-right: 0 !important;
            color: white !important; /* 确保文字颜色为白色 */
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important; /* 添加文字阴影增强可读性 */
        }

        .pay-with-atom img {
            vertical-align: middle;
            margin-left: 0.5rem;
            filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1)); /* 为图标添加轻微阴影 */
        }

        @media (max-width: 640px) {
            .modal-buttons {
                flex-direction: column;
                gap: 0.8rem;
            }

            .modal-button, .pay-with-atom {
                width: 100%;
            }

            /* 确保移动端视图的Atom按钮占满宽度 */
            .pay-with-atom {
                width: 100% !important;
                margin-top: 0;
            }
        }

        .modal-submit {
            background: white !important; /* 白色背景 */
            color: #1e40af !important; /* 蓝色文字 */
            border: 2px solid #1e40af !important; /* 蓝色边框 */
            border-radius: 12px !important; /* 更圆润的边角 */
            box-shadow: 0 4px 10px rgba(30, 64, 175, 0.1) !important; /* 柔和阴影 */
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease !important;
        }

        /* 添加马卡龙效果的高光 */
        .modal-submit::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5), transparent);
            pointer-events: none;
        }

        .modal-submit:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(30, 64, 175, 0.15) !important;
            background: rgba(30, 64, 175, 0.05) !important; /* 悬停时背景微调 */
        }

        .modal-buy-now {
            background: white;
            color: #1e40af;
            border: 2px solid #1e40af;
        }

        .modal-buy-now:hover {
            background: rgba(30, 64, 175, 0.05);
        }

        @media (max-width: 640px) {
            .modal-content {
                padding: 1rem 0.75rem;
                max-width: 100%;
                width: calc(100% - 1.5rem);
            }

            /* 移动端悬停效果调整 */
            .modal-price:hover {
                transform: rotate(-1deg) translateY(-2px);
            }

            .offer-view .modal-price:hover {
                transform: rotate(-1deg) translateY(-2px);
            }

            .modal-title-row {
                gap: 0.5rem;
                flex-direction: row; /* 在移动端保持水平排列 */
                align-items: center; /* 居中对齐 */
                margin-bottom: 1.2rem;
                width: 100%; /* 确保占满宽度 */
                justify-content: flex-start; /* 左对齐 */
                flex-wrap: nowrap; /* 防止换行 */
            }

            .modal-title {
                font-size: 1.8rem; /* 保持与之前一致的字体大小 */
                max-width: 70%; /* 限制宽度，留出价格空间 */
                margin-bottom: 0; /* 移除底部间距 */
                padding: 0.3rem 0.5rem 0.5rem 0; /* 调整内边距 */
                white-space: nowrap; /* 防止换行 */
                overflow: hidden; /* 隐藏溢出部分 */
                text-overflow: ellipsis; /* 显示省略号 */
            }

            .modal-title-price-connector {
                display: none; /* 在移动端隐藏连接线 */
            }

            .modal-price-container {
                margin-left: 0.3rem; /* 添加少量左侧间距 */
                flex-shrink: 0; /* 防止被压缩 */

            }

            .modal-price {
                font-size: 1.3rem; /* 保持与之前一致的字体大小 */
                padding: 0.3rem 0.9rem; /* 保持与之前一致的内边距 */
                transform: rotate(-2deg); /* 移动端减小倾斜角度 */
                white-space: nowrap; /* 防止换行 */
                margin-left: 0.2rem; /* 设置左边距为0.2rem */
            }

            /* 丝带效果已移除 */

            .modal-stats {
                gap: 0.5rem;
                flex-wrap: wrap;
                justify-content: center;
            }

            .modal-selling-info p {
                font-size: 0.8rem;
            }

            .modal-contact {
                gap: 0.5rem;
                flex-wrap: wrap;
            }

            .modal-contact a {
                padding: 0.375rem 0.5rem;
                font-size: 0.75rem;
            }

            .modal-traffic {
                padding: 0.375rem 0.5rem;
                font-size: 0.75rem;
            }

            .modal-reg {
                padding: 0.375rem 0.5rem;
                font-size: 0.75rem;
            }

            .modal-button {
                width: 100%;
            }

            /* 报价视图的移动端样式 */
            .offer-view .modal-title-row {
                flex-direction: row; /* 与主视图保持一致 */
                align-items: center; /* 与主视图保持一致 */
                width: 100%; /* 确保占满宽度 */
                justify-content: flex-start; /* 与主视图保持一致 */
                flex-wrap: nowrap; /* 与主视图保持一致 */
            }

            .offer-view .modal-title {
                font-size: 1.8rem; /* 与主视图保持一致 */
                max-width: 70%; /* 与主视图保持一致 */
                margin-bottom: 0; /* 与主视图保持一致 */
                padding: 0.25rem 0 0.25rem 0; /* 与主视图保持一致 */
                white-space: nowrap; /* 与主视图保持一致 */
                overflow: hidden; /* 与主视图保持一致 */
                text-overflow: ellipsis; /* 与主视图保持一致 */
            }

            .offer-view .modal-title-price-connector {
                display: none; /* 在移动端隐藏连接线 */
            }

            .offer-view .modal-price-container {
                margin-left: 0.3rem; /* 与主视图保持一致 */
                flex-shrink: 0; /* 与主视图保持一致 */
            }

            /* 移除嵌套的offer视图样式，因为我们已经添加了专门的媒体查询 */

            /* 丝带效果已移除 */
        }

        .modal-contact {
            display: flex;
            gap: 0.8rem;
            margin-bottom: 1.0rem;
            align-items: center;
        }

        .modal-contact a {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            color: #1e293b; /* 恢复为黑色文字 */
            text-decoration: none;
            font-weight: 500;
            padding: 0.5rem 0.75rem;
            border-radius: 6px;
            background: rgba(243, 244, 246, 0.7); /* 保持轻柔的背景色 */
            transition: all 0.2s ease;
            font-size: 0.875rem;
            border: 1px solid #E5E7EB; /* 保持轻微边框 */
        }

        .modal-contact a:hover {
            background: rgba(243, 244, 246, 0.9);
            color: #000000; /* 悬停时更深的黑色 */
        }

        /* 基础图标样式 */
        .modal-contact i {
            font-size: 1rem;
        }

        /* 各图标使用原始品牌颜色 */
        .modal-contact .fa-envelope {
            color: #3B82F6; /* 邮箱图标使用蓝色 */
        }

        .modal-contact .fa-whatsapp {
            color: #25D366; /* WhatsApp图标使用绿色 */
        }

        .modal-contact .fa-telegram {
            color: #0088cc; /* Telegram图标使用蓝色 */
        }

        .modal-contact .fa-comment {
            color: #FF6550; /* Live Chat图标使用橙红色 */
        }

        /* 添加成功提示样式 */
        .success-message {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%) translateY(-100px);
            background: linear-gradient(135deg, #10B981, #059669);
            color: white;
            padding: 1rem 2rem;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
            z-index: 2000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }

        .success-message.show {
            opacity: 1;
            visibility: visible;
            transform: translate(-50%, -50%);
        }

        .success-message.hide {
            opacity: 0;
            visibility: hidden;
            transform: translate(-50%, -50%) translateY(20px);
        }

        /* 添加提交中状态样式 */
        .submitting .modal-submit {
            position: relative;
            color: transparent !important;
            pointer-events: none;
        }

        .submitting .modal-submit::after {
            content: "";
            position: absolute;
            left: 50%;
            top: 50%;
            width: 20px;
            height: 20px;
            margin: -10px 0 0 -10px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: submit-spin 0.6s linear infinite;
        }

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

        @media (max-width: 768px) {
            .nav-dropdown-content {
                left: 0;
                right: auto;
                min-width: 120px;
                max-width: 160px;
            }

            .nav-links .nav-dropdown {
                position: relative;
            }

            .nav-dropdown-content {
                position: absolute;
                left: 0;
            }
        }

        @media (max-width: 480px) {
            .nav-dropdown-content {
                left: 0;
                right: auto;
                min-width: 100px;
                max-width: 140px;
            }

            .nav-links a {
                max-width: 60px;
                font-size: 0.875rem;
                padding: 0.5rem 0.375rem;
            }

            /* 小屏幕下联系方式行间距设置 */
            .modal-contact {
                gap: 0.375rem !important;
            }
        }

        .domain-card-type-container {
            z-index: 1;
        }

        .domain-card-type {
            box-shadow: none;
            transition: all 0.1s ease;
            line-height: 1.5;
        }

        .domain-card-type:last-child {
            margin-bottom: 0;
        }

        .modal-type-container {
            z-index: 1;
        }

        .modal-type {
            box-shadow: none;
            transition: all 0.1s ease;
            line-height: 1.5;
        }

        .modal-type:last-child {
            margin-bottom: 0;
        }

        .domain-card-type[data-type="hack"] {
            background: linear-gradient(135deg, #E0DEFF, #D0CEFF);
        }

        .domain-card-type[data-type="promo"] {
            background: linear-gradient(135deg, #FFE9D0, #FFDFBC);
        }

        .domain-card-type[data-type="hot"] {
            background: linear-gradient(135deg, #FFE0E0, #FFD0D0);
        }

        .domain-card-type[data-type="word"] {
            background: linear-gradient(135deg, #d1f1ff, #c2ecff);
        }

        .domain-card-type:not([data-type="hack"]):not([data-type="promo"]):not([data-type="hot"]):not([data-type="word"]) {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        }

        .modal-type[data-type="hack"] {
            background: linear-gradient(135deg, #E0DEFF, #D0CEFF);
        }

        .modal-type[data-type="promo"] {
            background: linear-gradient(135deg, #FFE9D0, #FFDFBC);
        }

        .modal-type[data-type="hot"] {
            background: linear-gradient(135deg, #FFE0E0, #FFD0D0);
        }

        .modal-type:not([data-type="hack"]):not([data-type="promo"]):not([data-type="hot"]):not([data-type="word"]) {
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        }

        .modal-type[data-type="word"] {
            background: linear-gradient(135deg, #d1f1ff, #c2ecff);
        }


        /* 添加流量图标样式 */
        .modal-traffic {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 0.775rem;
            color: white;
            background: linear-gradient(135deg, #93C5FD, #60A5FA);
            padding: 0.5rem 0.75rem;
            border-radius: 6px;
            margin-left: 0;
            cursor: help;
            transition: all 0.2s ease;
            box-shadow: 0 2px 4px rgba(147, 197, 253, 0.2);
        }

        .modal-traffic:hover {
            box-shadow: 0 2px 4px rgba(147, 197, 253, 0.2);
        }

        .modal-traffic i {
            font-size: 1rem;
            color: white;
        }

        .modal-traffic span {
            font-weight: 500;
            color: white;
        }

        /* 添加REG样式 */
        .modal-reg {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 0.775rem;
            color: white;
            background: linear-gradient(135deg, #93C5FD, #60A5FA);
            padding: 0.5rem 0.75rem;
            border-radius: 6px;
            cursor: help;
            transition: all 0.2s ease;
            box-shadow: 0 2px 4px rgba(147, 197, 253, 0.2);
        }

        .modal-reg:hover {
            box-shadow: 0 2px 4px rgba(147, 197, 253, 0.2);
        }

        .modal-reg i {
            font-size: 1rem;
            color: white;
        }

        .modal-reg span {
            font-weight: 500;
            color: white;
        }

        /* 添加更多购买方式的样式 */
        .more-options {
            width: 100%;
            margin-top: 0;
        }

        .more-options-button {
            width: 100%;
            padding: 0.625rem 1rem;
            background: transparent;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            color: #1e293b;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s ease;
        }

        .more-options-button:hover {
            background: rgba(30, 64, 175, 0.05);
        }

        .more-options-content {
            display: none;
            margin-top: 0.5rem;
            border: 1px solid #d1d5db; /* 更改边框颜色，使其更加明显 */
            border-radius: 6px;
            overflow: hidden;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* 添加轻微阴影增强视觉边界 */
        }

        .more-options-content.show {
            display: block;
        }

        /* 平台链接高度也统一为44px */
        .platform-link {
            display: flex;
            align-items: center;
            padding: 0 1rem;
            height: 44px !important;
            color: #1e293b;
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            border-bottom: 1px solid #d1d5db; /* 更改分割线颜色，使其更加明显 */
            transition: all 0.2s ease;
            box-sizing: border-box;
        }

        .platform-link:last-child {
            border-bottom: none;
        }

        .platform-link:hover {
            background: rgba(30, 64, 175, 0.05);
        }

        .platform-link i {
            margin-left: 0.5rem;
            font-size: 0.75rem;
            color: #6b7280;
        }

        /* 交易特性样式 */
        .transaction-features {
            padding: 12px 15px;
            background: rgba(30, 64, 175, 0.03);
            border-radius: 6px;
            margin-bottom: 1.0rem;
            border: 1px solid #e2e8f0;
        }

        .domain-description {
            margin-bottom: 10px;
            font-size: 0.875rem;
            color: #1e293b;
        }

        .domain-description p {
            margin: 0;
        }

        .domain-description br {
            content: "";
            display: block;
            margin-bottom: 3px;
        }

        .features-separator {
            height: 1px;
            background: rgba(226, 232, 240, 0.8);
            margin: 10px 0 12px;
        }

        .feature-item {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 6px;
            font-size: 0.875rem;
            color: #1e293b;
        }

        .feature-item:last-child {
            margin-bottom: 0;
        }

        .feature-item i {
            color: #10B981;
            font-size: 0.875rem;
        }

        .payment-methods {
            margin-top: 12px;
            padding-top: 10px;
            border-top: 1px solid rgba(226, 232, 240, 0.6);
        }

        .payment-methods-footer {
            margin-top: 0.8rem;
            text-align: center;
        }

        /* 报价窗口标题栏样式 */
        .offer-view .modal-title-row {
            display: flex;
            align-items: center; /* 改为居中对齐，与主视图保持一致 */
            justify-content: flex-start;
            margin-bottom: 1.5rem; /* 增加底部间距，与主视图保持一致 */
            position: relative;
            min-height: 60px; /* 增加高度，与主视图保持一致 */
            padding-left: 0; /* 移除左侧留白 */
            padding-right: 40px; /* 为关闭按钮留出空间 */
        }

        .offer-view .modal-title {
            /* 继承主视图的样式 */
            font-size: 1.8rem;
            color: #1e40af;
            margin: 0;
            padding: 0.3rem 0.5rem 0.5rem 0;
            width: fit-content;
            min-width: 0;
            line-height: 1.3;
            display: inline-block;
            vertical-align: baseline;
            font-family: 'Open Sans', sans-serif;
            letter-spacing: 0.5px;
            font-weight: 700;
            max-width: 60%;
            overflow: hidden;
            text-overflow: ellipsis;
            /* 新样式 - 去除方框感 */
            position: relative;
            transition: all 0.3s ease;
            border: none;
            background: none;
            box-shadow: none;
            text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
        }

        /* 添加域名的下划线效果 */
        .offer-view .modal-title::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, #3b82f6, transparent);
            transition: all 0.3s ease;
        }

        /* 添加域名的悬停效果 */
        .offer-view .modal-title:hover {
            transform: translateY(-1px);
            color: #2563eb;
        }

        .offer-view .modal-title:hover::after {
            height: 3px;
            background: linear-gradient(90deg, #2563eb, transparent);
        }

        /* 创意结合：域名和价格的连接线 */
        .offer-view .modal-title-price-connector {
            position: absolute;
            top: 50%;
            right: -15px;
            width: 15px;
            height: 2px;
            background: linear-gradient(90deg, #3b82f6, transparent);
            transform: translateY(-50%);
            opacity: 0.7;
            transition: all 0.3s ease;
        }

        /* 价格容器样式 */
        .offer-view .modal-price-container {
            position: relative;
            display: inline-block;
        }

        .offer-view .modal-price {
            /* 继承主视图的销售标签样式 */
            font-size: 1.3rem;
            font-weight: 700;
            color: white;
            margin: 0 0.5rem 0 1rem;
            white-space: nowrap;
            display: inline-block;
            vertical-align: baseline;
            font-family: 'Open Sans', sans-serif;
            flex-shrink: 0;
            line-height: 1.3;
            padding: 0.3rem 0.9rem;
            position: relative;
            background: #3b82f6; /* 蓝色，与网站主题色调协调 */
            border-radius: 0;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
            text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
            transition: all 0.3s ease;
            transform: rotate(-2deg); /* 轻微倾斜 */
            clip-path: polygon(0 0, 100% 0, 95% 100%, 5% 100%); /* 创建不规则形状 */
            z-index: 1;
        }

        /* 为offer页面添加专门的小宽度媒体查询 */
        @media (max-width: 640px) {
            .offer-view .modal-price {
                margin-left: 0.2rem; /* 在小屏幕下设置左边距为0.2rem */
            }
        }

        .offer-view .modal-price:hover {
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.25);
            transform: rotate(-2deg) translateY(-2px);
            background: #2563eb; /* 悬停时颜色加深，保持蓝色系 */
        }

        .offer-view .modal-price::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
            pointer-events: none;
        }

        .offer-view .modal-price::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: repeating-linear-gradient(
                -45deg,
                rgba(0, 0, 0, 0.05),
                rgba(0, 0, 0, 0.05) 5px,
                rgba(0, 0, 0, 0) 5px,
                rgba(0, 0, 0, 0) 10px
            );
            pointer-events: none;
        }

        /* 丝带效果已移除 */

        .offer-view .modal-price::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: repeating-linear-gradient(
                -45deg,
                rgba(0, 0, 0, 0.05),
                rgba(0, 0, 0, 0.05) 5px,
                rgba(0, 0, 0, 0) 5px,
                rgba(0, 0, 0, 0) 10px
            );
            pointer-events: none;
        }

        /* 添加顶部返回按钮样式 */
        .modal-back {
            position: absolute;
            top: 3.5rem; /* 放在关闭按钮下方 */
            right: 1rem; /* 与关闭按钮水平对齐 */
            transform: none;
            font-size: 1rem;
            cursor: pointer;
            color: #64748b;
            transition: all 0.2s ease;
            width: 28px;
            height: 28px;
            display: none; /* 默认隐藏 */
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            background: rgba(0, 0, 0, 0.05);
            z-index: 10;
        }

        .modal-back:hover {
            background: rgba(0, 0, 0, 0.1);
            color: #1e293b;
        }

        .modal.offer-mode .modal-back {
            display: flex; /* 在报价模式下显示 */
        }

        /* 修正报价表单样式 */
        .modal-form {
            margin-top: 1.2rem;
            margin-bottom: 1rem;
        }

        .modal-form .modal-button {
            margin-top: 1rem;
        }

        /* 调整pay-with-atom样式以确保所有按钮高度一致 */
        .pay-with-atom {
            height: 44px !important;
            box-sizing: border-box;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .pay-with-atom span, .more-options-button span {
            line-height: 1;
        }

        /* 报价窗口中的提交按钮使用蓝色渐变 */
        .offer-view .modal-submit {
            background: linear-gradient(135deg, #60a5fa, #3b82f6) !important; /* 与立即购买按钮相同的蓝色渐变 */
            color: white !important;
            border: none !important;
            border-radius: 12px !important; /* 更圆润的边角 */
            box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3) !important; /* 柔和阴影 */
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease !important;
        }

        /* 添加马卡龙效果的高光 */
        .offer-view .modal-submit::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
            pointer-events: none;
        }

        .offer-view .modal-submit:hover {
            transform: translateY(-2px) !important;
            box-shadow: 0 6px 15px rgba(59, 130, 246, 0.4) !important;
            background: linear-gradient(135deg, #3b82f6, #2563eb) !important; /* 悬停时颜色加深 */
        }

        /* 分期付款按钮的特殊样式 */
        .pay-with-atom[data-installments]:not([data-installments=""]) {
            background: linear-gradient(271.19deg, #8B5CF6 0%, #A78BFA 100%) !important; /* 稍微淡一点的紫色渐变 */
            color: white !important;
            height: 44px !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            border-radius: 12px !important; /* 更圆润的边角 */
            box-shadow: 0 4px 10px rgba(139, 92, 246, 0.3) !important; /* 柔和阴影 */
            position: relative;
            overflow: hidden;
            transition: all 0.3s ease !important;
        }

        /* 添加马卡龙效果的高光 */
        .pay-with-atom[data-installments]:not([data-installments=""])::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 50%;
            background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), transparent);
            pointer-events: none;
        }

        /* 分期付款按钮的文字样式 */
        .pay-with-atom[data-installments]:not([data-installments=""]) .installment-info {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            width: 100%;
            justify-content: center;
        }

        .pay-with-atom[data-installments]:not([data-installments=""]) .installment-text {
            font-weight: 600;
        }

        .pay-with-atom[data-installments]:not([data-installments=""]) .installment-details {
            font-size: 0.8rem;
            opacity: 0.9;
            font-weight: normal;
            color: rgba(255, 255, 255, 0.95);
        }

        /* 添加微弱悬浮效果 */
        .main-view .pay-with-atom:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: all 0.2s ease;
        }

        /* 分期付款按钮的微弱悬浮效果 */
        .pay-with-atom[data-installments]:not([data-installments=""]):hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(139, 92, 246, 0.4) !important;
            background: linear-gradient(271.19deg, #7C3AED 0%, #9F7AFA 100%) !important; /* 悬停时颜色加深 */
            transition: all 0.3s ease;
        }

        /* 立即购买按钮的基础样式 */
        .pay-with-atom[data-installments=""] {
            background: white;
        }

        /* 立即购买按钮的微弱悬浮效果 */
        .pay-with-atom[data-installments=""]:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            transition: all 0.2s ease;
        }

        /* 报价窗口中提交按钮的悬停效果已在上面定义 */

        /* 浏览量和REG的容器样式 */
        .modal-stats {
            display: flex;
            gap: 1rem;
            margin-bottom: 0;
            justify-content: flex-start;
        }

        .modal-stats:has(.modal-traffic:not([style*="display: none"]), .modal-reg:not([style*="display: none"])) {
            margin-bottom: 1rem;
        }

        .modal-stats:has(.modal-valuation:not([style*="display: none"])) {
            margin-bottom: 1rem;
        }

        /* 售卖信息样式 */
        .modal-selling-info {
            margin: 1rem 0;
            padding: 1rem;
            background-color: rgba(30, 64, 175, 0.05);
            border-radius: 6px;
            border-left: 4px solid #3B82F6;
        }

        .modal-selling-info p {
            margin:0;
            font-size: 0.9rem;
            color: #1e40af;
            font-weight: 500;
            white-space: pre-line; /* 允许文本换行 */
        }

        /* 添加Atom图标相关的样式，确保加载前就有尺寸限制 */
        .pay-with-atom img {
            max-height: 20px;
            max-width: 60px;
            width: auto;
            height: auto;
            object-fit: contain;
            vertical-align: middle;
            margin-left: 0.5rem;
        }

        /* 添加按钮占位符样式，确保在按钮加载前保持占位 */
        .button-placeholder {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 44px !important;
            border-radius: 6px;
            background-color: #f5f5f5;
            border: 1px solid #e0e0e0;
            margin-bottom: 0.5rem;
            font-size: 0.875rem;
            color: #a0a0a0;
            font-weight: 600;
            box-sizing: border-box;
            position: relative;
            overflow: hidden;
        }

        .button-placeholder:after {
            content: "";
            position: absolute;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, transparent, #3B82F6, transparent);
            animation: loading 1.5s infinite;
            bottom: 0;
        }

        @keyframes loading {
            0% { left: -100%; }
            100% { left: 100%; }
        }

        /* 添加按钮点击延迟状态样式 */
        .pay-with-atom.clicked {
            position: relative;
            pointer-events: none; /* 防止重复点击 */
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1) !important;
            transform: translateY(1px) !important;
            transition: all 0.1s ease !important;
        }

        .pay-with-atom.clicked::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: rgba(0, 0, 0, 0.05);
            border-radius: 6px;
            z-index: 1;
        }

        .pay-with-atom.clicked::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 0;
            height: 2px;
            width: 0%;
            background: linear-gradient(90deg, transparent, #3B82F6, transparent);
            animation: button-loading 2s ease-in-out;
            z-index: 2;
        }

        @keyframes button-loading {
            0% { width: 0%; left: 0; }
            50% { width: 100%; left: 0; }
            100% { width: 0%; left: 100%; }
        }

        /* 添加估价样式 */
        .modal-valuation {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 0.775rem;
            color: white;
            background: linear-gradient(135deg, #A5B4FC, #818CF8);
            padding: 0.5rem 0.75rem;
            border-radius: 6px;
            cursor: help;
            transition: all 0.2s ease;
            box-shadow: 0 2px 4px rgba(165, 180, 252, 0.2);
        }

        .modal-valuation:hover {
            box-shadow: 0 2px 4px rgba(165, 180, 252, 0.3);
        }

        .modal-valuation i {
            font-size: 1rem;
            color: white;
        }

        .modal-valuation span {
            font-weight: 500;
            color: white;
        }
    </style>
    <!-- 动态加载jQuery -->
    <script type="1e3902d5ea8b33bc42169c10-text/javascript">
        // 动态加载jQuery
        function loadJQuery() {
            var script = document.createElement('script');
            script.src = "https://code.jquery.com/jquery-1.10.2.js";
            script.async = true;
            script.defer = true;
            script.onload = function() {
                // jQuery加载完成后，再加载依赖jQuery的脚本
                console.log("jQuery加载完成");
                // 如果存在其他需要jQuery的初始化函数，在这里调用
                if (window.initializeAtomButtonsWithNewWindow && typeof window.initializeAtomButtonsWithNewWindow === 'function') {
                    window.initializeAtomButtonsWithNewWindow();
                }
            };
            document.head.appendChild(script);
        }
        // 等待DOMContentLoaded事件后再加载jQuery
        document.addEventListener('DOMContentLoaded', loadJQuery);
    </script>
    <!-- 移除直接引用的Atom脚本，只通过JavaScript动态加载 -->
    <script type="1e3902d5ea8b33bc42169c10-text/javascript">
        // 为Atom支付系统定义全局变量，存储encryption_key
        window.atomEncryptionKey = null;
        window.atomScriptLoaded = false;

        // 创建一个Map来存储按钮的原始点击处理器
        window.atomButtonHandlers = new Map();

        // 定义缺少的函数以解决ReferenceError
        window.initializeAtomButtonsWithNewWindow = function() {
            // 调用标准的初始化函数，如果存在
            if (window.initAtomButtons && typeof window.initAtomButtons === 'function') {
                window.initAtomButtons();
            }
        };

        // 解析URL参数获取encryption_key
        function getEncryptionKeyFromUrl() {
            const params = new URLSearchParams(window.location.search);
            const encryptionKey = params.get('encryption_key');
            if (encryptionKey) {
                window.atomEncryptionKey = encryptionKey;
            } else {
                // 如果URL中没有加密密钥，使用默认值
                window.atomEncryptionKey = '6817f40b9501bd00'; // 使用token作为默认密钥
            }
        }

        // 加载Atom脚本
        function loadAtomScript() {
            // 确保只加载一次
            if (window.atomScriptLoaded) {
                // 如果已加载，只初始化按钮
                if (window.initAtomButtons && typeof window.initAtomButtons === 'function') {
                    setTimeout(() => {
                        window.initAtomButtons();
                    }, 300);
                }
                return;
            }

            // 移除可能存在的旧脚本
            const existingScripts = document.querySelectorAll('script[src*="pay-with-atom.js"]');
            existingScripts.forEach(script => script.remove());

            // 检查jQuery是否已加载
            if (typeof jQuery === 'undefined' || typeof $ === 'undefined') {
                // 如果jQuery还未加载，等待100ms后重试
                console.log("等待jQuery加载...");
                setTimeout(loadAtomScript, 100);
                return;
            }

            // 加载新脚本
            const script = document.createElement('script');
            script.src = '/pay-with-atom.js';
            script.onload = function() {
                window.atomScriptLoaded = true;

                // 确保所有pay-with-atom按钮都设置了正确的加密密钥
                setTimeout(() => {
                    const allButtons = document.querySelectorAll('.pay-with-atom');
                    allButtons.forEach(button => {
                        if (!button.getAttribute('data-encryption-key') && window.atomEncryptionKey) {
                            button.setAttribute('data-encryption-key', window.atomEncryptionKey);
                        }
                        // 添加请求验证时间戳
                        button.setAttribute('data-request-validation', Date.now().toString());
                        // 添加API URL指向
                        button.setAttribute('data-api-url', 'https://www.atom.com/api/v1/payments');
                    });

                    // 初始化按钮
                    if (window.initAtomButtons && typeof window.initAtomButtons === 'function') {
                        window.initAtomButtons();
                    }
                }, 300);
            };
            document.head.appendChild(script);
        }

        // 重新加载Atom脚本的函数
        function reloadAtomScript() {
            // 如果脚本已加载且初始化功能可用，只重新初始化按钮
            if (window.atomScriptLoaded && window.initAtomButtons && typeof window.initAtomButtons === 'function') {
                // 确保所有按钮都有加密密钥
                const allButtons = document.querySelectorAll('.pay-with-atom');
                allButtons.forEach(button => {
                    if (!button.getAttribute('data-encryption-key') && window.atomEncryptionKey) {
                        button.setAttribute('data-encryption-key', window.atomEncryptionKey);
                    }
                    button.setAttribute('data-request-validation', Date.now().toString());
                    button.setAttribute('data-api-url', 'https://www.atom.com/api/v1/payments');
                });

                // 重新初始化
                window.initAtomButtons();
                return;
            }

            // 重置状态并重新加载
            window.atomScriptLoaded = false;
            loadAtomScript();
        }

        // 在页面加载时解析encryption_key并加载脚本
        document.addEventListener('DOMContentLoaded', function() {
            getEncryptionKeyFromUrl();

            // 先确保加载jQuery，jQuery会在加载完成后触发initializeAtomButtonsWithNewWindow
            loadJQuery();

            // 在jQuery加载完成后，loadJQuery的onload事件会调用相关初始化
            // 延迟加载Atom脚本，确保jQuery已加载
            setTimeout(loadAtomScript, 500);
        });
    </script>
    <!-- 添加修复btoa编码问题的脚本 -->
    <script type="1e3902d5ea8b33bc42169c10-text/javascript">
        // 修复btoa编码问题
        const originalBtoa = window.btoa;
        window.btoa = function(str) {
            try {
                return originalBtoa(str);
            } catch (e) {
                // 如果出错，使用UTF-8安全的替代方法
                return originalBtoa(unescape(encodeURIComponent(str)));
            }
        };
    </script>
    <script id="chatway" async="true" src="https://cdn.chatway.app/widget.js?id=tW1GRkTm41Js" type="1e3902d5ea8b33bc42169c10-text/javascript"></script>
</head>
<body>
    <div class="container">
        <div class="marquee-container">
            <div class="marquee" id="marquee">
                <!-- 滚动内容将通过 JavaScript 动态添加 -->
            </div>
        </div>
        <div class="header">
            <a href="/" class="logo">NET.<span>DEAL</span></a>
            <div class="nav-links">
                <a href="/" class="active">Home</a>
                <div class="nav-dropdown">
                    <a href="/cdn-cgi/l/email-protection#c6b5a7aaa386a8a3b2e8a2a3a7aa">Contact</a>
                    <div class="nav-dropdown-content">
                        <a href="/cdn-cgi/l/email-protection#fc8f9d9099bc929988d298999d90">Email</a>
                        <a href="https://wa.me/+8613385883002" target="_blank">WhatsApp</a>
                        <a href="https://t.me/bluishwu" target="_blank">TG</a>
                    </div>
                </div>
                <div class="nav-dropdown">
                    <a href="https://www.atom.com/domain-portfolio/bluishwu/2799012" target="_blank">售卖平台</a>
                    <div class="nav-dropdown-content">
                        <a href="https://www.atom.com/domain-portfolio/bluishwu/2799012" target="_blank">Atom</a>
                        <a href="https://www.afternic.com/bluish" target="_blank">Afternic</a>
                    </div>
                </div>
                <a href="faq.html" data-en="FAQ" data-cn="常见问题">FAQ</a>
            </div>
            <div class="language-switch">
                <span id="langEn">English</span>
                <span id="langCn">中文</span>
            </div>
        </div>

        <div class="filter-section">
            <div class="filter-group">
                <label for="searchInput" id="searchLabel">Search</label>
                <input type="text" id="searchInput" placeholder="Enter domain name...">
            </div>
            <div class="filter-group">
                <label for="priceFilter" id="priceLabel">Price Range</label>
                <select id="priceFilter">
                    <option value="all">All Prices</option>
                    <option value="0-500">$0 - $500</option>
                    <option value="500-1000">$500 - $1,000</option>
                    <option value="1000-2000">$1,000 - $2,000</option>
                    <option value="2000-5000">$2,000 - $5,000</option>
                    <option value="5000-10000">$5,000 - $10,000</option>
                    <option value="10000+">$10,000+</option>
                </select>
            </div>
            <div class="filter-group">
                <label for="extensionFilter" id="extensionLabel">Domain Extension</label>
                <select id="extensionFilter">
                    <option value="all">All Extensions</option>
                </select>
            </div>
            <div class="filter-group">
                <label for="extensionTypeFilter" id="extensionTypeLabel">Extension Type</label>
                <select id="extensionTypeFilter">
                    <option value="all">All Types</option>
                    <option value="gTLD">gTLD</option>
                    <option value="ccTLD">ccTLD</option>
                    <option value="newTLD">newTLD</option>
                </select>
            </div>
            <div class="filter-group">
                <label for="lengthFilter" id="lengthLabel">Domain Length</label>
                <select id="lengthFilter">
                    <option value="all">All Lengths</option>
                    <option value="1-3">1-3 Characters</option>
                    <option value="4-5">4-5 Characters</option>
                    <option value="6-7">6-7 Characters</option>
                    <option value="8+">8+ Characters</option>
                </select>
            </div>
            <div class="filter-group">
                <label for="sourceFilter" id="sourceLabel">Source</label>
                <select id="sourceFilter">
                    <option value="all">All Sources</option>
                    <option value="en">English ($)</option>
                    <option value="cn">Chinese (¥)</option>
                </select>
            </div>
            <div class="filter-group">
                <label for="typeFilter" id="typeLabel">Type</label>
                <select id="typeFilter">
                    <option value="all">All Types</option>
                </select>
            </div>
            <div class="filter-group">
                <label for="sortOption" id="sortLabel">Sort By</label>
                <select id="sortOption">
                    <option value="domain-asc">Domain (A-Z)</option>
                    <option value="domain-desc">Domain (Z-A)</option>
                    <option value="price-asc">Price (Low to High)</option>
                    <option value="price-desc">Price (High to Low)</option>
                    <option value="length-asc">Length (Short to Long)</option>
                    <option value="length-desc">Length (Long to Short)</option>
                </select>
            </div>
        </div>

        <div id="loadingIndicator" class="loading">
            <div class="spinner"></div>
            <p id="loadingText">Loading domains...</p>
        </div>

        <div id="domainCards" class="domain-cards" style="display: none;"></div>

        <div id="noResults" class="no-results" style="display: none;">
            <p id="noResultsText">No domains found matching your criteria.</p>
        </div>

        <div class="pagination" id="pagination"></div>
    </div>

    <!-- 添加模态窗口 -->
    <div id="domainModal" class="modal">
        <div class="modal-content">
            <span class="modal-close">&times;</span>
            <span class="modal-back"><i class="fas fa-arrow-left"></i></span>

            <!-- 主视图 -->
            <div class="main-view">
                <div class="modal-title-row">
                    <h2 class="modal-title">
                        <span class="modal-title-price-connector"></span>
                    </h2>
                    <div class="modal-price-container">
                        <p class="modal-price"></p>
                    </div>
                    <div class="modal-type-container"></div>
                </div>

                <!-- 浏览量和REG区域 -->
                <div class="modal-stats">
                    <div class="modal-traffic">
                        <i class="fas fa-chart-line"></i>
                        <span>0</span>
                    </div>
                    <div class="modal-reg">
                        <i class="fas fa-globe"></i>
                        <span>0</span>
                    </div>
                    <div class="modal-valuation">
                        <i class="fas fa-dollar-sign"></i>
                        <span>0</span>
                    </div>
                </div>

                <!-- 特性信息 -->
                <div class="transaction-features">
                    <div class="domain-description">
                        <p data-en="This domain is currently for sale" data-cn="该域名正在出售中">This domain is currently for sale</p>
                    </div>
                    <div class="features-separator"></div>
                    <div class="feature-item">
                        <i class="fas fa-check"></i>
                        <span data-en="Secure & Trusted Transactions" data-cn="安全可信赖的交易">Secure & Trusted Transactions</span>
                    </div>
                    <div class="feature-item">
                        <i class="fas fa-check"></i>
                        <span data-en="Fast Transfers & Support" data-cn="快速转移与支持">Fast Transfers & Support</span>
                    </div>
                    <div class="feature-item">
                        <i class="fas fa-check"></i>
                        <span data-en="Easy & Flexible Payments" data-cn="简便灵活的付款方式">Easy & Flexible Payments</span>
                    </div>
                </div>

                <!-- 联系方式区域 -->
                <div class="modal-contact">
                    <a href="javascript:$chatway.openChatwayWidget();">
                        <i class="far fa-comment"></i>
                        <span data-en="Live Chat" data-cn="在线客服">Live Chat</span>
                    </a>
                    <a href="/cdn-cgi/l/email-protection#bfccded3daffd1dacb91dbdaded3" target="_blank">
                        <i class="fas fa-envelope"></i>
                        <span data-en="Email" data-cn="邮箱">Email</span>
                    </a>
                    <a href="https://wa.me/+8613385883002" target="_blank">
                        <i class="fab fa-whatsapp"></i>
                        <span data-en="WhatsApp" data-cn="WhatsApp">WhatsApp</span>
                    </a>
                    <a href="https://t.me/bluishwu" target="_blank">
                        <i class="fab fa-telegram"></i>
                        <span data-en="TG" data-cn="电报">TG</span>
                    </a>
                </div>

                <div class="modal-buttons">
                    <button class="pay-with-atom"
                        data-domain-name="hadal.org"
                        data-domain-price="1600"
                        data-token="6817f40b9501bd00"
                        data-installments=""
                        data-down-payment=""
                        data-host-name="https://www.atom.com" >
                        <span data-en="Buy Now  With" data-cn="立即购买 通过">Buy Now</span>
                        <img src="pay.webp" alt="Atom Logo">
                    </button>
                    <button class="modal-button modal-submit" id="showOfferForm" data-en="Submit Offer" data-cn="提交报价">Submit Offer</button>
                </div>
                <div class="more-options">
                    <button class="more-options-button" id="moreOptionsBtn">
                        <span data-en="More Purchase Options" data-cn="更多购买方式">More Purchase Options</span>
                        <i class="fas fa-chevron-down"></i>
                    </button>
                    <div class="more-options-content" id="moreOptionsContent">
                        <a href="https://www.atom.com/name/" target="_blank" class="platform-link" id="atomParkLink">
                            <span>Atom.com</span>
                        </a>
                        <a href="/cdn-cgi/l/email-protection#2f5c4e434a6f414a5b014b4a4e43" class="platform-link">
                            <span data-en="Escrow/Paypal/More Options: Contact Me" data-cn="Escrow/Paypal/更多方式：直接与我联系">Escrow/Paypal/More Options: Contact Me</span>
                        </a>
                        <a href="https://www.godaddy.com/forsale/" target="_blank" class="platform-link" id="godaddyLink">
                            <span>GoDaddy</span>
                        </a>
                    </div>
                </div>

                <!-- 支付方式图片 -->
                <div class="payment-methods-footer">
                    <img src="payment_mthod.svg" alt="Payment Methods" width="100%">
                </div>
            </div>

            <!-- 报价视图 -->
            <div class="offer-view">
            <div class="modal-title-row">
                <h2 class="modal-title">
                    <span class="modal-title-price-connector"></span>
                </h2>
                <div class="modal-price-container">
                    <p class="modal-price"></p>
                </div>
                <div class="modal-type-container"></div>
            </div>

            <!-- 联系方式区域 -->
            <div class="modal-contact">
                <a href="javascript:$chatway.openChatwayWidget();">
                    <i class="far fa-comment"></i>
                    <span data-en="Live Chat" data-cn="在线客服">Live Chat</span>
                </a>
                <a href="/cdn-cgi/l/email-protection#afdccec3caefc1cadb81cbcacec3" target="_blank">
                    <i class="fas fa-envelope"></i>
                    <span data-en="Email" data-cn="邮箱">Email</span>
                </a>
                <a href="https://wa.me/+8613385883002" target="_blank">
                    <i class="fab fa-whatsapp"></i>
                    <span data-en="WhatsApp" data-cn="WhatsApp">WhatsApp</span>
                </a>
                <a href="https://t.me/bluishwu" target="_blank">
                    <i class="fab fa-telegram"></i>
                    <span data-en="TG" data-cn="电报">TG</span>
                </a>
            </div>

            <div class="modal-form">
                <div class="modal-input-group">
                    <label data-en="Domain Name" data-cn="域名">Domain Name</label>
                    <input type="text" id="modalDomain" readonly>
                    <div class="modal-error" id="modalDomainError" data-en="Please enter a domain" data-cn="请输入域名"></div>
                </div>
                <div class="modal-input-group">
                    <label data-en="Your Offer" data-cn="您的报价">Your Offer</label>
                    <input type="number" id="modalPrice" step="10" min="0">
                    <div class="modal-error" id="modalPriceError" data-en="Please enter your offer price" data-cn="请输入报价"></div>
                </div>
                <div class="modal-input-group">
                    <label data-en="Your Email" data-cn="您的邮箱">Your Email</label>
                    <input type="email" id="modalEmail">
                    <div class="modal-error" id="modalEmailError" data-en="Please enter a valid email address" data-cn="请输入有效的邮箱地址"></div>
                </div>
                <div class="modal-input-group">
                    <label data-en="Message" data-cn="留言">Message</label>
                    <textarea id="modalMessage" rows="3"></textarea>
                </div>
                <div id="modalTurnstileContainer"></div>

                <button class="modal-button modal-submit" id="modalSubmit" data-en="Submit Offer" data-cn="提交报价">Submit Offer</button>
                </div>
            </div>
        </div>
    </div>

    <div id="successMessage" class="success-message"></div>

    <script data-cfasync="false" src="/cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script type="1e3902d5ea8b33bc42169c10-text/javascript">
        // 在scripts部分的开始添加isEnglish变量的全局定义
        window.isEnglish = true; // 默认为英语，将在initLanguage函数中更新

        // 添加域名估价缓存
        const domainValuationCache = {};

        // 获取域名估价的函数 - 简化为只返回缓存中的数据
        function getDomainValuation(domainName) {
            // 转换为小写进行比较
            const domainLower = domainName.toLowerCase();

            // 首先精确匹配
            if (domainValuationCache[domainName]) {
                return domainValuationCache[domainName];
            }

            // 然后尝试小写匹配
            for (const domain in domainValuationCache) {
                if (domain.toLowerCase() === domainLower) {
                    return domainValuationCache[domain];
                }
            }

            return null;
        }

        // 修改initLanguage函数，确保isEnglish成为全局变量
        /* REMOVE THIS GLOBAL initLanguage function
        function initLanguage() {
            // 检查URL参数
            const urlParams = new URLSearchParams(window.location.search);
            const langParam = urlParams.get('lang');

            if (langParam) {
                // 如果URL中有语言参数，优先使用URL参数
                window.isEnglish = langParam !== 'cn';
            } else {
                // 获取浏览器语言设置
                const browserLang = navigator.language || navigator.userLanguage;
                window.isEnglish = !browserLang.toLowerCase().startsWith('zh');
            }

            // 设置激活状态
            document.querySelectorAll('.language-switch span').forEach(span => {
                span.classList.remove('active');
            });
            document.getElementById(window.isEnglish ? 'langEn' : 'langCn').classList.add('active');

            // 更新URL参数
            const url = new URL(window.location);
            url.searchParams.set('lang', window.isEnglish ? 'en' : 'cn');
            window.history.replaceState({}, '', url);

            updateLanguage();
        }
        */

        // 语言切换处理函数也需要使用全局变量
        /* REMOVE THIS GLOBAL event listener for language switch
        document.querySelectorAll('.language-switch span').forEach(span => {
            span.addEventListener('click', function() {
                const clickedLang = this.id === 'langEn' ? 'en' : 'cn';
                window.isEnglish = clickedLang === 'en';

                // 更新激活状态
                document.querySelectorAll('.language-switch span').forEach(s => {
                    s.classList.remove('active');
                });
                this.classList.add('active');

                updateLanguage();

                // 更新URL参数
                const url = new URL(window.location);
                url.searchParams.set('lang', window.isEnglish ? 'en' : 'cn');
                window.history.replaceState({}, '', url);
            });
        });
        */

        document.addEventListener('DOMContentLoaded', function() {
            // 移除创建气泡的函数和调用
            function createBubbles() {
                // 移除此函数内容
            }

            // 添加防抖函数
            function debounce(func, wait) {
                let timeout;
                return function executedFunction(...args) {
                    const later = () => {
                        clearTimeout(timeout);
                        func(...args);
                    };
                    clearTimeout(timeout);
                    timeout = setTimeout(later, wait);
                };
            }

            // 语言设置
            let isEnglish = true;
            const languageToggle = document.getElementById('languageToggle');

            // 域名数据和筛选
            let allDomains = [];
            let filteredDomains = [];
            let currentPage = 1;
            let domainsPerPage = 20;
            let domainExtensions = new Set();

            // 定义TLD类型
            const gTLDs = ['.com', '.net', '.org', '.info', '.biz', '.name', '.pro', '.aero', '.asia', '.cat', '.coop', '.edu', '.gov', '.int', '.jobs', '.mil', '.mobi', '.museum', '.post', '.tel', '.travel', '.xxx'];
            const ccTLDs = ['.cn', '.us', '.uk', '.ca', '.au', '.de', '.jp', '.fr', '.ru', '.br', '.in', '.it', '.nl', '.es', '.kr', '.eu', '.tw', '.hk', '.sg'];
            const newTLDs = ['.blog', '.shop', '.store', '.tech', '.online', '.site', '.website', '.club', '.design', '.agency', '.digital', '.studio', '.media', '.cloud', '.email', '.solutions', '.network', '.ventures', '.academy', '.guru', '.company'];

            // 获取TLD类型
            function getTLDType(extension) {
                // 检查是否为两位数后缀
                if (extension.length === 3 && extension.charAt(0) === '.') {
                    return 'ccTLD';
                }
                if (gTLDs.includes(extension)) return 'gTLD';
                if (ccTLDs.includes(extension)) return 'ccTLD';
                if (newTLDs.includes(extension)) return 'newTLD';
                return 'newTLD'; // 其他所有后缀均视为NewTLD
            }

            // 排序状态
            let sortConfig = {
                column: 'price',
                direction: 'desc'
            };

            // 初始化语言
            function initLanguage() {
                // 检查URL参数
                const urlParams = new URLSearchParams(window.location.search);
                const langParam = urlParams.get('lang');

                if (langParam) {
                    // 如果URL中有语言参数，优先使用URL参数
                    window.isEnglish = langParam !== 'cn';
                } else {
                    // 获取浏览器语言设置
                    const browserLang = navigator.language || navigator.userLanguage;
                    window.isEnglish = !browserLang.toLowerCase().startsWith('zh');
                }

                // 设置激活状态
                document.querySelectorAll('.language-switch span').forEach(span => {
                    span.classList.remove('active');
                });
                document.getElementById(window.isEnglish ? 'langEn' : 'langCn').classList.add('active');

                // 更新URL参数
                const url = new URL(window.location);
                url.searchParams.set('lang', window.isEnglish ? 'en' : 'cn');
                window.history.replaceState({}, '', url);

                updateLanguage();
            }

            // 更新页面语言
            function updateLanguage() {
                // 更新HTML标签的lang属性
                document.documentElement.setAttribute('lang', window.isEnglish ? 'en' : 'cn');

                // 更新导航栏文本
                const navLinks = {
                    home: { en: 'Home', cn: '首页' },
                    domains: { en: 'Domain List', cn: '域名列表' },
                    afternic: { en: 'Afternic', cn: 'Afternic' },
                    atom: { en: 'Atom', cn: 'Atom' },
                    marketplace: { en: 'Marketplace', cn: '售卖平台' },
                    contact: { en: 'Contact', cn: '联系我们' },
                    email: { en: 'Email', cn: '邮件' },
                    whatsapp: { en: 'WhatsApp', cn: 'WhatsApp' }, // 添加WhatsApp翻译
                    telegram: { en: 'TG', cn: '电报' }
                };

                // 更新导航链接文本
                document.querySelectorAll('.nav-links a').forEach(link => {
                    const href = link.getAttribute('href');
                    if (href === '/') {
                        link.textContent = window.isEnglish ? navLinks.home.en : navLinks.home.cn;
                    } else if (href === '/domains-page') {
                        link.textContent = window.isEnglish ? navLinks.domains.en : navLinks.domains.cn;
                    } else if (href.includes('afternic') && !link.closest('.nav-dropdown-content')) {
                        // 跳过子菜单中的afternic链接
                        return;
                    } else if (href.includes('atom.com/domain-portfolio') && !link.closest('.nav-dropdown-content')) {
                        link.textContent = window.isEnglish ? navLinks.marketplace.en : navLinks.marketplace.cn;
                    } else if (href.includes('mailto')) {
                        link.textContent = window.isEnglish ? navLinks.contact.en : navLinks.contact.cn;
                    }
                });

                // 更新下拉菜单选项
                document.querySelectorAll('.nav-dropdown-content a').forEach(link => {
                    const href = link.getAttribute('href');
                    if (href.includes('mailto')) {
                        link.textContent = window.isEnglish ? navLinks.email.en : navLinks.email.cn;
                    } else if (href.includes('wa.me')) { // 添加WhatsApp处理
                        link.textContent = window.isEnglish ? navLinks.whatsapp.en : navLinks.whatsapp.cn;
                    } else if (href.includes('telegram')) {
                        link.textContent = window.isEnglish ? navLinks.telegram.en : navLinks.telegram.cn;
                    } else if (href.includes('afternic')) {
                        link.textContent = navLinks.afternic[window.isEnglish ? 'en' : 'cn'];
                    } else if (href.includes('atom.com/domain-portfolio')) {
                        link.textContent = navLinks.atom[window.isEnglish ? 'en' : 'cn'];
                    }
                });

                // 更新筛选区域文本
                document.getElementById('searchLabel').textContent = window.isEnglish ? 'Search' : '搜索';
                document.getElementById('searchInput').placeholder = window.isEnglish ? 'Enter domain name...' : '输入域名...';
                document.getElementById('priceLabel').textContent = window.isEnglish ? 'Price Range' : '价格范围';
                document.getElementById('extensionLabel').textContent = window.isEnglish ? 'Domain Extension' : '域名后缀';
                document.getElementById('lengthLabel').textContent = window.isEnglish ? 'Domain Length' : '域名长度';
                document.getElementById('sourceLabel').textContent = window.isEnglish ? 'Source' : '来源';
                document.getElementById('sortLabel').textContent = window.isEnglish ? 'Sort By' : '排序方式';
                document.getElementById('loadingText').textContent = window.isEnglish ? 'Loading domains...' : '加载域名中...';
                document.getElementById('noResultsText').textContent = window.isEnglish ? 'No domains found matching your criteria.' : '没有找到符合条件的域名。';

                // 更新后缀类型筛选标签
                document.getElementById('extensionTypeLabel').textContent = window.isEnglish ? 'Extension Type' : '后缀类型';
                const extensionTypeFilter = document.getElementById('extensionTypeFilter');
                const currentExtTypeValue = extensionTypeFilter.value;
                extensionTypeFilter.innerHTML = '';

                if (window.isEnglish) {
                    extensionTypeFilter.innerHTML = `
                        <option value="all">All Types</option>
                        <option value="gTLD">gTLD</option>
                        <option value="ccTLD">ccTLD</option>
                        <option value="newTLD">newTLD</option>
                    `;
                } else {
                    extensionTypeFilter.innerHTML = `
                        <option value="all">所有类型</option>
                        <option value="gTLD">通用顶级域名</option>
                        <option value="ccTLD">国家代码顶级域名</option>
                        <option value="newTLD">新顶级域名</option>
                    `;
                }
                extensionTypeFilter.value = currentExtTypeValue;

                // 更新价格筛选选项
                const priceFilter = document.getElementById('priceFilter');
                priceFilter.innerHTML = '';

                if (window.isEnglish) {
                    priceFilter.innerHTML = `
                        <option value="all">All Prices</option>
                        <option value="0-500">$0 - $500</option>
                        <option value="500-1000">$500 - $1,000</option>
                        <option value="1000-2000">$1,000 - $2,000</option>
                        <option value="2000-5000">$2,000 - $5,000</option>
                        <option value="5000-10000">$5,000 - $10,000</option>
                        <option value="10000+">$10,000+</option>
                    `;
                } else {
                    priceFilter.innerHTML = `
                        <option value="all">所有价格</option>
                        <option value="0-500">¥0 - ¥500</option>
                        <option value="500-1000">¥500 - ¥1,000</option>
                        <option value="1000-2000">¥1,000 - ¥2,000</option>
                        <option value="2000-5000">¥2,000 - ¥5,000</option>
                        <option value="5000-10000">¥5,000 - ¥10,000</option>
                        <option value="10000+">¥10,000+</option>
                    `;
                }

                // 更新长度筛选选项
                const lengthFilter = document.getElementById('lengthFilter');
                lengthFilter.innerHTML = '';

                if (window.isEnglish) {
                    lengthFilter.innerHTML = `
                        <option value="all">All Lengths</option>
                        <option value="1-3">1-3 Characters</option>
                        <option value="4-5">4-5 Characters</option>
                        <option value="6-7">6-7 Characters</option>
                        <option value="8+">8+ Characters</option>
                    `;
                } else {
                    lengthFilter.innerHTML = `
                        <option value="all">所有长度</option>
                        <option value="1-3">1-3 个字符</option>
                        <option value="4-5">4-5 个字符</option>
                        <option value="6-7">6-7 个字符</option>
                        <option value="8+">8+ 个字符</option>
                    `;
                }

                // 更新来源筛选选项
                const sourceFilter = document.getElementById('sourceFilter');
                sourceFilter.innerHTML = '';

                if (window.isEnglish) {
                    sourceFilter.innerHTML = `
                        <option value="all">All Sources</option>
                        <option value="en">English ($)</option>
                        <option value="cn">Chinese (¥)</option>
                    `;
                } else {
                    sourceFilter.innerHTML = `
                        <option value="all">所有来源</option>
                        <option value="en">英文 ($)</option>
                        <option value="cn">中文 (¥)</option>
                    `;
                }

                // 更新排序选项
                const sortOption = document.getElementById('sortOption');
                const currentValue = sortOption.value;
                sortOption.innerHTML = '';

                if (window.isEnglish) {
                    sortOption.innerHTML = `
                        <option value="domain-asc">Domain (A-Z)</option>
                        <option value="domain-desc">Domain (Z-A)</option>
                        <option value="price-asc">Price (Low to High)</option>
                        <option value="price-desc">Price (High to Low)</option>
                        <option value="length-asc">Length (Short to Long)</option>
                        <option value="length-desc">Length (Long to Short)</option>
                    `;
                } else {
                    sortOption.innerHTML = `
                        <option value="domain-asc">域名 (A-Z)</option>
                        <option value="domain-desc">域名 (Z-A)</option>
                        <option value="price-asc">价格 (从低到高)</option>
                        <option value="price-desc">价格 (从高到低)</option>
                        <option value="length-asc">长度 (从短到长)</option>
                        <option value="length-desc">长度 (从长到短)</option>
                    `;
                }
                sortOption.value = currentValue;

                // 更新后缀选项
                updateExtensionOptions();

                // 更新类型筛选标签文本
                document.getElementById('typeLabel').textContent = window.isEnglish ? 'Label Type' : '标签类型';

                // 强制更新类型选项，无论是否已有数据
                const typeFilter = document.getElementById('typeFilter');
                if (typeFilter) {
                    const currentValue = typeFilter.value;
                    typeFilter.innerHTML = '';

                    const defaultOption = document.createElement('option');
                    defaultOption.value = 'all';
                    defaultOption.textContent = window.isEnglish ? 'All Types' : '所有类型';
                    typeFilter.appendChild(defaultOption);

                    // 如果已经有数据，则填充完整的类型选项
                    if (allDomains && allDomains.length > 0) {
                        updateTypeOptions();
                    }

                    // 恢复之前的选择
                    if (currentValue && Array.from(typeFilter.options).some(opt => opt.value === currentValue)) {
                        typeFilter.value = currentValue;
                    }
                }

                // 更新已显示的促销标签
                document.querySelectorAll('.domain-card-type').forEach(typeSpan => {
                    if (typeSpan.getAttribute('data-type') === 'promo' || typeSpan.getAttribute('data-type') === '促销') {
                        typeSpan.textContent = window.isEnglish ? 'Promo' : '促销';
                    } else if (typeSpan.getAttribute('data-type') === 'word') {
                        typeSpan.textContent = window.isEnglish ? 'Word' : '单词';
                    }
                });

                // 更新域名数据中的促销标签
                allDomains.forEach(domain => {
                    if (domain.types) {
                        domain.types = domain.types.map(type => {
                            if (type.toLowerCase() === 'promo' || type.toLowerCase() === '促销') {
                                return window.isEnglish ? 'Promo' : '促销';
                            } else if (type.toLowerCase() === 'word') {
                                return window.isEnglish ? 'Word' : '单词';
                            }
                            return type;
                        });
                        domain.type = domain.types.join(', ');
                    }
                });

                // 更新模态窗口语言
                updateModalLanguage();
            }

            // 更新域名后缀选项
            function updateExtensionOptions() {
                const extensionFilter = document.getElementById('extensionFilter');
                const currentValue = extensionFilter.value;

                // 清空现有选项
                extensionFilter.innerHTML = '';

                // 添加"全部"选项
                const allOption = document.createElement('option');
                allOption.value = 'all';
                allOption.textContent = window.isEnglish ? 'All Extensions' : '所有后缀';
                extensionFilter.appendChild(allOption);

                // 统计每个后缀的数量
                const extensionCounts = {};
                allDomains.forEach(domain => {
                    if (!domain.extension) return; // Guard against undefined extensions
                    if (!extensionCounts[domain.extension]) {
                        extensionCounts[domain.extension] = 0;
                    }
                    extensionCounts[domain.extension]++;
                });

                const allUniqueExtensions = Array.from(domainExtensions);
                const preferredTlds = ['.com', '.net', '.org'];

                // 1. Get the preferred TLDs that actually exist in our data, in the desired order
                const sortedPreferred = preferredTlds.filter(tld => allUniqueExtensions.includes(tld));

                // 2. Get the other TLDs
                const otherTlds = allUniqueExtensions.filter(tld => !preferredTlds.includes(tld));

                // 3. Sort the other TLDs alphabetically
                otherTlds.sort((a, b) => {
                    // Ensure consistent sorting, treating extensions without a leading dot properly (though our data has them)
                    const nameA = a.startsWith('.') ? a.substring(1) : a;
                    const nameB = b.startsWith('.') ? b.substring(1) : b;
                    return nameA.localeCompare(nameB);
                });

                // 4. Combine the lists
                // const sortedExtensions = [...sortedPreferred, ...otherTlds];

                // Add preferred TLDs first
                sortedPreferred.forEach(ext => {
                    if (!extensionCounts[ext]) return;
                    const option = document.createElement('option');
                    option.value = ext;
                    option.textContent = `${ext} (${extensionCounts[ext]})`;
                    extensionFilter.appendChild(option);
                });

                // Add a separator if there are other TLDs to show after preferred ones
                if (otherTlds.length > 0 && sortedPreferred.length > 0) {
                    const separatorOption = document.createElement('option');
                    separatorOption.disabled = true;
                    separatorOption.textContent = '──────────';
                    separatorOption.style.color = 'var(--border-color)'; // Use a muted color
                    separatorOption.style.textAlign = 'center';
                    // separatorOption.style.backgroundColor = 'var(--background-color)'; // Optional: match background
                    extensionFilter.appendChild(separatorOption);
                }

                // Add other TLDs
                otherTlds.forEach(ext => {
                    if (!extensionCounts[ext]) return; // Only add if count exists
                    const option = document.createElement('option');
                    option.value = ext;
                    option.textContent = `${ext} (${extensionCounts[ext]})`;
                    extensionFilter.appendChild(option);
                });

                // Restore previous selection (moved from original sortedExtensions loop)
                // This logic needs to be outside the forEach loops, after all options are added.
                // However, the original sortedExtensions variable is no longer a flat list of all options in order.
                // For simplicity, we'll try to restore the value directly.
                if (currentValue && Array.from(extensionFilter.options).some(opt => opt.value === currentValue)) {
                    extensionFilter.value = currentValue;
                }
            }

            // 更新类型筛选函数
            function updateTypeOptions() {
                const typeFilter = document.getElementById('typeFilter');
                if (!typeFilter) return;

                const currentTypeValue = typeFilter.value;

                // 检查是否已有选项，如果没有，添加默认选项
                if (typeFilter.options.length === 0) {
                    const defaultOption = document.createElement('option');
                    defaultOption.value = 'all';
                    defaultOption.textContent = window.isEnglish ? 'All Types' : '所有类型';
                    typeFilter.appendChild(defaultOption);
                } else {
                    // 保留第一个选项（默认选项），清除其他选项
                    const defaultOption = typeFilter.options[0];
                    typeFilter.innerHTML = '';
                    typeFilter.appendChild(defaultOption);

                    // 确保默认选项文本是正确的语言
                    defaultOption.textContent = window.isEnglish ? 'All Types' : '所有类型';
                }

                const typeStats = {};

                // 首先标准化所有类型
                allDomains.forEach(domain => {
                    if (domain.types && domain.types.length > 0) {
                        // 遍历每个域名的所有类型
                        domain.types.forEach(type => {
                            if (type) {
                                let normalizedType = type.trim();

                                // 标准化促销类型
                                if (normalizedType.toLowerCase() === 'promo' || normalizedType.toLowerCase() === '促销') {
                                    normalizedType = window.isEnglish ? 'Promo' : '促销';
                                } else if (normalizedType.toLowerCase() === 'word' || normalizedType.toLowerCase() === '单词') {
                                    normalizedType = window.isEnglish ? 'Word' : '单词';
                                } else if (normalizedType.toLowerCase() === 'hack') {
                                    normalizedType = 'Hack';
                                } else if (normalizedType.toLowerCase() === 'hot') {
                                    normalizedType = 'Hot';
                                }

                                if (normalizedType) {
                                    if (!typeStats[normalizedType]) {
                                        typeStats[normalizedType] = 0;
                                    }
                                    typeStats[normalizedType]++;
                                }
                            }
                        });
                    }
                });

                Object.entries(typeStats)
                    .sort(([,a], [,b]) => b - a)
                    .forEach(([type, count]) => {
                        const option = document.createElement('option');
                        option.value = type;
                        option.textContent = `${type} (${count})`;
                        typeFilter.appendChild(option);
                    });

                // 特殊处理当前选中的值
                if (currentTypeValue) {
                    // 如果当前值是促销相关
                    if (currentTypeValue.toLowerCase() === 'promo' || currentTypeValue.toLowerCase() === '促销') {
                        const newValue = window.isEnglish ? 'Promo' : '促销';
                        // 查找对应的新选项
                        const newOption = Array.from(typeFilter.options).find(opt =>
                            opt.value.toLowerCase() === newValue.toLowerCase());
                        if (newOption) {
                            typeFilter.value = newOption.value;
                        }
                    } else if (currentTypeValue.toLowerCase() === 'word' || currentTypeValue.toLowerCase() === '单词') {
                        const newValue = window.isEnglish ? 'Word' : '单词';
                        // 查找对应的新选项
                        const newOption = Array.from(typeFilter.options).find(opt =>
                            opt.value.toLowerCase() === newValue.toLowerCase());
                        if (newOption) {
                            typeFilter.value = newOption.value;
                        }
                    } else if (currentTypeValue.toLowerCase() === 'hack') {
                        // 查找对应的新选项
                        const newOption = Array.from(typeFilter.options).find(opt =>
                            opt.value.toLowerCase() === 'hack');
                        if (newOption) {
                            typeFilter.value = newOption.value;
                        }
                    } else if (currentTypeValue.toLowerCase() === 'hot') {
                        // 查找对应的新选项
                        const newOption = Array.from(typeFilter.options).find(opt =>
                            opt.value.toLowerCase() === 'hot');
                        if (newOption) {
                            typeFilter.value = newOption.value;
                        }
                    } else if (Array.from(typeFilter.options).some(opt => opt.value === currentTypeValue)) {
                        typeFilter.value = currentTypeValue;
                    }
                }
            }

            // 计算每页应显示的域名数量
            function calculateDomainsPerPage() {
                const domainCards = document.querySelector('.domain-cards');
                if (!domainCards) return 20;

                const containerWidth = domainCards.clientWidth;
                const containerHeight = domainCards.clientHeight;
                const cardWidth = 200; // 最小卡片宽度
                const cardHeight = 90; // 卡片高度
                const gap = 16; // 间距

                // 计算可以容纳的列数和行数
                const columns = Math.floor((containerWidth + gap) / (cardWidth + gap));
                const rows = Math.floor((containerHeight + gap) / (cardHeight + gap));

                // 确保至少显示一行
                const minRows = Math.max(1, rows);

                // 计算每页显示的数量，确保至少显示一屏的内容
                const count = Math.max(columns * minRows, 20);

                if (domainsPerPage !== count) {
                    domainsPerPage = count;
                    return true;
                }
                return false;
            }

            // 添加窗口大小变化监听
            window.addEventListener('resize', debounce(() => {
                if (calculateDomainsPerPage()) {
                updateDomainDisplay();
            }
            }, 250));

            // 监听DOM变化
            const observer = new MutationObserver((mutations) => {
                for (const mutation of mutations) {
                    if (mutation.type === 'attributes' &&
                        mutation.attributeName === 'style' &&
                        mutation.target.id === 'domainCards') {
                        if (calculateDomainsPerPage()) {
                            updateDomainDisplay();
                        }
                    }
                }
            });

            // 初始化显示
            function initializeDisplay() {
                const domainCards = document.getElementById('domainCards');
                if (domainCards) {
                    observer.observe(domainCards, {
                        attributes: true,
                        attributeFilter: ['style']
                    });
                }

                // 显示卡片容器并强制重新计算布局
                if (domainCards) {
                    domainCards.style.display = 'grid';
                    // 强制浏览器重新计算布局
                    void domainCards.offsetHeight;
                    calculateDomainsPerPage();
                    updateDomainDisplay();
                }
            }

            // 在fetchDomains函数之前添加新的函数
            async function fetchMatomoCampaignData() {
                try {
                    const response = await fetch('/matomo-campaigns', {
                        method: 'GET',
                        headers: {
                            'Accept': 'application/json'
                        }
                    });

                    if (!response.ok) {
                        throw new Error('Failed to fetch campaign data');
                    }

                    return await response.json();
                } catch (error) {
                    // console.error('Error fetching campaign data:', error);
                    return {};
                }
            }

            // 处理域名数据的函数
            function processDomainData(enData, cnData, campaignData, regData) {
                let combinedDomains = [];

                if (Array.isArray(enData)) {
                    combinedDomains = enData.map(([domain, price, note, type]) => {
                        const extension = '.' + domain.split('.').slice(1).join('.');
                        domainExtensions.add(extension);

                        let numericPrice = price;
                        if (typeof price === 'string') {
                            numericPrice = parseInt(price.replace(/[^0-9]/g, '')) || 0;
                        }

                        const domainType = type ? type.trim() : '';
                        const typeArray = domainType ? domainType.split(',').map(t => t.trim()).filter(t => t) : [];

                        const normalizedTypes = typeArray.map(t => {
                            if (t.toLowerCase() === 'promo' || t.toLowerCase() === '促销') {
                                return window.isEnglish ? 'Promo' : '促销';
                            } else if (t.toLowerCase() === 'hack') {
                                return 'Hack';
                            } else if (t.toLowerCase() === 'hot') {
                                return 'Hot';
                            } else {
                                return t;
                            }
                        });

                        // 获取访问量和REG数据
                        const campaignCount = campaignData[domain.toLowerCase()] || 0;
                        const regCount = regData[domain] || regData[domain.toLowerCase()] || 0;

                        return {
                            domain: domain,
                            extension: extension,
                            price: price,
                            numericPrice: numericPrice,
                            length: domain.split('.')[0].length,
                            source: 'en',
                            note: note || '',
                            types: normalizedTypes,
                            type: normalizedTypes.join(', '),
                            extensionType: getTLDType(extension),
                            campaignCount: campaignCount,
                            regCount: regCount
                        };
                    });
                }

                if (Array.isArray(cnData)) {
                    const cnDomains = cnData.map(([domain, price, note, type]) => {
                        const extension = '.' + domain.split('.').slice(1).join('.');
                        domainExtensions.add(extension);

                        let numericPrice = price;
                        if (typeof price === 'string') {
                            numericPrice = parseInt(price.replace(/[^0-9]/g, '')) || 0;
                        }

                        const domainType = type ? type.trim() : '';
                        const typeArray = domainType ? domainType.split(',').map(t => t.trim()).filter(t => t) : [];

                        const normalizedTypes = typeArray.map(t => {
                            if (t.toLowerCase() === 'promo' || t.toLowerCase() === '促销') {
                                return window.isEnglish ? 'Promo' : '促销';
                            } else if (t.toLowerCase() === 'hack') {
                                return 'Hack';
                            } else if (t.toLowerCase() === 'hot') {
                                return 'Hot';
                            } else {
                                return t;
                            }
                        });

                        // 获取访问量和REG数据
                        const campaignCount = campaignData[domain.toLowerCase()] || 0;
                        const regCount = regData[domain] || regData[domain.toLowerCase()] || 0;

                        return {
                            domain: domain,
                            extension: extension,
                            price: price,
                            numericPrice: numericPrice / 7,
                            length: domain.split('.')[0].length,
                            source: 'cn',
                            note: note || '',
                            types: normalizedTypes,
                            type: normalizedTypes.join(', '),
                            extensionType: getTLDType(extension),
                            campaignCount: campaignCount,
                            regCount: regCount
                        };
                    });

                    cnDomains.forEach(cnDomain => {
                        const existingIndex = combinedDomains.findIndex(d => d.domain.toLowerCase() === cnDomain.domain.toLowerCase());
                        if (existingIndex === -1) {
                            combinedDomains.push(cnDomain);
                        }
                    });
                }

                if (combinedDomains.length === 0) {
                    document.getElementById('loadingIndicator').style.display = 'none';
                    document.getElementById('noResults').style.display = 'flex';
                    document.getElementById('noResultsText').textContent = window.isEnglish ?
                        'No domains found. Please try again later.' :
                        '未找到域名数据，请稍后再试。';
                    return;
                }

                allDomains = combinedDomains;

                updateExtensionOptions();
                updateTypeOptions();

                // 设置排序下拉框的默认值
                const sortOption = document.getElementById('sortOption');
                if (sortOption) {
                    sortOption.value = 'price-desc';
                }

                // 应用初始排序
                sortDomains('price', 'desc');
                updateMarquee(combinedDomains);
                applyFilters();

                // 处理 URL 参数
                handleUrlParams();

                // 显示域名数据
                updateDomainDisplay();

                // 隐藏加载指示器
                document.getElementById('loadingIndicator').style.display = 'none';
            }

            // 后台更新数据函数
            function fetchLatestDataInBackground() {
                Promise.all([
                    fetch('/domains?lang=en'),
                    fetch('/domains?lang=cn'),
                    fetch('/matomo-campaigns'),
                    fetch('/domain-reg'),
                    fetch('/domain-valuation')  // 添加域名估价数据请求
                ])
                .then(async ([enResponse, cnResponse, campaignResponse, regResponse, valuationResponse]) => {
                    if (!enResponse.ok || !cnResponse.ok || !campaignResponse.ok || !regResponse.ok || !valuationResponse.ok) {
                        throw new Error('一个或多个API请求失败');
                    }

                    const [enData, cnData, campaignData, regData, valuationData] = await Promise.all([
                        enResponse.json(),
                        cnResponse.json(),
                        campaignResponse.json(),
                        regResponse.json(),
                        valuationResponse.json()
                    ]);

                    // 更新估价缓存 (这一步仍然保留，以备后用或直接访问)
                    Object.assign(domainValuationCache, valuationData);

                    // 保存到本地存储，包含估价数据
                    const cacheData = {
                        en: enData,
                        cn: cnData,
                        campaigns: campaignData,
                        regData: regData,
                        valuationData: valuationData, // 添加估价数据
                        timestamp: Date.now(),
                        language: window.isEnglish ? 'en' : 'cn'
                    };

                    try {
                        localStorage.setItem('domainData', JSON.stringify(cacheData));
                        // console.log('域名数据已在后台更新并缓存');
                    } catch (e) {
                        // console.warn('无法保存缓存数据:', e);
                    }
                })
                .catch(error => {
                    // console.error('后台更新数据出错:', error);
                });
            }

            // 修改fetchDomains函数
            function fetchDomains() {
                // 尝试从缓存获取数据
                try {
                    const cachedDataStr = localStorage.getItem('domainData');
                    if (cachedDataStr) {
                        const cachedData = JSON.parse(cachedDataStr);
                        const cacheAge = Date.now() - (cachedData.timestamp || 0);
                        const cacheLanguage = cachedData.language || 'en';
                        const currentLanguage = window.isEnglish ? 'en' : 'cn';

                        // 如果缓存存在且不超过10分钟且语言匹配
                        if (cacheAge < 10 * 60 * 1000 && cacheLanguage === currentLanguage) {
                            // console.log('使用缓存数据，缓存年龄:', Math.round(cacheAge / 1000 / 60), '分钟');

                            // 立即用缓存的估价数据填充 domainValuationCache
                            if (cachedData.valuationData) {
                                Object.assign(domainValuationCache, cachedData.valuationData);
                                // console.log('已从缓存加载估价数据');
                            }

                            // 处理缓存的数据
                            processDomainData(
                                cachedData.en,
                                cachedData.cn,
                                cachedData.campaigns,
                                cachedData.regData
                            );

                            // 后台更新缓存
                            setTimeout(fetchLatestDataInBackground, 3000);
                            return;
                        } else {
                            // console.log('缓存已过期或语言不匹配，重新获取数据');
                        }
                    }
                } catch (e) {
                    // console.warn('读取缓存数据出错:', e);
                }

                // 如果没有有效缓存，显示加载指示器并获取数据
                document.getElementById('loadingIndicator').style.display = 'flex';
                document.getElementById('domainCards').style.display = 'none';
                document.getElementById('noResults').style.display = 'none';

                // 同时获取域名数据、广告活动数据和REG数据
                Promise.all([
                    fetch('/domains?lang=en'),
                    fetch('/domains?lang=cn'),
                    fetch('/matomo-campaigns'),
                    fetch('/domain-reg'),
                    fetch('/domain-valuation')  // 添加域名估价数据请求
                ])
                .then(async ([enResponse, cnResponse, campaignResponse, regResponse, valuationResponse]) => {
                    if (!enResponse.ok) {
                        throw new Error(`EN API responded with status: ${enResponse.status}`);
                    }
                    if (!cnResponse.ok) {
                        throw new Error(`CN API responded with status: ${cnResponse.status}`);
                    }

                    const [enData, cnData] = await Promise.all([
                        enResponse.json(),
                        cnResponse.json()
                    ]);

                    // 获取访问量数据和REG数据及估价数据
                    const campaignData = await campaignResponse.json();
                    const regData = await regResponse.json();
                    const valuationData = await valuationResponse.json();

                    // 更新估价缓存
                    Object.assign(domainValuationCache, valuationData);

                    // 保存到本地存储
                    try {
                        localStorage.setItem('domainData', JSON.stringify({
                            en: enData,
                            cn: cnData,
                            campaigns: campaignData,
                            regData: regData,
                            valuationData: valuationData, // <-- Add valuationData here
                            timestamp: Date.now(),
                            language: window.isEnglish ? 'en' : 'cn'
                        }));
                    } catch (e) {
                        // console.warn('无法保存缓存数据:', e);
                    }

                    // 处理数据
                    processDomainData(enData, cnData, campaignData, regData);
                })
                .catch(error => {
                    document.getElementById('loadingIndicator').style.display = 'none';
                    document.getElementById('noResults').style.display = 'flex';
                    document.getElementById('noResultsText').textContent = window.isEnglish ?
                        `Error loading domains: ${error.message}` :
                        `加载域名时出错: ${error.message}`;
                });
            }

            // 应用筛选条件
            function applyFilters() {
                const searchTerm = document.getElementById('searchInput').value.toLowerCase();
                const priceRange = document.getElementById('priceFilter').value;
                const lengthRange = document.getElementById('lengthFilter').value;
                const sourceFilter = document.getElementById('sourceFilter').value;
                const extensionFilter = document.getElementById('extensionFilter').value;
                const typeFilter = document.getElementById('typeFilter').value;
                const extensionTypeFilter = document.getElementById('extensionTypeFilter').value;

                filteredDomains = allDomains.filter(domain => {
                    // 搜索筛选
                    if (searchTerm && !domain.domain.toLowerCase().includes(searchTerm)) {
                        return false;
                    }

                    // 后缀筛选
                    if (extensionFilter !== 'all' && domain.extension !== extensionFilter) {
                        return false;
                    }

                    // 后缀类型筛选
                    if (extensionTypeFilter !== 'all' && domain.extensionType !== extensionTypeFilter) {
                        return false;
                    }

                    // 价格筛选
                    if (priceRange !== 'all') {
                        let comparePrice;
                        if (!window.isEnglish) {
                            comparePrice = domain.source === 'en' ?
                                domain.numericPrice * 7 :
                                domain.numericPrice * 7;
                        } else {
                            comparePrice = domain.numericPrice;
                        }

                        if (priceRange === '10000+') {
                            if (comparePrice < 10000) return false;
                        } else {
                            const [min, max] = priceRange.split('-').map(Number);
                            if (comparePrice < min || comparePrice > max) return false;
                        }
                    }

                    // 长度筛选
                    if (lengthRange !== 'all') {
                        if (lengthRange === '8+') {
                            if (domain.length < 8) return false;
                        } else {
                            const [min, max] = lengthRange.split('-').map(Number);
                            if (domain.length < min || domain.length > max) return false;
                        }
                    }

                    // 来源筛选
                    if (sourceFilter !== 'all' && domain.source !== sourceFilter) {
                        return false;
                    }

                    // 类型筛选
                    if (typeFilter !== 'all') {
                        // 特殊处理促销类型
                        if (typeFilter.toLowerCase() === 'promo' || typeFilter.toLowerCase() === '促销') {
                            // 检查是否有任何类型匹配促销
                            if (!domain.types || !domain.types.some(t =>
                                t.toLowerCase() === 'promo' || t.toLowerCase() === '促销')) {
                                return false;
                            }
                        }
                        // 特殊处理单词类型
                        else if (typeFilter.toLowerCase() === 'word' || typeFilter.toLowerCase() === '单词') {
                            // 检查是否有任何类型匹配单词
                            if (!domain.types || !domain.types.some(t =>
                                t.toLowerCase() === 'word' || t.toLowerCase() === '单词')) {
                                return false;
                            }
                        }
                        else if (!domain.types || !domain.types.some(t =>
                            t.trim().toLowerCase() === typeFilter.toLowerCase())) {
                            return false;
                        }
                    }

                    return true;
                });

                // 重新应用当前的排序配置
                sortDomains(sortConfig.column, sortConfig.direction);

                // 重置到第一页
                currentPage = 1;

                // 更新显示
                updateDomainDisplay();
            }

            // 更新域名显示
            function updateDomainDisplay() {
                const domainCards = document.getElementById('domainCards');
                const startIndex = (currentPage - 1) * domainsPerPage;
                const endIndex = startIndex + domainsPerPage;
                const domainsToShow = filteredDomains.slice(startIndex, endIndex);

                // 移除类型排序函数，保持原始顺序
                document.getElementById('loadingIndicator').style.display = 'none';

                if (filteredDomains.length === 0) {
                    document.getElementById('domainCards').style.display = 'none';
                    document.getElementById('noResults').style.display = 'block';
                    document.getElementById('pagination').style.display = 'none';
                    return;
                }

                document.getElementById('domainCards').style.display = 'grid';
                document.getElementById('noResults').style.display = 'none';
                document.getElementById('pagination').style.display = 'flex';

                // 清空卡片容器
                domainCards.innerHTML = '';

                // 添加域名卡片
                domainsToShow.forEach(domain => {
                    const card = document.createElement('div');
                    card.className = 'domain-card';
                    card.setAttribute('data-domain', domain.domain);

                    const nameContainer = document.createElement('div');
                    nameContainer.style.position = 'relative';
                    nameContainer.style.display = 'flex';
                    nameContainer.style.alignItems = 'flex-start';

                    const nameCell = document.createElement('div');
                    nameCell.className = 'domain-card-name';
                    nameCell.textContent = domain.domain;

                    // 添加类型标签（如果存在）
                    if (domain.types && domain.types.length > 0) {
                        // 创建类型标签容器
                        const typeContainer = document.createElement('div');
                        typeContainer.className = 'domain-card-type-container';

                        // 直接使用原始顺序，不进行排序
                        // 添加每个类型标签
                        domain.types.forEach(typeValue => {
                            const typeSpan = document.createElement('span');
                            typeSpan.className = 'domain-card-type';

                            // 处理促销标签的多语言显示
                            if (typeValue.toLowerCase() === 'promo' || typeValue.toLowerCase() === '促销') {
                                typeSpan.textContent = window.isEnglish ? 'Promo' : '促销';
                                typeSpan.setAttribute('data-type', 'promo');
                            } else if (typeValue.toLowerCase() === 'word' || typeValue.toLowerCase() === '单词') {
                                typeSpan.textContent = window.isEnglish ? 'Word' : '单词';
                                typeSpan.setAttribute('data-type', 'word');
                            } else {
                                // 针对hack和hot标签进行首字母大写处理
                                if (typeValue.toLowerCase() === 'hack') {
                                    typeSpan.textContent = 'Hack';
                                } else if (typeValue.toLowerCase() === 'hot') {
                                    typeSpan.textContent = 'Hot';
                                } else {
                                    typeSpan.textContent = typeValue;
                                }
                                typeSpan.setAttribute('data-type', typeValue.toLowerCase());
                            }

                            typeContainer.appendChild(typeSpan);
                        });

                        nameContainer.appendChild(typeContainer);
                    }

                    // 添加复制功能
                    nameCell.addEventListener('click', async (e) => {
                        e.stopPropagation();
                        try {
                            await navigator.clipboard.writeText(domain.domain);

                            // 移除已存在的提示（如果有）
                            const existingTooltip = nameCell.querySelector('.copied-tooltip');
                            if (existingTooltip) {
                                existingTooltip.remove();
                            }

                            // 显示复制成功提示
                            const tooltip = document.createElement('div');
                            tooltip.className = 'copied-tooltip';
                            tooltip.textContent = window.isEnglish ? 'Copied!' : '已复制!';

                            // 添加到nameCell中
                            nameCell.appendChild(tooltip);

                            // 强制重排以触发动画
                            void tooltip.offsetWidth;
                            tooltip.classList.add('show');

                            // 移除提示
                            setTimeout(() => {
                                tooltip.classList.remove('show');
                                setTimeout(() => tooltip.remove(), 200);
                            }, 1500);
                        } catch (err) {
                            // console.error('Failed to copy:', err);
                        }
                    });

                    nameContainer.appendChild(nameCell);

                    const infoContainer = document.createElement('div');
                    infoContainer.className = 'domain-card-info';

                    const bottomContainer = document.createElement('div');
                    bottomContainer.className = 'domain-card-bottom';

                    // 添加备注信息（如果存在）
                    if (domain.note) {
                        const noteDiv = document.createElement('div');
                        noteDiv.className = 'domain-card-note';
                        noteDiv.textContent = domain.note;
                        noteDiv.title = domain.note; // 添加完整提示
                        bottomContainer.appendChild(noteDiv);
                    }

                    const priceCell = document.createElement('div');
                    priceCell.className = 'domain-card-price';
                    const currencySymbol = domain.source === 'cn' ? '¥' : '$';
                    priceCell.textContent = `${currencySymbol}${domain.price}`;
                    bottomContainer.appendChild(priceCell);

                    infoContainer.appendChild(bottomContainer);

                    card.appendChild(nameContainer);
                    card.appendChild(infoContainer);

                    card.addEventListener('click', () => {
                        showDomainModal(domain);
                    });

                    domainCards.appendChild(card);
                });

                // 更新分页
                updatePagination();
            }

            // 更新分页控件
            function updatePagination() {
                const pagination = document.getElementById('pagination');
                pagination.innerHTML = '';

                const totalPages = Math.ceil(filteredDomains.length / domainsPerPage);

                // 上一页按钮
                const prevButton = document.createElement('button');
                prevButton.innerHTML = '&laquo;';
                prevButton.disabled = currentPage === 1;
                prevButton.addEventListener('click', () => {
                    if (currentPage > 1) {
                        currentPage--;
                        updateDomainDisplay();
                    }
                });
                pagination.appendChild(prevButton);

                // 页码按钮
                let startPage = Math.max(1, currentPage - 2);
                let endPage = Math.min(totalPages, startPage + 4);

                if (endPage - startPage < 4) {
                    startPage = Math.max(1, endPage - 4);
                }

                for (let i = startPage; i <= endPage; i++) {
                    const pageButton = document.createElement('button');
                    pageButton.textContent = i;
                    pageButton.className = i === currentPage ? 'active' : '';
                    pageButton.addEventListener('click', () => {
                        currentPage = i;
                        updateDomainDisplay();
                    });
                    pagination.appendChild(pageButton);
                }

                // 下一页按钮
                const nextButton = document.createElement('button');
                nextButton.innerHTML = '&raquo;';
                nextButton.disabled = currentPage === totalPages;
                nextButton.addEventListener('click', () => {
                    if (currentPage < totalPages) {
                        currentPage++;
                        updateDomainDisplay();
                    }
                });
                pagination.appendChild(nextButton);
            }

            // 排序域名
            function sortDomains(column, direction) {
                sortConfig.column = column;
                sortConfig.direction = direction;

                filteredDomains.sort((a, b) => {
                    let valueA, valueB;

                    if (column === 'domain') {
                        valueA = a.domain.toLowerCase();
                        valueB = b.domain.toLowerCase();
                    } else if (column === 'price') {
                        // 检查是否为非标准价格（比如 "Offer"、"议价" 等）
                        const isNonStandardA = isNaN(a.numericPrice) || a.numericPrice === 0;
                        const isNonStandardB = isNaN(b.numericPrice) || b.numericPrice === 0;

                        // 如果两个都是非标准价格，保持原有顺序
                        if (isNonStandardA && isNonStandardB) return 0;

                        // 根据排序方向决定非标准价格的位置
                        if (direction === 'asc') {
                            // 升序时，非标准价格排在最后
                            if (isNonStandardA) return 1;
                            if (isNonStandardB) return -1;
                        } else {
                            // 降序时，非标准价格排在最前
                            if (isNonStandardA) return -1;
                            if (isNonStandardB) return 1;
                        }

                        // 如果都是标准价格，按数值排序
                        valueA = a.numericPrice;
                        valueB = b.numericPrice;
                    } else if (column === 'length') {
                        valueA = a.length;
                        valueB = b.length;
                    }

                    if (valueA < valueB) return direction === 'asc' ? -1 : 1;
                    if (valueA > valueB) return direction === 'asc' ? 1 : -1;
                    return 0;
                });

                // 更新排序下拉框
                const sortOption = document.getElementById('sortOption');
                if (sortOption) {
                    sortOption.value = `${column}-${direction}`;
                }

                // 重置到第一页并更新显示
                currentPage = 1;
                updateDomainDisplay();
            }

            // 初始化事件监听器
            function initEventListeners() {
                // 语言切换
                document.querySelectorAll('.language-switch span').forEach(span => {
                    span.addEventListener('click', function() {
                        const clickedLang = this.id === 'langEn' ? 'en' : 'cn';
                        window.isEnglish = clickedLang === 'en';

                        // 更新激活状态
                        document.querySelectorAll('.language-switch span').forEach(s => {
                            s.classList.remove('active');
                        });
                        this.classList.add('active');

                        updateLanguage();

                        // 更新URL参数
                        const url = new URL(window.location);
                        url.searchParams.set('lang', window.isEnglish ? 'en' : 'cn');
                        window.history.replaceState({}, '', url);
                    });
                });

        // 修改筛选逻辑，移除应用按钮
        document.getElementById('searchInput')?.addEventListener('input', debounce(applyFilters, 300));
        document.getElementById('priceFilter')?.addEventListener('change', applyFilters);
        document.getElementById('lengthFilter')?.addEventListener('change', applyFilters);
        document.getElementById('sourceFilter')?.addEventListener('change', applyFilters);
        document.getElementById('extensionFilter')?.addEventListener('change', applyFilters);
        document.getElementById('typeFilter')?.addEventListener('change', applyFilters);
        document.getElementById('extensionTypeFilter')?.addEventListener('change', applyFilters);

        // 移除筛选按钮
        document.querySelector('.filter-buttons')?.remove();
    }

    // 添加模态窗口相关函数
    function showDomainModal(domain) {
        const modal = document.getElementById('domainModal');

        // 先准备数据，再进行DOM操作
        const currencySymbol = domain.source === 'cn' ? '¥' : '$';
        const price = currencySymbol + domain.price;
        const domainObj = {
            name: domain.domain,
            price: price,
            numericPrice: parseFloat(domain.price.toString().replace(/[^\d.]/g, '')),
            types: domain.types || [],
            campaignCount: domain.campaignCount,
            regCount: domain.regCount,
        };

        // 清除表单输入和错误提示
        function resetForm() {
            const modalEmail = document.getElementById('modalEmail');
            const modalMessage = document.getElementById('modalMessage');

            if (modalEmail) modalEmail.value = '';
            if (modalMessage) modalMessage.value = '';

            // 清除错误提示
            document.querySelectorAll('.modal-error').forEach(error => {
                error.style.display = 'none';
            });

            // 隐藏 Turnstile
            const turnstileContainer = document.getElementById('modalTurnstileContainer');
            if (turnstileContainer) turnstileContainer.style.display = 'none';
        }

        // 预先设置按钮占位符，避免布局跳动
        function setupInitialPlaceholders() {
            const buttonsContainer = modal.querySelector('.modal-buttons');
            if (!buttonsContainer) return;

            // 清空现有内容
            buttonsContainer.innerHTML = '';

            // 创建按钮占位符
            const atomButtonPlaceholder = document.createElement('div');
            atomButtonPlaceholder.className = 'button-placeholder';
            atomButtonPlaceholder.id = 'atom-button-placeholder';
            atomButtonPlaceholder.innerHTML = '<span>' + (window.isEnglish ? 'Buy Now...' : '立即购买...') + '</span>';
            buttonsContainer.appendChild(atomButtonPlaceholder);

            // 如果价格大于500，还需要创建分期付款按钮占位符
            if (domainObj.numericPrice > 500) {
                const installmentButtonPlaceholder = document.createElement('div');
                installmentButtonPlaceholder.className = 'button-placeholder';
                installmentButtonPlaceholder.id = 'installment-button-placeholder';
                installmentButtonPlaceholder.innerHTML = '<span>' + (window.isEnglish ? 'Installments...' : '分期付款...') + '</span>';
                buttonsContainer.appendChild(installmentButtonPlaceholder);
            }

            // 提交报价按钮 - 这个可以立即创建，因为它不需要外部脚本
            const submitButton = document.createElement('button');
            submitButton.className = 'modal-button modal-submit';
            submitButton.id = 'showOfferForm';
            submitButton.setAttribute('data-en', 'Submit Offer');
            submitButton.setAttribute('data-cn', '提交报价');
            submitButton.textContent = window.isEnglish ? 'Submit Offer' : '提交报价';
            buttonsContainer.appendChild(submitButton);

            // 重新绑定提交报价按钮事件
            submitButton.addEventListener('click', function() {
                modal.classList.add('offer-mode');
            });
        }

        // 批量进行DOM操作，减少重排次数
        const performDomUpdates = () => {
        // 主视图元素
        const mainTitle = modal.querySelector('.main-view .modal-title');
        const mainPrice = modal.querySelector('.main-view .modal-price');
        const mainTypeContainer = modal.querySelector('.main-view .modal-type-container');
        const mainTraffic = modal.querySelector('.main-view .modal-stats .modal-traffic');
        const mainReg = modal.querySelector('.main-view .modal-stats .modal-reg');
        const mainValuation = modal.querySelector('.main-view .modal-stats .modal-valuation');
        const mainSellingInfo = modal.querySelector('.main-view .domain-description p');

        // 报价视图元素
        const offerTitle = modal.querySelector('.offer-view .modal-title');
        const offerPrice = modal.querySelector('.offer-view .modal-price');
        const offerTypeContainer = modal.querySelector('.offer-view .modal-type-container');

            // 一次性设置模态窗口内容，减少重排
            mainTitle.textContent = domainObj.name;
            offerTitle.textContent = domainObj.name;
            mainPrice.textContent = domainObj.price;
            offerPrice.textContent = domainObj.price;

        // 更新售卖信息的文本
        if (mainSellingInfo) {
            const currencySymbol = window.isEnglish ? '$' : '¥';
            const priceText = modal.querySelector('.modal-price')?.textContent || '';

            let text;
            if (window.isEnglish) {
                text = `This domain is currently for sale at ${priceText}.<br>Buy Now below, or contact me to make an offer.<br>Visit <a href="faq.html" target="_blank" class="faq-link-in-modal">FAQ</a> to learn about the transaction process and more.`;
            } else {
                text = `该域名正在以 ${priceText} 出售中。<br>通过下方按钮直接购买或联系我提交报价。<br>访问 <a href="faq.html" target="_blank" class="faq-link-in-modal">FAQ</a> 了解交易流程等常见问题。`;
            }
            mainSellingInfo.innerHTML = text;

            // 移除data属性，使其不再被覆盖
            mainSellingInfo.removeAttribute('data-en');
            mainSellingInfo.removeAttribute('data-cn');
        }

        // 表单元素
        const modalDomain = document.getElementById('modalDomain');
        const modalPriceInput = document.getElementById('modalPrice');
            if (modalDomain) modalDomain.value = domainObj.name;
            if (modalPriceInput) modalPriceInput.value = domainObj.numericPrice;

        // 重置更多购买方式的展开状态
        const moreOptionsContent = document.getElementById('moreOptionsContent');
        if (moreOptionsContent) {
            moreOptionsContent.classList.remove('show');
            const icon = document.querySelector('#moreOptionsBtn i');
                if (icon) icon.style.transform = '';
            }

            // 处理访问量显示
            if (typeof domainObj.campaignCount === 'number' && domainObj.campaignCount >= 15) {
            mainTraffic.style.display = 'flex';
                mainTraffic.querySelector('span').textContent = domainObj.campaignCount;
            mainTraffic.title = window.isEnglish ? 'Recent Traffic Count' : '近期访问量';

            // 添加点击事件处理
                mainTraffic.onclick = function() {
                const message = window.isEnglish ? 'Recent Traffic Count' : '近期访问量';
                    alert(message + ': ' + domainObj.campaignCount);
            };
        } else {
            mainTraffic.style.display = 'none';
        }

            // 处理REG数据显示
            if (typeof domainObj.regCount === 'number' && domainObj.regCount > 0) {
            mainReg.style.display = 'flex';
                mainReg.querySelector('span').textContent = domainObj.regCount;
            mainReg.title = window.isEnglish ? 'Number of TLDs Registered' : '已注册的顶级域名数量';

            // 添加点击事件处理
                mainReg.onclick = function() {
                const message = window.isEnglish ? 'Number of TLDs Registered' : '已注册的顶级域名数量';
                    alert(message + ': ' + domainObj.regCount);
            };
        } else {
            mainReg.style.display = 'none';
        }

            // 处理域名估价显示
            mainValuation.style.display = 'none'; // 默认隐藏
            mainValuation.querySelector('span').textContent = '...'; // 初始状态
            mainValuation.title = window.isEnglish ? 'HumbleWorth Marketplace Value' : 'HumbleWorth市场估价';

            // 从缓存获取域名估价
            const valuation = getDomainValuation(domainObj.name);
            if (valuation) {
                // 只有当估价有效时才显示
                mainValuation.style.display = 'flex';
                // 直接显示估价值，不添加前缀和美元符号
                mainValuation.querySelector('span').textContent = valuation;

                // 添加点击事件处理
                mainValuation.onclick = function() {
                    const message = window.isEnglish ? 'HumbleWorth Marketplace Value' : 'HumbleWorth市场估价';
                    alert(message + ': $' + valuation);
                };
            }

            // 处理类型标签 - 创建文档片段，减少DOM操作
            const mainTypeFragment = document.createDocumentFragment();
            const offerTypeFragment = document.createDocumentFragment();

        // 清除现有的类型标签
        mainTypeContainer.innerHTML = '';
        offerTypeContainer.innerHTML = '';

        // 添加每个类型标签
            if (domainObj.types.length > 0) {
                domainObj.types.forEach(typeValue => {
                    let displayText = typeValue;
                    let dataType = typeValue.toLowerCase();

                    // 处理促销标签的多语言显示
                    if (typeValue.toLowerCase() === 'promo' || typeValue.toLowerCase() === '促销') {
                        displayText = window.isEnglish ? 'Promo' : '促销';
                        dataType = 'promo';
                    } else if (typeValue.toLowerCase() === 'word' || typeValue.toLowerCase() === '单词') {
                        displayText = window.isEnglish ? 'Word' : '单词';
                        dataType = 'word';
                    } else {
                        // 针对hack和hot标签进行首字母大写处理
                        if (typeValue.toLowerCase() === 'hack') {
                            displayText = 'Hack';
                        } else if (typeValue.toLowerCase() === 'hot') {
                            displayText = 'Hot';
                        } else {
                            displayText = typeValue;
                        }
                        dataType = typeValue.toLowerCase();
                    }

                // 为主视图创建类型标签
                const mainTypeSpan = document.createElement('span');
                mainTypeSpan.className = 'modal-type';
                    mainTypeSpan.textContent = displayText;
                    mainTypeSpan.setAttribute('data-type', dataType);

                    // 为报价视图创建类型标签
                const offerTypeSpan = document.createElement('span');
                offerTypeSpan.className = 'modal-type';
                    offerTypeSpan.textContent = displayText;
                    offerTypeSpan.setAttribute('data-type', dataType);

                    mainTypeFragment.appendChild(mainTypeSpan);
                    offerTypeFragment.appendChild(offerTypeSpan);
                });

                mainTypeContainer.appendChild(mainTypeFragment);
                offerTypeContainer.appendChild(offerTypeFragment);
            }

            // 更新域名链接
            updateDomainLinks(domainObj.name);
        };

        // 预先加载Atom图片
        function preloadAtomImage() {
            const atomImage = new Image();
            atomImage.src = 'pay.webp';
            return atomImage;
        }

        // 确保打开模态框时处于主视图
        modal.classList.remove('offer-mode');

        // 快速显示模态窗口外壳，再填充内容，提升感知性能
        modal.style.display = 'block';

        // 开始预加载图片
        const preloadedAtomImage = preloadAtomImage();

        // 使用 requestAnimationFrame 确保显示和内容填充在不同帧进行
        requestAnimationFrame(() => {
            // 添加 show 类触发动画
            modal.classList.add('show');

            // 设置按钮占位符
            setupInitialPlaceholders();

            // 在下一帧执行DOM更新，避免在同一帧内进行大量DOM操作
            requestAnimationFrame(() => {
                performDomUpdates();
                resetForm();

                // 延迟替换Atom按钮
                setTimeout(() => {
                    // 如果预加载的图片已经加载完成，立即创建按钮
                    if (preloadedAtomImage.complete) {
                        createAtomButtons(domain);
                    } else {
                        // 否则等待图片加载完成再创建按钮
                        preloadedAtomImage.onload = function() {
                            createAtomButtons(domain);
                        };

                        // 如果图片加载时间过长，也可以设置一个最大等待时间
                        setTimeout(() => {
                            if (!document.querySelector('.main-view .pay-with-atom')) {
                                createAtomButtons(domain);
                            }
                        }, 1000);
                    }
                }, 10);
            });
        });
    }

    // 替换占位符创建实际按钮
    function createAtomButtons(domain) {
        const atomButtonPlaceholder = document.getElementById('atom-button-placeholder');
        const installmentButtonPlaceholder = document.getElementById('installment-button-placeholder');

        if (!atomButtonPlaceholder) return;

        const buttonsContainer = atomButtonPlaceholder.parentNode;
        if (!buttonsContainer) return;

        // 清除占位符
        if (atomButtonPlaceholder) {
            atomButtonPlaceholder.remove();
        }

        if (installmentButtonPlaceholder) {
            installmentButtonPlaceholder.remove();
        }

        // 创建实际的Atom按钮
        const atomButtons = createAtomButtonElements(domain);

        // 获取提交报价按钮
        const submitButton = document.getElementById('showOfferForm');

        // 在提交报价按钮前添加Atom按钮
        if (submitButton && atomButtons.length > 0) {
            for (let i = 0; i < atomButtons.length; i++) {
                buttonsContainer.insertBefore(atomButtons[i], submitButton);
            }
        } else if (atomButtons.length > 0) {
            // 如果没有找到提交报价按钮，则直接添加到容器末尾
            for (let i = 0; i < atomButtons.length; i++) {
                buttonsContainer.appendChild(atomButtons[i]);
            }
        }

        // 初始化Atom按钮
        initializeAtomButtons();
    }

    // 创建Atom按钮元素，不直接添加到DOM
    function createAtomButtonElements(domain) {
        // 创建按钮数组
        const buttons = [];

        // 确保域名只包含ASCII字符
        const safedomainName = domain.domain.normalize('NFD').replace(/[\u0300-\u036f]/g, '');

        // 确保价格是纯数字
        let numericPrice = parseFloat(domain.price.toString().replace(/[^\d.]/g, ''));

        // 确保价格不低于100
        if (numericPrice < 100) {
            numericPrice = 100;
        }

        // 创建主按钮
        const newAtomButton = document.createElement('button');
        newAtomButton.className = 'pay-with-atom';

        // 设置按钮属性
        newAtomButton.setAttribute('data-domain-name', safedomainName);
        newAtomButton.setAttribute('data-domain-price', numericPrice.toString());
        newAtomButton.setAttribute('data-token', '6817f40b9501bd00');
        newAtomButton.setAttribute('data-installments', '');
        newAtomButton.setAttribute('data-down-payment', '');
        newAtomButton.setAttribute('data-host-name', 'https://www.atom.com');

        // 如果有encryption_key，添加到按钮上
        if (window.atomEncryptionKey) {
            newAtomButton.setAttribute('data-encryption-key', window.atomEncryptionKey);
        } else {
            // 设置默认加密密钥
            newAtomButton.setAttribute('data-encryption-key', '6817f40b9501bd00');
        }

        // 添加请求验证信息
        newAtomButton.setAttribute('data-request-validation', Date.now().toString());

        // 添加内部元素
        const spanElement = document.createElement('span');
        spanElement.setAttribute('data-en', 'Buy Now');
        spanElement.setAttribute('data-cn', '立即购买');
        spanElement.textContent = window.isEnglish ? 'Buy Now' : '立即购买';
        newAtomButton.appendChild(spanElement);

        // 创建图片元素并添加内联样式，确保加载时就有尺寸限制
        const img = document.createElement('img');
        img.src = 'pay.webp';
        img.alt = 'Atom Logo';
        img.loading = 'eager'; // 急切加载图片
        img.style.maxHeight = '20px';
        img.style.maxWidth = '60px';
        img.style.width = 'auto';
        img.style.height = 'auto';
        img.style.objectFit = 'contain';
        img.style.verticalAlign = 'middle';
        img.style.marginLeft = '0.5rem';

        // 添加图片到按钮
        newAtomButton.appendChild(img);

        // 添加按钮到数组
        buttons.push(newAtomButton);

        // 只有当价格大于$500时才创建分期付款按钮
        const totalPrice = numericPrice; // 直接使用已经处理过的numericPrice
        if (totalPrice > 500) {
            // 创建分期付款按钮
            const installmentButton = document.createElement('button');
            installmentButton.className = 'pay-with-atom';

            // 设置分期付款按钮属性
            installmentButton.setAttribute('data-domain-name', safedomainName);
            installmentButton.setAttribute('data-domain-price', numericPrice.toString());
            installmentButton.setAttribute('data-token', '6817f40b9501bd00');
            installmentButton.setAttribute('data-down-payment', '0');
            installmentButton.setAttribute('data-installments', '12');
            installmentButton.setAttribute('data-host-name', 'https://www.atom.com');

            // 如果有encryption_key，添加到分期付款按钮上
            if (window.atomEncryptionKey) {
                installmentButton.setAttribute('data-encryption-key', window.atomEncryptionKey);
            } else {
                // 设置默认加密密钥
                installmentButton.setAttribute('data-encryption-key', '6817f40b9501bd00');
            }

            // 添加请求验证信息
            installmentButton.setAttribute('data-request-validation', Date.now().toString());

            // 计算分期付款信息
            const baseMonthlyPayment = totalPrice / 12; // 基本月付
            const monthlyFee = baseMonthlyPayment * 0.1; // 每月10%的附加费
            const monthlyPayment = baseMonthlyPayment + monthlyFee; // 最终月付金额

            // 创建分期付款按钮内容
            const installmentInfo = document.createElement('div');
            installmentInfo.className = 'installment-info';

            const installmentText = document.createElement('span');
            installmentText.className = 'installment-text';
            installmentText.setAttribute('data-en', 'Atom Installments');
            installmentText.setAttribute('data-cn', 'Atom分期付款');
            installmentText.textContent = window.isEnglish ? 'Atom Installments' : 'Atom分期付款';

            const details = document.createElement('span');
            details.className = 'installment-details';
            details.setAttribute('data-en', `($${monthlyPayment.toFixed(0)} × 12)`);
            details.setAttribute('data-cn', `($${monthlyPayment.toFixed(0)} × 12期)`);
            details.textContent = window.isEnglish ?
                `($${monthlyPayment.toFixed(0)} × 12)` :
                `($${monthlyPayment.toFixed(0)} × 12期)`;

            installmentInfo.appendChild(installmentText);
            installmentInfo.appendChild(details);
            installmentButton.appendChild(installmentInfo);

        // 添加分期付款按钮到数组
        buttons.push(installmentButton);
    }

        return buttons;
    }

    // 优化初始化Atom按钮的函数
    function initializeAtomButtons() {
        // 为所有Atom支付按钮设置最新的时间戳
        const atomButtons = document.querySelectorAll('.pay-with-atom');
        atomButtons.forEach(button => {
            // 更新所有按钮的请求验证时间戳
            button.setAttribute('data-request-validation', Date.now().toString());
        });

        // 重新初始化Atom脚本
        if (window.initAtomButtons && typeof window.initAtomButtons === 'function') {
            try {
                window.initAtomButtons();
            } catch (e) {
                // 出错时尝试重新加载脚本
                reloadAtomScript();
            }
        } else {
            // 如果找不到初始化函数，尝试加载脚本
            if (typeof reloadAtomScript === 'function') {
                reloadAtomScript();
            }
        }
    }

    // 优化模态窗口关闭函数
    function hideModal() {
        const modal = document.getElementById('domainModal');
        modal.classList.remove('show');
        modal.classList.remove('offer-mode'); // 确保关闭时重置视图状态

        // 使用 transitionend 事件确保过渡效果完成后再隐藏
        const handleTransitionEnd = () => {
            modal.style.display = 'none';
            modal.removeEventListener('transitionend', handleTransitionEnd);
        };

        modal.addEventListener('transitionend', handleTransitionEnd);

        // 保险起见，如果过渡事件没有触发，设置一个超时
        setTimeout(() => {
            if (modal.style.display !== 'none') {
                modal.style.display = 'none';
            }
        }, 300);
    }

    function updateModalLanguage() {
        document.querySelectorAll('[data-en]').forEach(element => {
            const enText = element.getAttribute('data-en');
            const cnText = element.getAttribute('data-cn');
            if (enText && cnText) {
                element.textContent = window.isEnglish ? enText : cnText;
            }
        });

        const modalEmail = document.getElementById('modalEmail');
        const modalMessage = document.getElementById('modalMessage');

        if (modalEmail) {
            modalEmail.placeholder = window.isEnglish ? 'Your email' : '您的邮箱';
        }

        if (modalMessage) {
            modalMessage.placeholder = window.isEnglish ? 'Leave a message (helps filter spam)' : '留言（推荐填写）';
        }

        // 更新REG和Traffic的提示文本
        const modal = document.getElementById('domainModal');
        if (modal) {
            const trafficElements = modal.querySelectorAll('.modal-traffic');
            trafficElements.forEach(el => {
                if (el.style.display !== 'none') {
                    el.title = window.isEnglish ? 'Recent Traffic Count' : '近期访问量';
                }
            });

            const regElements = modal.querySelectorAll('.modal-reg');
            regElements.forEach(el => {
                if (el.style.display !== 'none') {
                    el.title = window.isEnglish ? 'Number of TLDs Registered' : '已注册的顶级域名数量';
                }
            });

            // 更新售卖信息文本
            const sellingInfo = modal.querySelector('.domain-description p');
            if (sellingInfo) {
                const currencySymbol = window.isEnglish ? '$' : '¥';
                const price = modal.querySelector('.modal-price')?.textContent || '';

                if (window.isEnglish) {
                    sellingInfo.textContent = `This domain is currently for sale at ${price}\nBuy Now below, or contact me to make an offer`;
                } else {
                    sellingInfo.textContent = `该域名正在以${price}出售中\n通过下方按钮直接购买或联系我提交报价`;
                }

                // 移除data属性，使其不再被覆盖
                sellingInfo.removeAttribute('data-en');
                sellingInfo.removeAttribute('data-cn');
            }
        }

        // 更新模态窗口中联系方式的文本
        const modalContactLinks = document.querySelectorAll('.modal-contact a span');
        modalContactLinks.forEach(span => {
            const parentLink = span.closest('a');
            if (parentLink) {
                const href = parentLink.getAttribute('href');
                // 检查是否是小屏幕
                const isSmallScreen = window.innerWidth <= 480;

                if (href.includes('mailto')) {
                    span.textContent = window.isEnglish ? 'Email' : '邮箱';
                } else if (href.includes('wa.me')) {
                    span.textContent = isSmallScreen ? 'WA' : (window.isEnglish ? 'WhatsApp' : 'WhatsApp');
                } else if (href.includes('t.me')) {
                    span.textContent = window.isEnglish ? 'TG' : '电报';
                } else if (href.includes('javascript:$chatway.openChatwayWidget()')) {
                    span.textContent = isSmallScreen ? (window.isEnglish ? 'Live' : '实时') : (window.isEnglish ? 'Live Chat' : '在线客服');
                }
            }
        });
    }

    // 添加模态窗口事件监听
    document.querySelector('.modal-close')?.addEventListener('click', hideModal);

    document.getElementById('domainModal')?.addEventListener('click', (e) => {
        if (e.target.id === 'domainModal') {
            hideModal();
        }
    });

    document.getElementById('modalEmail')?.addEventListener('input', function() {
        const email = this.value.trim();
        if (isValidEmail(email)) {
            // 如果邮箱有效且Turnstile还未加载，则加载Turnstile
            const turnstileContainer = document.getElementById('modalTurnstileContainer');
            if (!turnstileContainer.querySelector('.cf-turnstile')) {
                // 创建Turnstile容器
                const turnstileDiv = document.createElement('div');
                turnstileDiv.className = 'cf-turnstile';
                turnstileDiv.setAttribute('data-sitekey', '0x4AAAAAAA2-XzegEcoBlBbi');
                turnstileDiv.setAttribute('data-callback', 'onTurnstileSuccess');
                turnstileDiv.setAttribute('data-error-callback', 'onTurnstileError');
                turnstileDiv.setAttribute('data-theme', 'light');
                turnstileContainer.appendChild(turnstileDiv);

                // 动态加载Turnstile脚本
                if (!document.querySelector('script[src*="turnstile"]')) {
                    const script = document.createElement('script');
                    script.src = 'https://challenges.cloudflare.com/turnstile/v0/api.js';
                    script.async = true;
                    script.defer = true;
                    document.body.appendChild(script);
                }
            }
            turnstileContainer.style.display = 'block';
        } else {
            document.getElementById('modalTurnstileContainer').style.display = 'none';
        }
    });

    document.getElementById('modalSubmit')?.addEventListener('click', async function() {
        // 清除错误提示
        document.querySelectorAll('.modal-error').forEach(error => {
            error.style.display = 'none';
        });

        const domain = document.getElementById('modalDomain').value.trim();
        const price = document.getElementById('modalPrice').value.trim();
        const email = document.getElementById('modalEmail').value.trim();
        let hasError = false;

        if (!domain) {
            document.getElementById('modalDomainError').style.display = 'block';
            hasError = true;
        }

        if (!price) {
            document.getElementById('modalPriceError').style.display = 'block';
            hasError = true;
        }

        if (!email || !isValidEmail(email)) {
            document.getElementById('modalEmailError').style.display = 'block';
            hasError = true;
        }

        if (!turnstileToken) {
            document.getElementById('modalEmailError').textContent = window.isEnglish ?
                'Please complete the security verification.' :
                '请完成安全验证。';
            document.getElementById('modalEmailError').style.display = 'block';
            hasError = true;
        }

        if (hasError) return;

        // 如果邮箱有效且已经验证，提交表单
        if (turnstileToken) {
            submitModalForm();
        }
    });

    let turnstileToken = null;

    // 确保 Turnstile 回调函数在全局作用域
    window.onTurnstileSuccess = function(token) {
        turnstileToken = token;
        // 移除自动提交逻辑，只保存token
        document.getElementById('modalSubmit').disabled = false;
    };

    window.onTurnstileError = function() {
        turnstileToken = null;
        document.getElementById('modalEmailError').textContent = window.isEnglish ?
            'Verification failed. Please try again.' :
            '验证失败，请重试。';
        document.getElementById('modalEmailError').style.display = 'block';
        document.getElementById('modalSubmit').disabled = true;
    };

    async function submitModalForm() {
        const domain = document.getElementById('modalDomain').value.trim();
        const price = document.getElementById('modalPrice').value.trim();
        const email = document.getElementById('modalEmail').value.trim();
        const message = document.getElementById('modalMessage').value.trim();

        const submitButton = document.getElementById('modalSubmit');
        const modalContent = document.querySelector('.modal-content');

        modalContent.classList.add('submitting');
        submitButton.disabled = true;

        try {
            const formData = {
                domain: domain,
                price: parseFloat(price),
                email: email,
                message: message || '',
                'cf-turnstile-response': turnstileToken,
                source: window.isEnglish ? 'en' : 'cn'
            };

            // console.log('Submitting form data:', formData);

            const response = await fetch('/submit-offer', {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                    'Accept': 'application/json'
                },
                body: JSON.stringify(formData)
            });

            if (!response.ok) {
                const errorData = await response.json().catch(() => ({}));
                throw new Error(errorData.message || (window.isEnglish ?
                    'Failed to submit offer. Please try again.' :
                    '提交报价失败，请重试。'));
            }

            const result = await response.json();

            if (result.status === 'success') {
                const successMessage = document.getElementById('successMessage');
                successMessage.style.display = 'block';  // 添加这行
                successMessage.textContent = window.isEnglish ? 'Offer submitted successfully!' : '报价提交成功！';
                successMessage.classList.add('show');

                // 立即关闭模态窗口
                hideModal();

                setTimeout(() => {
                    successMessage.classList.remove('show');
                    successMessage.classList.add('hide');

                    setTimeout(() => {
                        successMessage.classList.remove('hide');
                        successMessage.style.display = 'none';
                    }, 300);
                }, 3000);
            } else {
                throw new Error(result.message || (window.isEnglish ?
                    'Failed to submit offer. Please try again.' :
                    '提交报价失败，请重试。'));
            }
        } catch (error) {
            document.getElementById('modalEmailError').textContent = window.isEnglish ?
                `Error: ${error.message}` :
                `错误：${error.message}`;
            document.getElementById('modalEmailError').style.display = 'block';
        } finally {
            modalContent.classList.remove('submitting');
            submitButton.disabled = false;
            if (window.turnstile) {
                window.turnstile.reset();
            }
            turnstileToken = null;
        }
    }

    // 初始化
    initLanguage();
    initEventListeners();
    initializeDisplay(); // 移动到这里

    // 调用fetchDomains获取域名数据
    // console.log('Fetching domains data...');
    fetchDomains();

    // 修复排序功能
    document.getElementById('sortOption')?.addEventListener('change', function() {
        const [column, direction] = this.value.split('-');
        sortDomains(column, direction);
    });

    // 添加更新滚动横幅的函数
    function updateMarquee(domains) {
        const marquee = document.getElementById('marquee');
        if (!marquee) return;

        // 清空现有内容
        marquee.innerHTML = '';

        // 只选择有type属性且不是促销类型的域名
        const typedDomains = domains.filter(domain => {
            if (!domain.types || domain.types.length === 0) return false;
            // 排除包含promo或促销类型的域名
            return !domain.types.some(type =>
                type.toLowerCase() === 'promo' ||
                type.toLowerCase() === '促销'
            );
        });

        // 计算动画持续时间
        const baseDuration = 10;
        const minDuration = 60;
        const maxDuration = 300;

        let duration = Math.max(minDuration, Math.min(maxDuration, typedDomains.length * baseDuration));

        document.documentElement.style.setProperty('--scroll-duration', `${duration}s`);

        // 创建滚动内容
        typedDomains.forEach((domain, index) => {
            const item = document.createElement('div');
            item.className = 'marquee-item';
            item.textContent = domain.domain;

            // 修改点击事件，打开模态窗口
            item.addEventListener('click', () => {
                showDomainModal(domain);
            });

            marquee.appendChild(item);

            if (index < typedDomains.length - 1) {
                const separator = document.createElement('div');
                separator.className = 'domain-separator';
                separator.textContent = '✦';
                marquee.appendChild(separator);
            }
        });
    }

    // 在script部分添加点击事件
    document.querySelector('.modal-discount')?.addEventListener('click', function() {
        window.open('mailto:sale@net.deal');
    });

    function isValidEmail(email) {
        return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
    }

    // 添加 URL 参数解析函数
    function getUrlParams() {
        const params = new URLSearchParams(window.location.search);
        const mtm = params.get('mtm');
        const mtmCampaign = params.get('mtm_campaign');
        return { mtm, mtmCampaign };
    }

    // 检查并处理 URL 参数
    function handleUrlParams() {
        const { mtm, mtmCampaign } = getUrlParams();
        // 修改这里：提取纯域名部分，移除任何URL参数
        let targetDomain = mtm;

        if (!targetDomain && mtmCampaign) {
            // 先解码URL编码的参数
            const decodedCampaign = decodeURIComponent(mtmCampaign);
            // 移除协议前缀
            let cleanDomain = decodedCampaign.replace(/^https?:\/\//, '');
            // 只保留域名部分（移除URL参数和路径）
            cleanDomain = cleanDomain.split('?')[0].split('/')[0];
            targetDomain = cleanDomain;
        }

        if (targetDomain) {
            // 等待域名数据加载完成
            const checkDataAndShowModal = () => {
                if (allDomains.length > 0) {
                    const domain = allDomains.find(d => {
                        const cleanTargetDomain = targetDomain.toLowerCase().replace(/^www\./, '');
                        const cleanDomainName = d.domain.toLowerCase().replace(/^www\./, '');
                        return cleanDomainName === cleanTargetDomain;
                    });

                    if (domain) {
                        showDomainModal(domain);
                    }
                } else {
                    // 如果数据还未加载完成，等待 100ms 后重试
                    setTimeout(checkDataAndShowModal, 100);
                }
            };

            // 添加这行来启动检查过程
            checkDataAndShowModal();
        }
    }

    // 添加 popstate 事件监听，处理浏览器前进/后退
    window.addEventListener('popstate', function(event) {
        handleUrlParams();
    });

    // 添加获取REG数据的函数
    /*
     * 获取域名的REG数据
     * 根据需求：
     * 1. REG值不在域名卡片上显示
     * 2. REG值只在点击卡片打开的模态窗口中显示，且位于访问量指标的右侧
     */
    function fetchDomainRegData(domainNames, combinedDomains) {
        // 参数验证
        if (!domainNames || !Array.isArray(domainNames) || domainNames.length === 0) {
            return;
        }

        if (!combinedDomains || !Array.isArray(combinedDomains) || combinedDomains.length === 0) {
            return;
        }

        // 检查是否已有缓存数据
        fetch('/domain-reg')
        .then(response => {
            if (!response.ok) {
                throw new Error('REG API responded with status: ' + response.status);
            }
            return response.json();
        })
        .then(cachedRegData => {
            // 筛选出未缓存的域名
            const domainsToCheck = domainNames.filter(domain => !cachedRegData[domain]);

            if (domainsToCheck.length > 0) {
                // 发送批量请求
                fetch('/batch-domain-reg', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify({ domains: domainsToCheck })
                })
                .then(response => {
                    if (!response.ok) {
                        throw new Error(`Batch REG API responded with status: ${response.status}`);
                    }
                    return response.json();
                })
                .then(newRegData => {
                    // 合并所有REG数据
                    const allRegData = { ...cachedRegData, ...newRegData };

                    // 更新域名对象
                    combinedDomains.forEach(domain => {
                        domain.regCount = allRegData[domain.domain] || 0;
                    });

                    // 更新已显示的域名卡片 - 注意：根据需求，REG值只在模态窗口中显示，不在卡片上显示
                    updateDomainCardsWithRegData(allRegData);
                })
                .catch(error => {
                    // 错误处理，但不输出到控制台
                });
            } else {
                // 使用缓存数据
                combinedDomains.forEach(domain => {
                    domain.regCount = cachedRegData[domain.domain] || 0;
                });

                // 更新已显示的域名卡片 - 注意：根据需求，REG值只在模态窗口中显示，不在卡片上显示
                updateDomainCardsWithRegData(cachedRegData);
            }
        })
        .catch(error => {
            // console.error('Error fetching REG data:', error);
        });
    }

    // 更新现有域名卡片的REG数据
    function updateDomainCardsWithRegData(regData) {
        // 不再在卡片上显示REG标记，只更新域名对象的regCount属性
        // 这样在点击卡片显示模态窗口时仍然能显示REG数据
        // 注意：这里使用全局变量allDomains而不是combinedDomains（局部变量）

        const domainCards = document.querySelectorAll('.domain-card');

        domainCards.forEach(card => {
            const domainName = card.getAttribute('data-domain');
            if (domainName) {
                // 尝试直接匹配
                let regValue = regData[domainName];

                // 如果没有直接匹配到，尝试小写匹配
                if (regValue === undefined) {
                    regValue = regData[domainName.toLowerCase()];
                }

                // 不再创建和添加REG标记到卡片上
                // 只在后台记录REG值，用于模态窗口显示

                // 查找对应的域名对象并更新regCount属性
                const domain = allDomains.find(d => d.domain === domainName);
                if (domain) {
                    domain.regCount = regValue || 0;
                }
            }
        });
    }

    const moreOptionsBtn = document.getElementById('moreOptionsBtn');
    const moreOptionsContent = document.getElementById('moreOptionsContent');

    moreOptionsBtn.addEventListener('click', function() {
        moreOptionsContent.classList.toggle('show');
        const icon = this.querySelector('i');
        icon.style.transform = moreOptionsContent.classList.contains('show') ? 'rotate(180deg)' : '';
    });
        });

    // 更新域名链接的函数
    function updateDomainLinks(domainName) {
        const atomParkLink = document.getElementById('atomParkLink');
        const godaddyLink = document.getElementById('godaddyLink');

        if (atomParkLink && domainName) {
            atomParkLink.href = `https://www.atom.com/name/${domainName}`;
        }

        if (godaddyLink && domainName) {
            godaddyLink.href = `https://www.godaddy.com/forsale/${domainName}`;
        }
    }

    // 添加窗口切换逻辑
    document.addEventListener('DOMContentLoaded', function() {
        // 不要立即加载域名估价缓存，改为延迟加载
        // loadValuationCache();

        // 添加显示报价表单的逻辑
        const showOfferForm = document.getElementById('showOfferForm');
        if (showOfferForm) {
            showOfferForm.addEventListener('click', function() {
                const modal = document.getElementById('domainModal');
                modal.classList.add('offer-mode');
            });
        }

        // 添加返回主视图的逻辑
        const goBack = document.querySelector('.modal-back');
        if (goBack) {
            goBack.addEventListener('click', function() {
                document.getElementById('domainModal').classList.remove('offer-mode');
            });
        }

        // 监听窗口大小变化，更新联系方式文本
        window.addEventListener('resize', function() {
            updateLanguage();
        });

        // 其他DOM加载完成后的初始化...
        });
    </script>
<script src="/cdn-cgi/scripts/7d0fa10a/cloudflare-static/rocket-loader.min.js" data-cf-settings="1e3902d5ea8b33bc42169c10-|49" defer></script></body>
</html>