/* 组件样式 */

/* 卡片组件 */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #d1d5db;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
}

/* 输入框组件 */
.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #6b7280;
}

.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    padding: 16px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #1a1a1a;
}

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

.input-field::placeholder {
    color: #999;
}

/* 代币选择器 */
.token-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

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

.token-info {
    flex: 1;
}

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

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

.token-balance {
    font-size: 12px;
    color: #9ca3af;
}

/* 交换箭头 */
.swap-arrow {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.swap-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1a1a1a;
    border: 2px solid #ffffff;
    color: white;
    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: 12px;
}

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

/* 价格信息 */
.price-info {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    border: 1px solid #e5e7eb;
}

.price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.price-row:last-child {
    margin-bottom: 0;
}

.price-label {
    color: #6b7280;
    font-size: 14px;
}

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

/* 按钮组 */
.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-group .btn {
    flex: 1;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.status-error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

/* 加载动画 */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f0f0f0;
    color: #333;
}

/* 代币列表 */
.token-list {
    max-height: 400px;
    overflow-y: auto;
}

.token-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.token-item:hover {
    background: #f8f9fa;
    border-color: #e0e0e0;
}

.token-item.selected {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.table tr:hover {
    background: #f8f9fa;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.tag-primary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.tag-success {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.tag-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

/* 工具提示 */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 响应式表格 */
@media (max-width: 768px) {
    .table {
        font-size: 14px;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .modal {
        padding: 20px;
        margin: 20px;
    }
}
