/* Swap页面专用样式 */

.swap-container {
    display: grid;
    grid-template-columns: 1fr 600px;
    gap: 40px;
    margin-top: 40px;
    padding: 40px 0;
}

.swap-card {
    max-width: 600px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* OKX风格的Swap界面 */
.swap-interface {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}

.swap-input-section {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.swap-input-section:hover {
    border-color: #d1d5db;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.swap-input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.swap-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
}

.balance-info {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 100%;
}

.balance-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.refresh-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

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

.refresh-btn i {
    font-size: 12px;
}

.balance-text {
    font-size: 12px;
    color: #9ca3af;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

.max-btn {
    background: #f3f4f6;
    border: none;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
    line-height: 1.4;
    display: flex;
    align-items: center;
    height: 24px;
}

.max-btn:hover {
    background: #e5e7eb;
}

.swap-input-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-direction: row;
    background: #ffffff;
    border-radius: 12px;
    padding: 4px;
}

.amount-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.amount-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    font-size: 28px;
    font-weight: 600;
    color: #1a1a1a;
    outline: none;
    text-align: right;
    border-radius: 8px;
}

.amount-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.token-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
}

.token-section:hover {
    background: #f9fafb;
}

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

.token-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.token-details {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
}

.token-symbol {
    font-weight: 600;
    color: #1a1a1a;
    font-size: 16px;
    line-height: 1.2;
}

.token-name {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.2;
}

.swap-arrow {
    display: flex;
    justify-content: center;
    margin: 8px 0;
    position: relative;
    z-index: 10;
}

.swap-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.swap-btn:hover {
    transform: scale(1.05);
    border-color: #d1d5db;
    background: #f9fafb;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 交易历史样式 */
.no-transactions {
    text-align: center;
    color: #6b7280;
    padding: 20px;
    font-size: 14px;
}

.transaction-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s ease;
}

.transaction-item:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
}

.transaction-icon i {
    color: white;
    font-size: 16px;
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-details {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 14px;
    line-height: 1.4;
    margin-bottom: 2px;
}

.transaction-time {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.2;
}

.transaction-status {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.transaction-status i {
    font-size: 12px;
}

.status-success {
    background-color: #d1fae5;
    color: #059669;
}

.status-failed {
    background-color: #fee2e2;
    color: #dc2626;
}

.status-pending {
    background-color: #fef3c7;
    color: #d97706;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .swap-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .swap-card {
        max-width: 100%;
    }
    
    .swap-input-section {
        padding: 16px;
    }
    
    .swap-input-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
    }
    
    .amount-input {
        font-size: 24px;
        width: 100%;
    }
    
    .token-section {
        min-width: 120px;
        padding: 10px 14px;
    }
    
    .token-icon {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }
    
    .token-symbol {
        font-size: 14px;
    }
    
    .token-name {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .swap-input-section {
        padding: 12px;
    }
    
    .swap-input-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 8px;
    }
    
    .amount-input {
        font-size: 20px;
        width: 100%;
    }
    
    .token-section {
        min-width: 100px;
        padding: 8px 12px;
    }
    
    .token-icon {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    
    .token-symbol {
        font-size: 13px;
    }
    
    .token-name {
        font-size: 10px;
    }
}

/* 价格信息样式 */
.swap-details {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

/* 交易按钮样式 */
.swap-btn-full {
    width: 100%;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 12px;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.swap-btn-full:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.3);
}

.swap-btn-full:active {
    transform: translateY(0);
}

/* 交易历史样式 */
.transaction-list {
    padding: 0;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:hover {
    background: #f9fafb;
    border-radius: 8px;
    padding: 12px 8px;
    margin: 0 -8px;
}

.transaction-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 14px;
    flex-shrink: 0;
}

.transaction-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.transaction-details {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 500;
}

.transaction-time {
    font-size: 12px;
    color: #9ca3af;
}

.transaction-status {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    flex-shrink: 0;
}

.status-success {
    background: #dcfce7;
    color: #16a34a;
}

.status-pending {
    background: #fef3c7;
    color: #d97706;
}

.status-failed {
    background: #fee2e2;
    color: #dc2626;
}

/* 交换行样式 */
.swap-row {
    margin-bottom: 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.swap-row:hover {
    border-color: #d1d5db;
}

.swap-row-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
    background: #f9fafb;
    border-radius: 12px 12px 0 0;
}

.swap-label {
    font-weight: 500;
    color: #6b7280;
    font-size: 14px;
}

.network-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.network-icon {
    width: 16px;
    height: 16px;
    background: #fbbf24;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    color: white;
}

.network-name {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.balance-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.balance-amount {
    font-weight: 500;
}

.max-btn {
    background: none;
    border: none;
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.max-btn:hover {
    background: #f3f4f6;
}

.swap-row-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.token-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.token-selector:hover {
    border-color: #d1d5db;
    background: #f9fafb;
}

.amount-input-wrapper {
    flex: 1;
    position: relative;
}

.amount-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    background: #ffffff;
    transition: all 0.3s ease;
    color: #1a1a1a;
    text-align: right;
}

.amount-input:focus {
    outline: none;
    border-color: #1a1a1a;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.1);
}

/* 交换箭头 */
.swap-arrow {
    display: flex;
    justify-content: center;
    margin: 8px 0;
    position: relative;
    z-index: 10;
}

.swap-btn-full {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    background: #1a1a1a;
    color: white;
    border: 1px solid #1a1a1a;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.swap-btn-full:hover {
    background: #374151;
    border-color: #374151;
}

/* 交易历史 */
.recent-transactions {
    max-height: 300px;
    overflow-y: auto;
}

.transaction-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-info {
    flex: 1;
}

.transaction-type {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.transaction-details {
    color: #666;
    font-size: 14px;
    margin-bottom: 4px;
}

.transaction-time {
    color: #999;
    font-size: 12px;
}

.transaction-status {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .swap-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .token-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .amount-input-wrapper {
        width: 100%;
    }
    
    .max-btn {
        position: static;
        transform: none;
        /* margin-top: 8px; */
        align-self: flex-end;
    }
}
