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

/* 行情容器 */
.market-container {
    max-width: 1200px;
    margin: 0 auto;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 头部信息栏 */
.market-header {
    padding: 20px 24px;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.market-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.market-title i {
    color: #0ea5e9;
    font-size: 24px;
}

.market-title h1 {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #0ea5e9, #3b82f6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.global-stats {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #f1f5f9;
}

.stat-change {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
}

.positive {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.negative {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* 控制栏 */
.market-controls {
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    background: rgba(15, 23, 42, 0.7);
}

.search-box {
    position: relative;
    flex: 1;
    max-width: 300px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
}

.search-box input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    /*background: rgba(30, 41, 59, 0.8);*/
    /*border: 1px solid rgba(100, 116, 139, 0.3);*/
    border-radius: 12px;
    /*color: #e2e8f0;*/
    font-size: 14px;
    transition: all 0.3s;
}

.search-box input:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2);
}

.view-controls {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 10px 20px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 10px;
    color: #94a3b8;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.view-btn.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.time-filters {
    display: flex;
    gap: 8px;
}

.time-btn {
    padding: 8px 16px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(100, 116, 139, 0.3);
    border-radius: 8px;
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.time-btn:hover {
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.time-btn.active {
    background: rgba(14, 165, 233, 0.15);
    border-color: #0ea5e9;
    color: #0ea5e9;
}

/* 币种表格 */
.market-table-container {
    overflow-x: auto;
}

.market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.market-table thead {
    background: rgba(30, 41, 59, 0.8);
    position: sticky;
    top: 0;
    z-index: 10;
}

.market-table th {
    padding: 18px 16px;
    text-align: left;
    font-weight: 600;
    color: #94a3b8;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
}

.market-table th.sortable {
    cursor: pointer;
    transition: color 0.3s;
    user-select: none;
}

.market-table th.sortable:hover {
    color: #0ea5e9;
}

.market-table th i {
    margin-left: 5px;
    font-size: 12px;
    opacity: 0.7;
}

.market-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
}

.market-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.6);
}

.market-table td {
    padding: 16px;
    vertical-align: middle;
}

/* 币种信息单元格 */
.coin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: white;
}

.coin-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coin-name {
    font-weight: 600;
    color: #f1f5f9;
}

.coin-symbol {
    font-size: 12px;
    color: #94a3b8;
}

/* 价格单元格 */
.price-cell {
    font-weight: 600;
    font-size: 16px;
    color: #f1f5f9;
}

/* 涨跌幅单元格 */
.change-cell {
    font-weight: 600;
    font-size: 15px;
}

/* 市值单元格 */
.market-cap {
    font-weight: 500;
    color: #f1f5f9;
}

/* 交易量单元格 */
.volume {
    color: #94a3b8;
    font-size: 14px;
}

/* 收藏按钮 */
.favorite-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 50%;
}

.favorite-btn:hover {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
}

.favorite-btn.active {
    color: #fbbf24;
}

/* 底部统计 */
.market-footer {
    padding: 20px 24px;
    background: rgba(30, 41, 59, 0.8);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-info {
    display: flex;
    gap: 25px;
}

.footer-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.footer-label {
    font-size: 12px;
    color: #94a3b8;
}

.footer-value {
    font-size: 14px;
    font-weight: 600;
    color: #f1f5f9;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .market-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .global-stats {
        width: 100%;
        justify-content: space-between;
    }

    .stat-box {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 768px) {


    .market-container {
        border-radius: 16px;
    }

    .market-header,
    .market-controls,
    .market-footer {
        padding: 16px;
    }

    .market-title h1 {
        font-size: 20px;
    }

    .global-stats {
        gap: 15px;
    }

    .stat-box {
        min-width: 100px;
    }

    .market-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .search-box {
        max-width: 100%;
    }

    .view-controls {
        justify-content: center;
    }

    .time-filters {
        justify-content: center;
        flex-wrap: wrap;
    }

    .market-table th,
    .market-table td {
        padding: 12px 10px;
    }

    .coin-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .price-cell {
        font-size: 15px;
    }

    .change-cell {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .market-title h1 {
        font-size: 18px;
    }

    .stat-value {
        font-size: 14px;
    }

    .view-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .time-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .market-table th,
    .market-table td {
        padding: 10px 8px;
        font-size: 13px;
    }

    .coin-info {
        gap: 8px;
    }

    .coin-icon {
        width: 28px;
        height: 28px;
    }

    .coin-name {
        font-size: 14px;
    }

    .price-cell {
        font-size: 14px;
    }

    .footer-info {
        flex-direction: column;
        gap: 15px;
    }

    .footer-item {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.market-table tbody tr {
    animation: fadeIn 0.5s ease-out forwards;
}

.market-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.market-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.market-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.market-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.market-table tbody tr:nth-child(5) { animation-delay: 0.5s; }

/* 滚动条样式 */
.market-table-container::-webkit-scrollbar {
    height: 8px;
}

.market-table-container::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 4px;
}

.market-table-container::-webkit-scrollbar-thumb {
    background: rgba(100, 116, 139, 0.5);
    border-radius: 4px;
}

.market-table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.7);
}
