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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f0f2f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-container {
    margin-bottom: 30px;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e1e4e8;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #0366d6;
    box-shadow: 0 0 0 3px rgba(3,102,214,0.1);
}

button {
    width: 100%;
    padding: 15px;
    background-color: #2ea44f;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2c974b;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e1e4e8;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    background-color: #f6f8fa;
    font-weight: 600;
    color: #24292e;
}

tr:hover {
    background-color: #f6f8fa;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination button {
    width: auto;
    padding: 10px 20px;
    background-color: #fff;
    color: #24292e;
    border: 1px solid #e1e4e8;
}

.pagination button:hover {
    background-color: #f6f8fa;
}

.pagination button.active {
    background-color: #0366d6;
    color: white;
    border-color: #0366d6;
}

.pagination-info {
    color: #666;
    font-size: 14px;
    margin: 0 10px;
}

.pagination-ellipsis {
    color: #666;
    margin: 0 5px;
}

.address-container, .creator-container {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 150px;
    justify-content: space-between;
}

.address, .creator {
    font-family: monospace;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.copy-btn {
    padding: 4px;
    width: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
}

.copy-btn:hover {
    color: #0366d6;
    background: none;
}

.token-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s;
}

.token-image:hover {
    transform: scale(1.1);
}

.name-cell, .symbol-cell {
    min-width: 120px;
    max-width: 200px;
    padding: 12px !important;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.name {
    display: block;
    font-weight: bold;
    white-space: normal;
    overflow: hidden;
    word-wrap: break-word;
    line-height: 1.4;
    margin-bottom: 4px;
}

.symbol {
    display: block;
    font-size: 0.9em;
    color: #666;
    white-space: normal;
    overflow: hidden;
    word-wrap: break-word;
    line-height: 1.4;
}

.description {
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    font-size: 0.95em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.description::-webkit-scrollbar {
    width: 6px;
}

.description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.description::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.description::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9em;
}

.status.complete {
    background-color: #2ea44f;
    color: white;
}

.status.pending {
    background-color: #f6f8fa;
    color: #666;
}

.creator {
    font-family: monospace;
}

.time-info {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-family: monospace;
    font-size: 1em;
    letter-spacing: 0.5px;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    padding: 8px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.95em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    font-family: monospace;
}

.social-icon {
    flex-shrink: 0;
}

.social-link.twitter {
    background-color: #1da1f2;
    color: white;
}

.social-link.telegram {
    background-color: #0088cc;
    color: white;
}

#searchButton {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner {
    width: 20px;
    height: 20px;
}

.spinner {
    animation: rotate 2s linear infinite;
    width: 100%;
    height: 100%;
}

.path {
    stroke: #ffffff;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.results-container {
    position: relative;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #666;
    display: none;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding: 20px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: auto;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    right: 35px;
    top: 15px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.modal-close:hover,
.modal-close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 确保模态框中的图片居中显示 */
@media only screen and (max-width: 700px) {
    .modal-content {
        width: 100%;
    }
}

.search-filters {
    margin-bottom: 15px;
}

.filter-row {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.market-cap-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 2;
}

.market-cap-filter input {
    width: 100%;
    padding: 8px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
}

#launchStatus {
    flex: 1;
    padding: 8px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    background-color: white;
}

.sort-icon {
    display: inline-block;
    margin-left: 4px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

th[data-sort] {
    cursor: pointer;
}

th[data-sort]:hover .sort-icon {
    opacity: 1;
}

.time-cell {
    font-size: 0.9em;
    color: #666;
    padding: 12px !important;
    min-width: 220px;
}

/* 添加工具提示效果 */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: pre-wrap;
    max-width: 300px;
    z-index: 1000;
}

/* 设置各列的宽度 */
th:nth-child(1), td:nth-child(1) { min-width: 200px; } /* 合约地址 */
th:nth-child(2), td:nth-child(2) { min-width: 60px; }  /* 图标 */
th:nth-child(3), td:nth-child(3) { min-width: 250px; } /* 名称 */
th:nth-child(4), td:nth-child(4) { min-width: 200px; } /* 符号 */
th:nth-child(5), td:nth-child(5) { min-width: 200px; max-width: 200px; width: 200px; height: auto; max-height: 120px; }
th:nth-child(6), td:nth-child(6) { min-width: 200px; } /* 市值 */
th:nth-child(7), td:nth-child(7) { min-width: 120px; } /* 状态 */
th:nth-child(8), td:nth-child(8) { min-width: 180px; } /* 创建者 */
th:nth-child(9), td:nth-child(9) { min-width: 250px; } /* 创建时间 */
th:nth-child(10), td:nth-child(10) { min-width: 250px; } /* 更新时间 */
th:nth-child(11), td:nth-child(11) { min-width: 250px; } /* 链上时间 */
th:nth-child(12), td:nth-child(12) { min-width: 400px; } /* 社交媒体 */

/* 过滤面板样式 */
.filter-panel {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #e1e4e8;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.filter-header h3 {
    margin: 0;
    color: #24292e;
    font-size: 16px;
}

.clear-filters {
    padding: 6px 12px;
    font-size: 14px;
    background-color: #fff;
    border: 1px solid #e1e4e8;
    color: #24292e;
    width: auto;
}

.clear-filters:hover {
    background-color: #f3f4f6;
}

.filter-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group {
    display: flex;
    gap: 12px;
}

.filter-group input[type="text"],
.filter-group input[type="number"] {
    flex: 1;
    padding: 8px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    font-size: 14px;
}

.filter-group select {
    padding: 8px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    background-color: white;
    font-size: 14px;
    min-width: 120px;
}

/* 空状态提示样式 */
.empty-message {
    text-align: center;
    padding: 40px !important;
    color: #666;
    font-size: 16px;
    background-color: #f8f9fa;
}

/* 表格滚动容器 */
.table-scroll-container {
    width: 100%;
    overflow-x: auto;
    position: relative;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 设置表格最小宽度，确保所有列都能完整显示 */
#resultsTable {
    min-width: 1900px;
    margin-bottom: 0;
    border: none;
}

/* 固定表头 */
thead {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #f6f8fa;
}

/* 美化滚动条 */
.table-scroll-container::-webkit-scrollbar {
    height: 8px;
}

.table-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 表头内容容器 */
.th-content {
    display: flex;
    align-items: center;
    gap: 4px;
    padding-right: 16px; /* 为调整手柄留出空间 */
}

/* 调整手柄样式 */
.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: transparent;
    cursor: col-resize;
    transition: background-color 0.2s;
}

.resize-handle:hover {
    background-color: #0366d6;
}

/* 调整表头样式 */
th {
    position: relative;
    background-color: #f6f8fa;
    font-weight: 600;
    color: #24292e;
    user-select: none; /* 防止拖动时选中文本 */
}

/* 拖动时的视觉反馈 */
th.resizing {
    background-color: #f0f2f5;
}

/* 确保表格单元格内容在调整大小时不会换行 */
td, th {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 修改表格布局方式 */
#resultsTable {
    table-layout: fixed;
    min-width: 1400px;
}

/* 调整滚动容器样式 */
.table-scroll-container {
    overflow-x: auto;
    position: relative;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 拖动时的光标样式 */
.table-scroll-container.resizing {
    cursor: col-resize;
}

/* 加载状态样式 */
.results-container.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.results-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
}

/* 优化表格空状态显示 */
.empty-message {
    text-align: center;
    padding: 40px !important;
    color: #666;
    font-size: 16px;
    background-color: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

/* 优化工具提示显示 */
[title]:hover::after {
    z-index: 1001;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 300px;
    padding: 8px 12px;
    font-size: 13px;
    line-height: 1.4;
}

.database-selector {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    padding: 10px;
    background-color: #f6f8fa;
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 14px;
    color: #24292e;
}

/* 复制提示样式 */
.copy-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    pointer-events: none;
    animation: fadeInOut 1.5s ease-in-out;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { opacity: 0; }
}

/* 移动端适配样式 */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    /* 搜索区域适配 */
    .search-filters {
        flex-direction: column;
    }

    .filter-row {
        flex-direction: column;
        gap: 10px;
    }

    .market-cap-filter {
        flex-direction: column;
        width: 100%;
    }

    #launchStatus {
        width: 100%;
    }

    /* 数据库选择器适配 */
    .database-selector {
        flex-direction: column;
        gap: 10px;
    }

    /* 过滤面板适配 */
    .filter-group {
        flex-direction: column;
        gap: 10px;
    }

    .filter-group input[type="text"],
    .filter-group input[type="number"],
    .filter-group select {
        width: 100%;
    }

    /* 表格适配 */
    .table-scroll-container {
        margin: 0 -15px;
        width: calc(100% + 30px);
        border-radius: 0;
    }

    /* 分页适配 */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .pagination button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin: 10px 0;
    }
}

/* 移动端表格滚动提示 */
.table-scroll-hint {
    display: none;
    text-align: center;
    padding: 10px;
    color: #666;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

@media screen and (max-width: 768px) {
    .table-scroll-hint {
        display: block;
    }

    /* 调整复制按钮大小 */
    .copy-btn {
        padding: 8px;
    }

    .copy-btn svg {
        width: 20px;
        height: 20px;
    }

    /* 调整工具提示位置 */
    .copy-tooltip {
        position: fixed;
        left: 50% !important;
        bottom: 20px !important;
        top: auto !important;
        transform: translateX(-50%);
    }
}

/* 优化单元格内容显示 */
.name-cell, .symbol-cell, .description, .time-info {
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
    min-height: 40px;
    padding: 12px;
    overflow: visible;
}

/* 描述列样式优化 */
.description {
    max-height: 100px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px;
    font-size: 0.95em;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.description::-webkit-scrollbar {
    width: 6px;
}

.description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.description::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.description::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 市值列样式优化 */
td:nth-child(6) {
    font-size: 0.95em;
    font-weight: 500;
    text-align: right;
    padding-right: 20px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

/* 状态列样式优化 */
.status {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 6px 12px;
}

/* 时间列样式优化 */
.time-cell {
    padding: 12px 15px !important;
}

.time-info {
    font-size: 0.95em;
    text-align: center;
}

/* 社交媒体列样式优化 */
.social-links {
    padding: 15px;
    gap: 12px;
    min-width: 380px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.social-link {
    padding: 10px 15px;
    justify-content: center;
    min-width: 180px;
    max-width: calc(50% - 6px);
    margin-bottom: 6px;
}

/* 社交媒体图标优化 */
.social-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

/* 社交媒体链接文本 */
.social-link span {
    flex: 1;
    text-align: center;
    font-size: 0.9em;
}

/* 确保所有文本内容可以正常换行 */
td {
    white-space: normal;
    word-wrap: break-word;
    overflow: visible;
}

/* 描述列的表头和单元格样式统一 */
th:nth-child(5), td:nth-child(5) {
    min-width: 200px;
    max-width: 200px;
    width: 200px;
    height: auto;
    max-height: 120px;
}

td:nth-child(5) {
    white-space: normal;
    word-wrap: break-word;
    overflow: hidden;
}

/* 代币地址链接样式 */
.token-link {
    color: #1a73e8;
    text-decoration: none;
    transition: color 0.2s ease;
    font-family: monospace;
    font-size: 0.9em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.token-link:hover {
    color: #174ea6;
    text-decoration: underline;
}

.token-link:visited {
    color: #7b1fa2;
}
