/**
 * Market Page Styles - Design Matching
 * @author AI Assistant
 * @created 2026-03-03
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card: #141414;
    --bg-card-hover: #1f1f1f;

    --text-primary: #ffffff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent-primary: #FFD700;
    --accent-hover: #e6c200;

    --success: #22c55e;
    --danger: #ef4444;

    --border-primary: #2a2a2a;
    --border-secondary: #1f1f1f;

    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;

    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Fear & Greed Colors */
    --fg-extreme-fear: #ef4444;
    --fg-fear: #f97316;
    --fg-neutral: #eab308;
    --fg-greed: #22c55e;
    --fg-extreme-greed: #16a34a;

    /* JPMS Featured Colors */
    --jpms-gold: #FFD700;
    --jpms-gold-light: rgba(255, 215, 0, 0.15);
    --jpms-gold-border: rgba(255, 215, 0, 0.4);
}

/* ========================================
   Base Styles
   ======================================== */
.market-section {
    background-color: var(--bg-primary);
    min-height: 100vh;
    padding: 24px 0 40px;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

/* Section Title */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
}

/* ========================================
   Overview Grid - Single Row Layout
   ======================================== */
.overview-grid {
    display: grid;
    grid-template-columns: 280px 1fr 1fr;
    grid-template-rows: auto;
    gap: 16px;
    margin-bottom: 32px;
}

/* Fear & Greed - Left column */
.fear-greed-card {
    grid-row: 1;
    grid-column: 1;
}

/* JPMS Featured Card - Middle */
.jpms-featured-card {
    grid-row: 1;
    grid-column: 2;
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(255, 215, 0, 0.05) 100%);
    border: 1px solid var(--jpms-gold-border);
    position: relative;
    overflow: hidden;
}

.jpms-featured-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--jpms-gold), transparent);
}

/* Trending - Right */
.trending-card {
    grid-row: 1;
    grid-column: 3;
}

@media (max-width: 1024px) {
    .overview-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
    }

    .fear-greed-card {
        grid-row: 1;
        grid-column: 1;
    }

    .jpms-featured-card {
        grid-row: 1;
        grid-column: 2;
    }

    .trending-card {
        grid-row: 2;
        grid-column: 1 / 3;
    }
}

@media (max-width: 768px) {
    .overview-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
    }

    .fear-greed-card,
    .jpms-featured-card,
    .trending-card {
        grid-row: auto;
        grid-column: 1;
    }
}

/* ========================================
   Overview Card Base
   ======================================== */
.overview-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.overview-card h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.overview-card h3 .highlight {
    color: var(--accent-primary);
}

.overview-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.view-more-link {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.view-more-link svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   JPMS Featured Card Styles
   ======================================== */
.jpms-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--jpms-gold), #FFA500);
    color: #000;
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-md);
    margin-right: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jpms-featured-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.jpms-coin-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.jpms-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--jpms-gold) 0%, #FFA500 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 18px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.jpms-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
}

.jpms-info-text {
    display: flex;
    flex-direction: column;
}

.jpms-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.jpms-pair {
    font-size: 12px;
    color: var(--text-muted);
}

.jpms-price-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jpms-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, monospace;
}

.jpms-change {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-md);
}

.jpms-change.positive {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.jpms-change.negative {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.jpms-chart-container {
    width: 100%;
    height: 70px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow: hidden;
}

#jpmsChartCanvas {
    width: 100%;
    height: 100%;
}

.jpms-actions {
    margin-top: auto;
}

.btn-buy-jpms {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, var(--jpms-gold) 0%, #FFA500 100%);
    color: #000;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-buy-jpms:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.btn-buy-jpms svg {
    width: 18px;
    height: 18px;
}

/* JPMS Small Icon for Trending */
.trending-icon.jpms-small,
.trending-icon .jpms-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--jpms-gold) 0%, #FFA500 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-size: 14px;
    font-weight: 700;
}

/* ========================================
   Fear & Greed Index - Gauge Style
   ======================================== */
.fear-greed-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.fear-greed-chart-container {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    min-height: 120px;
    height: 120px;
    margin-bottom: 12px;
    overflow: visible;
}

#fearGreedCanvas {
    width: 100%;
    max-width: 240px;
    height: 120px;
}

.fear-greed-value {
    position: absolute;
    bottom: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fear-greed-value .value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    font-family: 'SF Mono', Monaco, monospace;
}

.fear-greed-value .label {
    font-size: 12px;
    font-weight: 500;
    color: var(--success);
    margin-top: 2px;
}

.fear-greed-value .sub-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 1px;
}

.fear-greed-scale {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid var(--border-primary);
}

.scale-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.scale-line {
    width: 2px;
    height: 12px;
    border-radius: 1px;
}

.scale-line.extreme-fear { background-color: var(--fg-extreme-fear); }
.scale-line.fear { background-color: var(--fg-fear); }
.scale-line.neutral { background-color: var(--fg-neutral); }
.scale-line.greed { background-color: var(--fg-greed); }
.scale-line.extreme-greed { background-color: var(--fg-extreme-greed); }

.scale-num {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
}

.scale-text {
    font-size: 9px;
    color: var(--text-muted);
    text-align: center;
    max-width: 50px;
    line-height: 1.2;
}

/* ========================================
   Trending
   ======================================== */
.trending-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.trending-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.trending-coin {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trending-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.trending-icon.bitcoin {
    background: linear-gradient(135deg, #f7931a 0%, #ffad33 100%);
}

.trending-icon.ethereum {
    background: linear-gradient(135deg, #627eea 0%, #8ba4f7 100%);
}

.trending-icon.chainlink {
    background: linear-gradient(135deg, #2a5ada 0%, #4a7afa 100%);
}

.trending-icon.solana {
    background: linear-gradient(135deg, #00b4d8 0%, #48cae4 100%);
}

.trending-icon.bnb {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.trending-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
    margin: 0 auto;
}

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

.trending-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.trending-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
}

.trending-price {
    font-size: 13px;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, monospace;
    font-weight: 500;
}

.trending-change {
    font-size: 12px;
    font-weight: 500;
}

.trending-change.positive { color: var(--success); }
.trending-change.negative { color: var(--danger); }

/* ========================================
   Market Table Section
   ======================================== */
.market-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: 24px;
}

/* ========================================
   Market Tabs
   ======================================== */
.market-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.market-tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.market-tab:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.market-tab.active {
    color: var(--accent-primary);
    background: rgba(255, 215, 0, 0.1);
}

/* ========================================
   Market Toolbar
   ======================================== */
.market-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-box {
    position: relative;
    width: 280px;
}

.search-box .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.search-box input {
    width: 100%;
    padding: 10px 12px 10px 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 14px;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.filter-dropdown {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
}

.filter-btn svg {
    width: 16px;
    height: 16px;
}

.filter-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    display: none;
    margin-top: 4px;
}

.filter-menu.show {
    display: block;
}

.filter-option {
    padding: 8px 16px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-option:hover {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.filter-option.active {
    color: var(--accent-primary);
    background: rgba(255, 215, 0, 0.1);
}

/* ========================================
   Market Table
   ======================================== */
.market-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 900px;
}

.market-table th {
    text-align: left;
    padding: 16px 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-primary);
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.market-table th:hover {
    color: var(--text-primary);
}

.market-table th .sort-icon {
    margin-left: 4px;
    opacity: 0.5;
    font-size: 10px;
}

.market-table th:hover .sort-icon {
    opacity: 1;
}

.market-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-primary);
    vertical-align: middle;
}

.market-table tbody tr {
    transition: background-color 0.2s ease;
}

.market-table tbody tr:hover {
    background: var(--bg-card-hover);
}



.market-table tbody tr:last-child td {
    border-bottom: none;
}

/* ========================================
   JPMS Row - 简洁样式
   ======================================== */

/* 只保留 JPMS 图标样式 */
.coin-icon.jpms {
    background: linear-gradient(135deg, var(--jpms-gold) 0%, #FFA500 100%);
    color: #000;
}

/* Coin Cell */
.coin-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.coin-rank {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 24px;
    text-align: center;
}

.coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
}

.coin-icon-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.coin-icon.bitcoin {
    background: linear-gradient(135deg, #f7931a 0%, #ffad33 100%);
}

.coin-icon.ethereum {
    background: linear-gradient(135deg, #627eea 0%, #8ba4f7 100%);
}

.coin-icon.solana {
    background: linear-gradient(135deg, #00b4d8 0%, #48cae4 100%);
}

.coin-icon.cardano {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
}

.coin-icon.polkadot {
    background: linear-gradient(135deg, #9333ea 0%, #a855f7 100%);
}

.coin-icon.dogecoin {
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
}

.coin-icon.bnb {
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
}

.coin-icon.ripple {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
}

.coin-icon.chainlink {
    background: linear-gradient(135deg, #2a5ada 0%, #4a7afa 100%);
}

.coin-icon.polygon {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
}

.coin-icon.avalanche {
    background: linear-gradient(135deg, #06b6d4 0%, #22d3ee 100%);
}

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

.coin-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.coin-symbol {
    font-size: 12px;
    color: var(--text-muted);
}

/* Price Cell */
.price-cell {
    font-size: 14px;
    color: var(--text-primary);
    font-family: 'SF Mono', Monaco, monospace;
    text-align: right;
    font-weight: 500;
}

/* Change Cell */
.change-cell {
    text-align: right;
    min-width: 70px;
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 13px;
    font-weight: 500;
}

.change-cell.positive {
    color: var(--success);
}

.change-cell.negative {
    color: var(--danger);
}

/* Markets Cell */
.markets-cell {
    text-align: center;
    font-size: 13px;
    color: var(--text-secondary);
    font-family: 'SF Mono', Monaco, monospace;
}

/* Sparkline Cell */
.sparkline-cell {
    width: 100px;
    height: 40px;
    min-height: 40px;
    max-height: 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.sparkline-chart {
    width: 100px !important;
    height: 40px !important;
    max-width: 100px;
    max-height: 40px;
    display: block;
}

/* ========================================
   No Results
   ======================================== */
.no-results {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    text-align: center;
}

.no-results.show {
    display: flex;
}

.no-results svg {
    width: 48px;
    height: 48px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.no-results p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Hidden rows for pagination */
#marketTableBody tr.hidden {
    display: none;
}

/* ========================================
   Pagination
   ======================================== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

.page-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--border-primary);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.page-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-btn svg {
    width: 16px;
    height: 16px;
}

.page-numbers {
    display: flex;
    gap: 4px;
}

/* ========================================
   Responsive Styles
   ======================================== */

/* 桌面端优化 (>= 1024px) */
@media (min-width: 1024px) {
    .market-section {
        padding: 40px 0 60px;
    }
    
    .market-section .container {
        padding: 0 48px;
    }
    
    .overview-grid {
        grid-template-columns: 320px 1fr 1fr;
        gap: 24px;
    }
    
    .market-table-container {
        padding: 32px;
    }
    
    .market-table th {
        padding: 20px 16px;
        font-size: 12px;
    }
    
    .market-table td {
        padding: 20px 16px;
    }
}

/* 平板端 (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
    
    .market-section {
        padding: 32px 0 40px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto auto;
        gap: 16px;
    }
    
    .fear-greed-card {
        grid-row: 1 / 3;
        grid-column: 1;
    }
    
    .jpms-featured-card {
        grid-row: 1;
        grid-column: 2;
    }
    
    .trending-card {
        grid-row: 2;
        grid-column: 1 / 3;
    }

    .market-table-container {
        padding: 20px;
    }
    
    /* 平板端隐藏 Markets 列 */
    .market-table th:nth-child(5),
    .market-table td:nth-child(5) {
        display: none;
    }
    
    .market-table {
        min-width: 700px;
    }
}

@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .market-section {
        padding: 20px 0 32px;
    }
    
    .overview-card {
        padding: 16px;
    }
    
    .fear-greed-chart-container {
        min-height: 100px;
    }

    #fearGreedCanvas {
        height: 100px;
    }

    .fear-greed-value .value {
        font-size: 32px;
    }

    /* JPMS Featured Card Tablet */
    .jpms-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .jpms-name {
        font-size: 16px;
    }
    
    .jpms-price {
        font-size: 24px;
    }
    
    .jpms-chart-container {
        height: 60px;
    }
}

/* 移动端 (< 768px) */
@media (max-width: 767px) {
    .market-section {
        padding: 16px 0 24px;
    }
    
    .container {
        padding: 0 16px;
    }
    
    .section-title {
        font-size: 18px;
        margin-bottom: 16px;
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
        margin-bottom: 24px;
    }
    
    .fear-greed-card,
    .jpms-featured-card,
    .trending-card {
        grid-row: auto;
        grid-column: 1;
    }
    
    .overview-card {
        padding: 16px;
    }
    
    .overview-card h3 {
        font-size: 13px;
        margin-bottom: 12px;
    }
    
    /* JPMS Featured Card Mobile */
    .jpms-featured-card {
        padding: 16px;
    }
    
    .jpms-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .jpms-name {
        font-size: 16px;
    }
    
    .jpms-pair {
        font-size: 11px;
    }
    
    .jpms-price {
        font-size: 22px;
    }
    
    .jpms-change {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .jpms-chart-container {
        height: 50px;
    }
    
    .btn-buy-jpms {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    /* Fear & Greed Mobile */
    .fear-greed-chart-container {
        min-height: 100px;
    }

    #fearGreedCanvas {
        height: 100px;
    }

    .fear-greed-value .value {
        font-size: 28px;
    }

    .fear-greed-value .label {
        font-size: 11px;
    }

    .fear-greed-scale {
        padding-top: 8px;
    }

    .scale-text {
        font-size: 8px;
    }

    /* Trending Mobile */
    .trending-item {
        padding: 10px 0;
    }

    /* Market Table Container Mobile */
    .market-table-container {
        padding: 16px;
        overflow-x: auto;
        border-radius: var(--radius-lg);
    }
    
    /* Market Tabs Mobile */
    .market-tabs {
        gap: 6px;
        margin-bottom: 16px;
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }
    
    .market-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .market-tab {
        padding: 8px 12px;
        font-size: 13px;
        flex-shrink: 0;
        min-height: 36px;
    }
    
    /* Market Toolbar Mobile */
    .market-toolbar {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 16px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        font-size: 16px;
        padding: 12px 12px 12px 40px;
        min-height: 44px;
    }
    
    .filter-dropdown {
        width: 100%;
    }
    
    .filter-btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }
    
    /* Market Table Mobile */
    .market-table {
        min-width: 700px;
    }
    
    .market-table th,
    .market-table td {
        padding: 12px 8px;
    }
    
    .market-table th {
        font-size: 10px;
        letter-spacing: 0.3px;
    }
    
    /* 移动端隐藏 Markets 和 Chart 列 */
    .market-table th:nth-child(5),
    .market-table td:nth-child(5),
    .market-table th:nth-child(7),
    .market-table td:nth-child(7) {
        display: none;
    }
    
    /* Coin Cell Mobile */
    .coin-cell {
        gap: 8px;
    }
    
    .coin-icon {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .coin-name {
        font-size: 13px;
    }
    
    .coin-symbol {
        font-size: 11px;
    }
    
    /* Price & Change Mobile */
    .price-cell {
        font-size: 13px;
    }
    
    .change-cell {
        font-size: 12px;
        min-width: 60px;
    }
    
    /* Sparkline Mobile */
    .sparkline-cell {
        width: 80px;
        height: 32px;
    }

    /* Pagination Mobile */
    .pagination {
        margin-top: 16px;
        padding-top: 16px;
    }
    
    .page-btn {
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        font-size: 13px;
    }
    
    .page-numbers {
        gap: 4px;
    }
    
    /* No Results Mobile */
    .no-results {
        padding: 32px 16px;
    }
    
    .no-results svg {
        width: 40px;
        height: 40px;
    }
    
    .no-results p {
        font-size: 13px;
    }
}

/* 小屏移动端 (< 480px) */
@media (max-width: 479px) {
    .container {
        padding: 0 12px;
    }
    
    .overview-card {
        padding: 12px;
    }
    
    .market-table-container {
        padding: 12px;
        border-radius: var(--radius-md);
    }
    
    .market-tab {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    /* JPMS Featured Card Small Mobile */
    .jpms-featured-card {
        padding: 12px;
    }
    
    .jpms-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .jpms-name {
        font-size: 14px;
    }
    
    .jpms-price {
        font-size: 20px;
    }
    
    .jpms-price-section {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    /* Market Table Small Mobile */
    .market-table {
        min-width: 600px;
    }
    
    .market-table th,
    .market-table td {
        padding: 10px 6px;
    }
    
    .market-table th {
        font-size: 9px;
    }

    /* Coin Cell Small Mobile */
    .coin-cell {
        gap: 6px;
    }
    
    .coin-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .coin-name {
        font-size: 12px;
    }
    
    .coin-symbol {
        font-size: 10px;
    }
    
    /* Price & Change Small Mobile */
    .price-cell {
        font-size: 12px;
    }
    
    .price-cell.jpms-price {
        font-size: 12px;
    }
    
    .change-cell {
        font-size: 11px;
        min-width: 50px;
    }
    
    /* Pagination Small Mobile */
    .pagination {
        gap: 4px;
    }
    
    .page-btn {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* ========================================
   Price Flash Animation
   ======================================== */

/* 价格上涨动画 - 绿色闪烁 */
@keyframes priceFlashUp {
    0% {
        background-color: rgba(34, 197, 94, 0.3);
        color: #22c55e;
    }
    50% {
        background-color: rgba(34, 197, 94, 0.1);
    }
    100% {
        background-color: transparent;
        color: inherit;
    }
}

/* 价格下跌动画 - 红色闪烁 */
@keyframes priceFlashDown {
    0% {
        background-color: rgba(239, 68, 68, 0.3);
        color: #ef4444;
    }
    50% {
        background-color: rgba(239, 68, 68, 0.1);
    }
    100% {
        background-color: transparent;
        color: inherit;
    }
}

/* 价格变动动画类 */
.price-flash-up {
    animation: priceFlashUp 1s ease-out;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.price-flash-down {
    animation: priceFlashDown 1s ease-out;
    border-radius: 4px;
    transition: all 0.3s ease;
}

/* JPMS价格特殊样式 */
#jpmsPrice.price-flash-up,
#jpmsTrendingPrice.price-flash-up,
#jpmsTopPrice.price-flash-up {
    color: #22c55e;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
}

#jpmsPrice.price-flash-down,
#jpmsTrendingPrice.price-flash-down,
#jpmsTopPrice.price-flash-down {
    color: #ef4444;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

/* 表格价格单元格动画 */
.price-cell.price-flash-up {
    color: #22c55e;
    font-weight: 600;
}

.price-cell.price-flash-down {
    color: #ef4444;
    font-weight: 600;
}

/* ========================================
   Loading State
   ======================================== */

/* 加载动画 */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* 价格加载占位符 */
.price-loading {
    display: inline-block;
    width: 80px;
    height: 16px;
    background: var(--bg-secondary);
    border-radius: 4px;
    animation: shimmer 1.5s infinite;
    background: linear-gradient(
        90deg,
        var(--bg-secondary) 25%,
        var(--bg-card-hover) 50%,
        var(--bg-secondary) 75%
    );
    background-size: 200% 100%;
}

/* ========================================
   Error State
   ======================================== */

/* API错误提示 */
.api-error-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--danger);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.api-error-toast.hide {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}
