/* 基础响应式设计移除移动端点击高亮 */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent; 
    -moz-tap-highlight-color: transparent;
    -ms-tap-highlight-color: transparent;
}

body {
    width:100%;
    margin: 20px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

/* 超过一行显示省略号 */
.overflow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 正在加载中 */
.loading-indicator {
    position: absolute;
    top: 37%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 5px 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    z-index: 999;
    display: block;
}

/* 重试按钮 */
.retry-button {
    display: none;
    margin-top: 10px;
    padding: 5px 15px;
    background-color: #00cf95;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 14px;
}
.retry-button:hover {
    background-color: #00b4d8;
}

/* 标题样式 */
.market-title {
    text-align: center;
    font-size: 2.5rem;
    color: #2c3e50;
    margin: 1.5rem 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    position: relative;
    background: -webkit-linear-gradient(15deg, #00b4d8 0%, #00cf95 100%);
    background: -moz-linear-gradient(15deg, #00b4d8 0%, #00cf95 100%);
    background: -o-linear-gradient(15deg, #00b4d8 0%, #00cf95 100%);
    background: linear-gradient(15deg, #00b4d8 0%, #00cf95 100%);
    -webkit-background-clip: text;
    -moz-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-text-fill-color: transparent;
    color: transparent;
}

/* 标题移动端优化 */
@media (max-width: 768px) {
    .market-title {
        font-size: 2rem;
        margin: 1rem 0;
        letter-spacing: 1px;
    }
}

/* 连接状态指示器样式 */
#connection-status-fixed {
    display: block;
    width: 65px;
    height: 3px;
    background: #666;
    margin: 0.5rem auto;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
    overflow: hidden;
}
#connection-status-fixed.connected {
    background-color: #00cf95;
}
#connection-status-fixed.connecting {
    background-color: #f7a700;
}
#connection-status-fixed.connecting::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    animation: flow-light 1.5s infinite;
}
#connection-status-fixed.disconnected {
    background-color: #f75151;
}

@keyframes flow-light {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 搜索框样式 */
.search-container {
    width: 350px;
    margin: 1rem auto;
    position: relative;
}
#searchInput {
    width: 100%;
    padding: 0.6rem 1rem;
    border: 2px solid #00b4d8;
    border-radius: 20px;
    font-size: 0.9rem;
    box-sizing: border-box;
    transition: all 0.3s ease;
    background: #f8f9fa;
    outline: none;
}

#searchInput:focus {
    border-color: #00cf95;
    box-shadow: 0 0 8px rgba(0,207,149,0.3);
    background: #fff;
    outline: none;
}

/* 无结果提示样式 */
.no-search-message, .no-favorites-message {
    background-color: #f9f9f9;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    margin: 20px auto;
    max-width: 400px;
}
.no-search-message button, .no-favorites-message button {
    transition: all 0.3s;
}
.no-search-message button:hover, .no-favorites-message button:hover {
    background-color: #00b4d8;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
/* 搜索框移动端优化 */
@media (max-width: 768px) {
    .search-container {
        width: 70%;
        margin: 10px auto;
    }
    #searchInput {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/*币种列表*/
.market-list {
    width:500px;
    margin:10px auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
@media (max-width: 768px) {
    .market-list {
        width: 95%;
    }
}
.market-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* 两端对齐 */
    padding: 10px;
    background-color: #f5f5f5;
    font-weight: bold;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.market-left-header {
    text-align: left;
}
.market-right-container {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    align-items: center;
    height: 25px;
    line-height: 25px;
}
.market-middle-header, .market-right-header {
    text-align: right;
}
.market-middle-header {
    display: flex;
    align-items: center;
}
.market-href {
    color: #333;
    transition: color 0.3s ease;
}
.market-href:hover {
    color: #666;
    text-decoration: none;
}
.market-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.market-item {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 5px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    transform-origin: left;
    flex-wrap: wrap;
}
.market-item:hover {
    transform: scale(1.01);
    background: rgba(0,123,255,0.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.market-left {
    display: flex;
    align-items: center;
    margin-right: 10px;
}
.market-left img {
    width: 28px;
    height: 28px;
    object-fit: cover;
}
.market-left-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}
.market-name {
    font-weight: bold;
    font-size: 14px;
}
.market-symbol {
    font-size: 12px;
    color: #666;
}
.market-middle {
    text-align: right;
    margin-right: 15px;
}
.market-price {
    font-weight: bold;
    font-size: 1.2em;
}
.market-change {
    text-align: center;
    width: 70px;
    border-radius: 4px;
    height: 25px;
    line-height: 25px;
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}
.market-change-value {
    text-align: center;
    min-width: 60px;
    color: #fff;
    padding: 0 5px;
    font-size:0.9em;
}
.market-change.positive {
    background-color: #02b36d; /* 正值背景色 */
}
.market-change.negative {
    background-color: #f75151; /* 负值背景色 */
}

/*汇率切换样式*/
.currency-selector-container {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border: 1px solid #ddd;    
    padding: 5px 15px;
    margin:0 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}
@media (max-width: 768px) {
    .currency-selector-container {
        padding: 6px 10px;
        height: 35px;
    }
}
.filter-controls {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
    border-radius: 4px;
    height: 40px;
    justify-content: center;
    gap: 5px;
}
.currency-label {
    font-size: 0.9rem;
}
.currency-selector {
    position: relative;
    vertical-align: middle;
    gap: 4px;
    margin-left: 4px;
    z-index: 100;
}
.currency-icon {
    cursor: pointer;
    font-size: 0.92rem;
    background: none;
    border: none;
    padding: 0 0 0 4px;
    margin: 0;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    vertical-align: baseline;
    color: #00cf95;
}
.currency-icon:hover {
    background-color: #f0f0f0;
}
.currency-dropdown {
    display: none;
    position: absolute;
    top: 27px;
    background-color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 4px;
    overflow: hidden;
    z-index: 101;
    min-width: 85px;
    border: 1px solid #e0e0e0;
}
.currency-dropdown.show {
    display: block;
}
.currency-option {
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}
.currency-option:hover {
    background-color: #f5f5f5;
}
.currency-option.active {
    background-color: #e0e0e0;
    font-weight: bold;
}

/* 收藏功能样式 */
.favorite-button {
    cursor: pointer;
    margin-left: 5px;
    color: #ccc;
    font-size: 18px;
    transition: color 0.3s;
}
.favorite-button:hover {
    color: #ffcc00;
}
.favorite-button.active {
    color: #ffcc00;
}
.favorite-filter {
    display: flex;
    justify-content: center;
    margin: 10px 0;
}
.favorite-filter button {
    padding: 5px 15px;
    margin: 0 5px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}
.favorite-filter button.active {
    background-color: #00cf95;
    color: white;
    border-color: #00cf95;
}
.favorite-filter button:hover {
    background-color: #e0e0e0;
}
.favorite-filter button.active:hover {
    background-color: #00b4d8;
}
.market-item .star-container {
    display: flex;
    align-items: center;
    margin-right: 5px;
}
/* 全部及收藏移动端优化 */
@media (max-width: 768px) {
    .favorite-filter button {
        padding: 6px 15px;
        font-size: 0.9rem;
    }
}

/* 价格头部容器样式 */
.price-header-container {
    display: inline-flex;
    align-items: center;
    margin-right: 5px;
    height: 25px;
    line-height: 25px;
}

/* 排序样式 */
.sortable {
    cursor: pointer;
    position: relative;
    user-select: none;
    display: inline-flex;
    align-items: center;
}
.sort-icon {
    display: inline-flex;
    position: relative;
    width: 8px;
    height: 14px;
    margin-left: 5px;
    align-items: center;
}
/* 上箭头 */
.sort-icon:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 5px solid #aaa;
    opacity: 0.5;
}
/* 下箭头 */
.sort-icon:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid #aaa;
    opacity: 0.5;
}
/* 升序时上箭头高亮 */
.sortable.asc .sort-icon:before {
    border-bottom-color: #00cf95;
    opacity: 1;
}
/* 降序时下箭头高亮 */
.sortable.desc .sort-icon:after {
    border-top-color: #00cf95;
    opacity: 1;
}
/* 鼠标悬停效果 */
.sortable:hover .sort-icon:before,
.sortable:hover .sort-icon:after {
    opacity: 0.8;
}

/* K线图容器样式 */
.kline-row {
    width: 100%;
    margin-top: 15px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding: 10px 0;
}

/* 分页容器 */
.pagination {
    width: 500px;
    margin: 15px auto;
    padding: 12px 0;
    background: #f8f9fa;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* 分页按钮 */
.pagination button {
    min-width: 80px;
    padding: 6px 8px;
    margin: 0 5px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.5;
}

/* 悬停效果 */
.pagination button:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* 禁用状态 */
.pagination button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
    transform: none;
    box-shadow: none;
}

.pagination span {
    padding: 0 10px;
}

/* 页码信息 */
#pageInfo {
    margin: 0 10px;
    font-weight: 500;
    color: #2d3436;
    font-size: 14px;
    text-align: center;
}

/* 交易所按钮样式 */
.exchange-btn {
    background: linear-gradient(135deg, #00cf95 0%, #00b4d8 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(0, 207, 149, 0.4), 0 2px 8px rgba(0, 180, 216, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-block;
    text-align: center;
    min-width: 130px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.exchange-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 207, 149, 0.5), 0 4px 15px rgba(0, 180, 216, 0.4);
    background: linear-gradient(135deg, #00b4d8 0%, #00cf95 100%);
    text-decoration: none;
    color: white;
}

.exchange-btn:active {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 15px rgba(0, 207, 149, 0.4);
}

.exchange-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.exchange-btn:hover::before {
    left: 100%;
}

/* 添加按钮内部的图标效果 */
.exchange-btn::after {
    content: '→';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0;
    transition: all 0.3s ease;
}

.exchange-btn:hover::after {
    opacity: 1;
    right: 12px;
}

/* 交易所按钮移动端优化 */
@media (max-width: 768px) {
    .exchange-btn {
        padding: 12px 20px;
        font-size: 13px;
        min-width: 120px;
        border-radius: 20px;
        letter-spacing: 0.3px;
    }
    
    .exchange-btn:hover {
        transform: translateY(-2px) scale(1.03);
        box-shadow: 0 6px 20px rgba(0, 207, 149, 0.4);
    }
    
    .exchange-btn::after {
        right: 12px;
        font-size: 14px;
    }
    
    .exchange-btn:hover::after {
        right: 10px;
    }
}

/* 分页手机端优化 */
@media (max-width: 768px) {
    .pagination {
        width: 95%;
        padding: 10px 0;
        flex-wrap: wrap;
    }
    
    /* 移动设备上禁用按钮的明显样式 */
    .pagination button:disabled {
        background: #cccccc;
        color: #999999;
        opacity: 0.5;
    }
    
    /* 移动设备上不使用hover效果 */
    .pagination button:hover {
        background: #007bff;
        transform: none;
        box-shadow: none;
    }
    
    /* 移动设备上禁用按钮不应该有hover效果 */
    .pagination button:disabled:hover {
        background: #cccccc;
    }
}
