/* 行情页面样式 */

/* 搜索区域 */
.search-section {
    padding: 12px 16px;
    background: rgba(15, 20, 45, 0.3);
    border-bottom: 1px solid rgba(60, 80, 160, 0.1);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(20, 30, 70, 0.4);
    border: 1px solid rgba(60, 80, 160, 0.3);
    border-radius: 12px;
    padding: 10px 16px;
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(30, 40, 80, 0.5);
}

.search-icon {
    color: #8b9dc3;
    margin-right: 10px;
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 14px;
}

.search-box input::placeholder {
    color: #6b7c93;
}

.clear-btn {
    background: transparent;
    border: none;
    color: #8b9dc3;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-btn:hover {
    color: #ffffff;
}

/* 分类标签 */
.market-tabs {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    background: rgba(15, 20, 45, 0.2);
    border-bottom: 1px solid rgba(60, 80, 160, 0.1);
}

.tab-btn {
    padding: 6px 20px;
    border-radius: 20px;
    border: 1px solid rgba(60, 80, 160, 0.3);
    background: rgba(30, 40, 90, 0.3);
    color: #b0c4de;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(60, 80, 160, 0.3);
}

.tab-btn.active {
    background: linear-gradient(135deg, #4a69bd 0%, #6a89cc 100%);
    border-color: #4a69bd;
    color: #ffffff;
}

/* 主流币种区域 */
.mainstream-section {
    padding: 16px 16px 20px;
    border-bottom: 1px solid rgba(60, 80, 160, 0.1);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.section-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.mainstream-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mainstream-card {
    background: rgba(30, 40, 80, 0.6);
    padding: 14px 10px;
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    border: 1px solid rgba(60, 80, 160, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
}

.favorite-btn-card {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #ffffff;
    font-size: 18px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.favorite-btn-card:hover {
    transform: scale(1.2);
    background: rgba(0, 0, 0, 0.7);
}

.favorite-btn-card.active {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.mainstream-card:hover {
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(40, 50, 90, 0.7);
}

.mainstream-card .coin-symbol {
    font-size: 13px;
    margin-bottom: 8px;
    opacity: 0.9;
    font-weight: 600;
}

.mainstream-card .coin-price {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 6px;
}

.mainstream-card .coin-change {
    font-size: 13px;
    font-weight: 600;
}

.mainstream-card .coin-change.positive {
    color: #4ade80;
}

.mainstream-card .coin-change.negative {
    color: #f87171;
}

/* 其他币种区域 */
.other-coins-section {
    padding: 16px 16px 80px;
}

.sort-controls {
    display: flex;
    gap: 8px;
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    background: transparent;
    border: 1px solid rgba(60, 80, 160, 0.2);
    border-radius: 6px;
    color: #8b9dc3;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.sort-btn:hover {
    border-color: rgba(102, 126, 234, 0.4);
    color: #b0c4de;
}

.sort-btn.active {
    border-color: #667eea;
    color: #667eea;
}

.sort-btn svg {
    transition: transform 0.2s;
}

.sort-btn.desc svg {
    transform: rotate(180deg);
}

.coins-header {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1.5fr;
    padding: 12px 16px;
    font-size: 12px;
    color: #6b7c93;
    background: rgba(20, 30, 60, 0.3);
    border-radius: 8px 8px 0 0;
    margin-top: 12px;
}

.col-name {
    text-align: left;
}

.col-price {
    text-align: right;
}

.col-change {
    text-align: right;
}

.coins-list {
    background: rgba(20, 30, 60, 0.3);
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(60, 80, 160, 0.15);
    border-top: none;
}

.coin-item {
    display: grid;
    grid-template-columns: 40px 2fr 1.5fr 1.5fr;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(60, 80, 160, 0.1);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.coin-item:last-child {
    border-bottom: none;
}

.coin-item:hover {
    background: rgba(30, 40, 80, 0.4);
}

/* 收藏按钮 */
.favorite-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    line-height: 1;
    z-index: 10;
}

.favorite-btn:hover {
    transform: scale(1.3);
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.5));
}

.favorite-btn.active {
    color: #ffd700;
    animation: starPulse 0.3s ease;
    filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
}

@keyframes starPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

.coin-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.coin-name {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.coin-pair {
    font-size: 12px;
    color: #6b7c93;
}

.coin-price-value {
    text-align: right;
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
}

.coin-change-value {
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    float: right;
}

.coin-change-value.positive {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.coin-change-value.negative {
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
}

/* 加载动画 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(80, 100, 200, 0.2);
    border-top-color: #4a69bd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 40px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7c93;
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 14px;
}

/* 白天模式 */
body.light-mode .search-box {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(100, 120, 200, 0.3);
}

body.light-mode .search-box:focus-within {
    border-color: rgba(102, 126, 234, 0.6);
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .search-box input {
    color: #1a202c;
}

body.light-mode .tab-btn {
    background: rgba(240, 245, 255, 0.6);
    color: #2d3748;
}

body.light-mode .mainstream-card,
body.light-mode .coins-list {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(100, 120, 200, 0.2);
}

body.light-mode .mainstream-card:hover {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .coin-name,
body.light-mode .coin-price,
body.light-mode .coin-price-value,
body.light-mode .section-header h3 {
    color: #1a202c;
}

body.light-mode .coin-item:hover {
    background: rgba(240, 245, 255, 0.8);
}

body.light-mode .coins-header {
    background: rgba(240, 245, 250, 0.8);
}

