* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background: #f5f5f5;
    padding: 20px;
    padding-top: 100px;
}

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

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

.market-header h1 {
    font-size: 24px;
    color: #1a1a1a;
}

.search-bar input {
    padding: 10px 15px;
    width: 250px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #f5f5f5;
}

.search-bar input:focus {
    outline: none;
    border-color: #00b897;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 184, 151, 0.1);
}

.search-bar input::placeholder {
    color: #999;
}

.table-header {
    display: grid;
    grid-template-columns: 0.5fr 2fr 1fr 1fr 1fr 1fr 0.8fr;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 500;
    color: #666;
}

.table-row {
    display: grid;
    grid-template-columns: 0.5fr 2fr 1fr 1fr 1fr 1fr 0.8fr;
    padding: 15px;
    border-bottom: 1px solid #eee;
    align-items: center;
}

.table-row:hover {
    background: #f8f9fa;
}

.name-col {
    display: flex;
    align-items: center;
    gap: 10px;
}

.name-col img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* 删除之前的 img:error 样式，添加新的默认图标样式 */
.default-icon {
    width: 24px;
    height: 24px;
    background: #f7a600;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 500;
    font-size: 14px;
}

.coin-info {
    display: flex;
    flex-direction: column;
}

.symbol {
    font-weight: 500;
}

.name {
    font-size: 12px;
    color: #666;
}

.green {
    color: #00b897;
}

.red {
    color: #f6465d;
}

.trade-btn {
    padding: 6px 16px;
    background: #00b897;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    text-align: center;
}

.trade-btn:hover {
    background: #00a587;
}

.price-col {
    transition: background-color 0.3s ease-in-out;
}

.flash-green {
    animation: flashGreen 1s ease-in-out;
}

.flash-red {
    animation: flashRed 1s ease-in-out;
}

@keyframes flashGreen {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(0, 184, 151, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

@keyframes flashRed {
    0% {
        background-color: transparent;
    }
    50% {
        background-color: rgba(246, 70, 93, 0.1);
    }
    100% {
        background-color: transparent;
    }
}

.text-right {
    text-align: right;
    display: flex;
    justify-content: flex-end;
}

.pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 20px 0;
}

.page-info {
    color: #666;
    font-size: 14px;
}

.page-buttons {
    display: flex;
    gap: 5px;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    background: white;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.page-btn:hover {
    color: #00b897;
    border-color: #00b897;
}

.page-btn.active {
    background: #00b897;
    color: white;
    border-color: #00b897;
}

.page-btn.first,
.page-btn.last,
.page-btn.prev,
.page-btn.next {
    font-family: monospace;
}

.arrow {
    font-size: 14px;
    line-height: 1;
}

/* 确保交易按钮容器靠右对齐 */
.table-row .col:last-child {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

/* 添加到现有样式中 */
#crypto_select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
}

#crypto_select option {
    padding: 8px;
    display: flex;
    align-items: center;
}

#crypto_select option img {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    vertical-align: middle;
} 
@media (max-width: 768px) {
    .market-container{
        width: 100%;
    }
    .market-header{
        flex-direction: column;
        align-items: flex-start;
    }
    #searchInput{
        margin-top: 20px;
    }
    #rank_col,#rank_col2,#market_cap_col,#volume_col,#volume_col2,#trade_col,#trade_col2,#market_cap_col2,
    #coin2{
        display: none;
    }
    .name-col{
        gap: 5px;
    }
    .table-row ,.table-header{
        grid-template-columns: 1fr 2fr 1fr;
    }
}