/* 专业交易中心样式 */

.trading-main {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 2rem 0;
}

.trading-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 交易类型切换 */
.trading-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    background: white;
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #6b7280;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

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

.tab-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.tab-btn i {
    font-size: 1.1rem;
}

/* 交易标题 */
.trading-header {
    margin-bottom: 2rem;
    text-align: center;
}

.trading-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0;
}

.trading-header h1 i {
    font-size: 2rem;
    color: #3b82f6;
}

/* 筛选和搜索区域 */
.trading-filters {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.filter-select,
.filter-input {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    background: white;
    color: #374151;
    transition: all 0.3s ease;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

.clear-btn {
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
}

.clear-btn:hover {
    background: #e5e7eb;
    color: #374151;
    transform: translateY(-1px);
}

/* 按钮组横向排列 */
.filter-group:has(.search-btn) {
    display: flex !important;
    flex-direction: row !important;
    gap: 0.5rem;
    align-items: center;
}

.auto-refresh {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.refresh-select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: white;
    font-size: 0.85rem;
    color: #374151;
}

/* 交易订单列表 */
.trading-orders {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.orders-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.orders-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
}

.orders-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.9rem;
}

.no-fee {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.orders-table {
    overflow-x: auto;
}

.orders-table table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    background: #f8fafc;
    color: #374151;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}

.orders-table td {
    padding: 1.5rem;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
}

.orders-table tbody tr:hover {
    background: #f8fafc;
}

/* 用户信息 */
.trader-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.trader-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
}

.trader-avatar.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.trader-avatar.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.trader-avatar.yellow {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.trader-avatar.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.trader-avatar.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.trader-details h4 {
    margin: 0 0 0.25rem 0;
    color: #1f2937;
    font-size: 1rem;
    font-weight: 600;
}

.trader-stats {
    display: flex;
    gap: 0.5rem;
}

.trader-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.8rem;
}

.trader-stat i {
    font-size: 0.7rem;
}

/* 价格信息 */
.price-info {
    text-align: center;
}

.price-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
}

.price-change {
    font-size: 0.8rem;
    color: #10b981;
    font-weight: 500;
}

/* 限额信息 */
.limit-info {
    text-align: center;
}

.limit-range {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.limit-cny {
    font-size: 0.9rem;
    color: #6b7280;
}

/* 支付方式 */
.payment-method {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.payment-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
}

.payment-icon.alipay {
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 100%);
}

.payment-icon.wechat {
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
}

.payment-icon.bank {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.payment-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
}

/* 操作按钮 */
.trade-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-width: 100px;
}

.trade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

.trade-btn.sell {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.trade-btn.sell:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.page-btn {
    padding: 0.75rem 1.5rem;
    background: #f3f4f6;
    color: #374151;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn:hover:not(:disabled) {
    background: #e5e7eb;
    color: #1f2937;
}

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

.page-info {
    color: #6b7280;
    font-size: 0.9rem;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 2% auto;
    border-radius: 16px;
    width: 95%;
    max-width: 600px;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 120px);
}

.trade-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

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

.detail-item label {
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.detail-item span {
    color: #1f2937;
    font-size: 0.9rem;
    font-weight: 600;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline {
    background: transparent;
    color: #6b7280;
    border: 2px solid #e5e7eb;
}

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

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .trading-filters {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .trading-header h1 {
        font-size: 2rem;
    }
    
    .orders-table {
        font-size: 0.85rem;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 0.75rem;
    }
    
    .trader-info {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .trader-stats {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .trading-container {
        padding: 0 0.5rem;
    }
    
    .trading-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
    }
    
    .trading-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .orders-table th,
    .orders-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .trade-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* 加载状态样式 */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 错误状态样式 */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message i {
    font-size: 1.2rem;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
    margin: 0;
}

/* 价格变化指示器 */
.price-change {
    font-size: 0.85rem;
    font-weight: 500;
}

.price-change.positive {
    color: #10b981;
}

.price-change.negative {
    color: #ef4444;
}

.price-change.neutral {
    color: #6b7280;
}

/* 交易者等级标识 */
.trader-level {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.trader-level.vip {
    background: #fef3c7;
    color: #d97706;
}

.trader-level.premium {
    background: #dbeafe;
    color: #2563eb;
}

.trader-level.normal {
    background: #f3f4f6;
    color: #6b7280;
}

/* 支付方式图标样式 */
.payment-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 0.5rem;
}

.payment-icon.alipay {
    background: #1677ff;
    color: white;
}

.payment-icon.wechat {
    background: #07c160;
    color: white;
}

.payment-icon.bank {
    background: #6b7280;
    color: white;
}

.payment-icon.cash {
    background: #10b981;
    color: white;
}

/* 数量输入组样式 */
.amount-input-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.amount-input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: white;
}

.amount-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.amount-unit {
    color: #6b7280;
    font-weight: 500;
    font-size: 0.9rem;
}

.amount-range {
    color: #6b7280;
    font-size: 0.85rem;
}

.amount-range small {
    color: #9ca3af;
}

/* 交易提示信息样式 */
.trade-tips {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.75rem 0;
}

.tip-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    color: #6b7280;
}

.tip-item:last-child {
    margin-bottom: 0;
}

.tip-item i {
    color: #3b82f6;
    font-size: 0.85rem;
}

.tip-item span {
    font-weight: 500;
}

/* 数量验证错误样式 */
.amount-input.error {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.amount-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: none;
}

.amount-error.show {
    display: block;
}

/* 移动端模态框优化 */
@media (max-width: 768px) {
    .modal-content {
        width: 98%;
        margin: 1% auto;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 1rem;
        max-height: calc(95vh - 100px);
    }
    
    .trade-details {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .detail-item {
        padding: 0.5rem;
    }
    
    .trade-tips {
        padding: 0.5rem;
        margin: 0.5rem 0;
    }
    
    .tip-item {
        font-size: 0.75rem;
        margin-bottom: 0.25rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-actions .btn {
        width: 100%;
        padding: 0.75rem;
    }
}





/* 实名认证相关样式 */
.kyc-warning {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 12px;
    margin: 1rem 0;
}

.warning-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: #f59e0b;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.warning-content h4 {
    margin: 0 0 0.5rem 0;
    color: #92400e;
    font-size: 1.1rem;
    font-weight: 600;
}

.warning-content p {
    margin: 0.25rem 0;
    color: #92400e;
    line-height: 1.5;
}

.kyc-warning-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.1);
}

.kyc-warning-banner .warning-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #92400e;
}

.kyc-warning-banner .warning-content i {
    font-size: 1.2rem;
    color: #f59e0b;
}

.kyc-warning-banner .warning-content span {
    flex: 1;
    font-weight: 500;
}

.kyc-warning-banner .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* 禁用状态的交易按钮 */
.buy-btn:disabled,
.sell-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* 实名认证模态框样式 */
#kycRequiredModal .modal-content {
    max-width: 500px;
}

#kycRequiredModal .modal-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

#kycRequiredModal .modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

#kycRequiredModal .modal-body {
    padding: 2rem;
}

#kycRequiredModal .modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .kyc-warning {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .kyc-warning-banner .warning-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    #kycRequiredModal .modal-footer {
        flex-direction: column;
    }
}
