body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f5f5f5;
}

.token-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.token-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.token-card:hover {
    transform: translateY(-2px);
}

.token-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.search-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.search-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    margin-bottom: 5px;
    font-size: 14px;
    color: #666;
}

input, select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

button {
    padding: 8px 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

button:hover {
    background: #45a049;
}

.dropdown-check-list {
    position: relative;
    display: inline-block;
    width: 100%;
}

.dropdown-check-list .anchor {
    position: relative;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
}

.dropdown-check-list .anchor:after {
    content: "";
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    margin-left: 8px;
}

.dropdown-check-list .items {
    padding: 4px;
    display: none;
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    width: 100%;
    z-index: 1;
    max-height: 300px;
    overflow-y: auto;
}

.dropdown-check-list .items label {
    display: block;
    padding: 8px;
    cursor: pointer;
    color: #333;
    transition: background 0.2s;
}

.dropdown-check-list .items label:hover {
    background: #f5f5f5;
}

.dropdown-check-list.visible .items {
    display: block;
}

.dropdown-check-list .items input[type="checkbox"] {
    margin-right: 8px;
}

.selected-labels {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
}

.selected-label {
    background: #e3f2fd;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.error {
    background: #ffebee;
    color: #c62828;
    padding: 16px;
    border-radius: 4px;
    margin: 20px 0;
    text-align: center;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #666;
}

.pagination {
    margin-top: 20px;
    text-align: center;
}

.pagination button {
    padding: 8px 16px;
    margin: 0 5px;
}

.pagination button:disabled {
    background: #ddd;
    cursor: not-allowed;
}

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

.token-links {
    margin: 10px 0;
}

.token-links a {
    margin-right: 10px;
    font-size: 20px;
    text-decoration: none;
}

.token-info {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.network, .label {
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.contract-address {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.copy-btn {
    padding: 2px 8px;
    font-size: 12px;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th {
    background: #f5f5f5;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

/* 设置每列的宽度 */
th:nth-child(1), td:nth-child(1) { width: 60px; }  /* 图片 */
th:nth-child(2), td:nth-child(2) { width: 160px; } /* 合约地址 */
th:nth-child(3), td:nth-child(3) { width: 120px; } /* 名称 */
th:nth-child(4), td:nth-child(4) { width: 80px; }  /* 简称 */
th:nth-child(5), td:nth-child(5) { width: 100px; } /* 市值 */
th:nth-child(6), td:nth-child(6) { width: 80px; }  /* 进度 */
th:nth-child(7), td:nth-child(7) { width: 160px; } /* 创建时间 */
th:nth-child(8), td:nth-child(8) { width: 200px; } /* 描述 */

td img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.address-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 40px;
}

.address-cell span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-cell .copy-btn {
    flex-shrink: 0;
    height: 28px;
    padding: 0 8px;
    line-height: 28px;
    transition: all 0.2s;
}

.address-cell .copy-btn.copied {
    background-color: #4caf50;  /* 绿色背景 */
    color: white;
    pointer-events: none;  /* 防止重复点击 */
}

.description-cell {
    max-width: 200px;
    position: relative;
    white-space: normal;  /* 允许换行 */
    max-height: 2.4em;  /* 两行的高度 */
    line-height: 1.2;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* 限制两行 */
    -webkit-box-orient: vertical;
}

.description-cell.expanded {
    max-height: none;
    -webkit-line-clamp: unset;
}

.expand-btn {
    position: absolute;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 0 4px;
    font-size: 12px;
    color: #1976d2;
    cursor: pointer;
    border: none;
    display: none;  /* 默认隐藏 */
}

.description-cell.expandable .expand-btn {
    display: block;  /* 当内容可展开时显示按钮 */
}

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

    .search-form {
        flex-direction: column;
        gap: 10px;
    }

    .form-group {
        width: 100%;
    }

    .form-group label {
        width: 80px;
    }

    .form-group input,
    .form-group select,
    .form-group button {
        flex: 1;
    }

    .table-container {
        margin: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px;
    }

    /* 调整列宽 */
    th:nth-child(1), td:nth-child(1) { width: 40px; }  /* 图片 */
    th:nth-child(2), td:nth-child(2) { width: 120px; } /* 合约地址 */
    th:nth-child(3), td:nth-child(3) { width: 100px; } /* 名称 */
    th:nth-child(4), td:nth-child(4) { width: 60px; }  /* 简称 */
    th:nth-child(5), td:nth-child(5) { width: 80px; }  /* 市值 */
    th:nth-child(6), td:nth-child(6) { width: 60px; }  /* 进度 */
    th:nth-child(7), td:nth-child(7) { width: 120px; } /* 创建时间 */
    th:nth-child(8), td:nth-child(8) { width: 150px; } /* 描述 */

    td img {
        width: 32px;
        height: 32px;
    }

    .address-cell {
        height: 32px;
    }

    .address-cell .copy-btn {
        height: 24px;
        line-height: 24px;
        padding: 0 4px;
        font-size: 12px;
    }

    .description-cell {
        max-width: 150px;
    }

    .pagination {
        margin: 10px;
    }

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

/* 针对超小屏幕的优化 */
@media screen and (max-width: 480px) {
    .search-form {
        gap: 8px;
    }

    .form-group label {
        width: 60px;
        font-size: 12px;
    }

    table {
        font-size: 11px;
    }

    th, td {
        padding: 6px;
    }

    .pagination button {
        padding: 4px 8px;
    }
} 