/**
 * AI智能交易机器人 - 科技主题样式
 * 深色蓝色背景 + 高级科技感
 */

/* ===== 主题变量 ===== */
:root {
    /* 主色调 - 科技蓝 */
    --ai-primary: #2563EB;
    --ai-primary-light: #60a5fa;
    --ai-primary-dark: #1e40af;
    --ai-primary-darker: #1e3a8a;
    
    /* 辅助色 - 青色 */
    --ai-cyan: #06b6d4;
    --ai-cyan-light: #22d3ee;
    
    /* 警告色 - 金色 */
    --ai-warning: #f59e0b;
    
    /* 渐变色 - 全部基于蓝色系 */
    --ai-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #06b6d4 100%);
    --ai-gradient-blue: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #0ea5e9 100%);
    --ai-gradient-dark: linear-gradient(180deg, #020617 0%, #0f172a 50%, #1e293b 100%);
    --ai-gradient-card: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
    --ai-gradient-glow: linear-gradient(135deg, rgba(37, 99, 235, 0.4) 0%, rgba(6, 182, 212, 0.2) 100%);
    
    /* 深色背景 - 更深的蓝黑色 */
    --ai-bg-dark: #020617;
    --ai-bg-darker: #010409;
    --ai-bg-card: rgba(15, 23, 42, 0.8);
    --ai-bg-card-solid: #0f172a;
    --ai-bg-card-hover: #1e293b;
    
    /* 边框和分割线 - 蓝色系 */
    --ai-border: rgba(59, 130, 246, 0.2);
    --ai-border-light: rgba(59, 130, 246, 0.1);
    --ai-border-glow: rgba(59, 130, 246, 0.4);
    
    /* 文字颜色 */
    --ai-text-primary: #f1f5f9;
    --ai-text-secondary: rgba(241, 245, 249, 0.8);
    --ai-text-muted: rgba(148, 163, 184, 0.8);
    
    /* 涨跌颜色 */
    --ai-up: #10b981;
    --ai-down: #ef4444;
    
    /* 发光效果 - 增强 */
    --ai-glow: 0 0 20px rgba(37, 99, 235, 0.4), 0 0 40px rgba(6, 182, 212, 0.2);
    --ai-glow-strong: 0 0 30px rgba(37, 99, 235, 0.6), 0 0 60px rgba(6, 182, 212, 0.3);
    --ai-glow-text: 0 0 10px rgba(96, 165, 250, 0.5);
}

/* ===== 基础样式覆盖 ===== */
/* 全局背景色 - 防止留白 */
html, body {
    background: #0f172a !important;
}

.ai-theme {
    background: var(--ai-bg-dark);
    min-height: 100vh;
    color: var(--ai-text-primary);
    position: relative;
}

/* 固定导航栏 - 只在 ai-theme 主题下生效 */
.ai-theme .van-nav-bar,
.ai-theme > .van-nav-bar,
.ai-theme > .van-nav-bar:first-child,
#app.ai-theme .van-nav-bar,
#app.ai-theme > .van-nav-bar:first-child {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.2) !important;
}

/* 有导航栏的页面容器需要顶部补白 */
.ai-theme.has-navbar {
    padding-top: 46px;
}

/* 背景科技线条动画 */
.ai-theme::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(90deg, transparent 0%, transparent 49%, rgba(59, 130, 246, 0.03) 50%, transparent 51%, transparent 100%),
        linear-gradient(0deg, transparent 0%, transparent 49%, rgba(59, 130, 246, 0.03) 50%, transparent 51%, transparent 100%);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 0;
}

/* 右上角光晕 */
.ai-theme::after {
    content: '';
    position: fixed;
    top: -200px;
    right: -200px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.ai-theme > * {
    position: relative;
    z-index: 1;
}

.ai-theme body {
    background: var(--ai-bg-dark);
    color: var(--ai-text-primary);
}

/* ===== 顶部区域 ===== */
.ai-header {
    background: var(--ai-gradient-dark);
    padding: 15px;
    position: relative;
    overflow: hidden;
}

.ai-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 50%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* AI状态指示器 */
.ai-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(37, 99, 235, 0.2);
    border-radius: 20px;
    border: 1px solid rgba(37, 99, 235, 0.3);
    font-size: 14px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ai-up);
    animation: blink 1.5s ease-in-out infinite;
}

.ai-status-dot.offline {
    background: var(--ai-text-muted);
    animation: none;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* ===== 资产卡片 ===== */
.ai-asset-card {
    background: var(--ai-gradient-blue);
    border-radius: 16px;
    padding: 20px;
    margin: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--ai-glow);
    border: 1px solid var(--ai-border-glow);
}

/* 科技圆环装饰 */
.ai-asset-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    animation: rotate-slow 20s linear infinite;
}

.ai-asset-card::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 160px;
    height: 160px;
    border: 1px dashed rgba(255,255,255,0.15);
    border-radius: 50%;
    animation: rotate-slow 15s linear infinite reverse;
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ai-asset-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.ai-asset-value {
    font-size: 36px;
    font-weight: bold;
    font-family: 'DIN Alternate', 'Helvetica Neue', monospace;
    letter-spacing: 1px;
}

.ai-asset-value::before {
    content: '$ ';
    font-size: 20px;
    font-weight: normal;
}

.ai-asset-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.ai-asset-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 14px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-decoration: none;
    transition: all 0.3s;
}

.ai-asset-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== 交易流水区域 ===== */
.ai-section {
    margin: 15px;
}

.ai-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.ai-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--ai-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-section-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--ai-gradient-blue);
    border-radius: 2px;
}

.ai-section-more {
    font-size: 13px;
    color: var(--ai-text-muted);
}

/* 交易流水滚动容器 */
.ai-trade-stream {
    background: var(--ai-bg-card);
    border-radius: 12px;
    padding: 12px;
    max-height: 200px;
    overflow: hidden;
    position: relative;
}

.ai-trade-stream::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(transparent, var(--ai-bg-card));
    pointer-events: none;
}

.ai-trade-list {
    animation: scroll-up 15s linear infinite;
}

.ai-trade-stream:hover .ai-trade-list {
    animation-play-state: paused;
}

@keyframes scroll-up {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50%); }
}

.ai-trade-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--ai-border-light);
}

.ai-trade-item:last-child {
    border-bottom: none;
}

.ai-trade-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ai-gradient-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    margin-right: 12px;
}

.ai-trade-info {
    flex: 1;
}

.ai-trade-user {
    font-size: 14px;
    color: var(--ai-text-primary);
}

.ai-trade-time {
    font-size: 12px;
    color: var(--ai-text-muted);
    margin-top: 2px;
}

.ai-trade-profit {
    font-size: 16px;
    font-weight: 600;
    font-family: 'DIN Alternate', monospace;
}

.ai-trade-profit.up {
    color: var(--ai-up);
}

.ai-trade-profit.up::before {
    content: '+$';
}

/* ===== 行情列表 ===== */
.ai-market-card {
    background: var(--ai-bg-card);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    transition: background 0.3s;
}

.ai-market-card:active {
    background: var(--ai-bg-card-hover);
}

.ai-market-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    background: var(--ai-bg-card-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-market-icon img {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.ai-market-info {
    flex: 1;
}

.ai-market-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--ai-text-primary);
}

.ai-market-symbol {
    font-size: 12px;
    color: var(--ai-text-muted);
    margin-top: 2px;
}

.ai-market-price {
    text-align: right;
}

.ai-market-value {
    font-size: 16px;
    font-weight: 600;
    font-family: 'DIN Alternate', monospace;
    color: var(--ai-text-primary);
}

.ai-market-change {
    font-size: 13px;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.ai-market-change.up {
    color: var(--ai-up);
    background: rgba(34, 197, 94, 0.15);
}

.ai-market-change.down {
    color: var(--ai-down);
    background: rgba(239, 68, 68, 0.15);
}

/* ===== 客服浮标 ===== */
.ai-service-float {
    position: fixed;
    right: 15px;
    bottom: 80px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--ai-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--ai-glow-strong);
    z-index: 999;
    animation: float 3s ease-in-out infinite;
}

.ai-service-float i {
    font-size: 24px;
    color: #fff;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* ===== 底部导航 ===== */
.ai-tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--ai-bg-card);
    display: flex;
    padding: 8px 0;
    padding-bottom: calc(8px + constant(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--ai-border);
    z-index: 100;
}

.ai-tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 0;
    color: var(--ai-text-muted);
    text-decoration: none;
    transition: color 0.3s;
}

.ai-tabbar-item.active {
    color: var(--ai-primary-light);
}

.ai-tabbar-item i {
    font-size: 22px;
    margin-bottom: 4px;
}

.ai-tabbar-item span {
    font-size: 11px;
}

/* ===== 卡片样式 ===== */
.ai-card {
    background: var(--ai-bg-card);
    border-radius: 12px;
    padding: 15px;
    margin: 15px;
}

.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ai-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--ai-text-primary);
}

/* ===== 按钮 ===== */
.ai-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.ai-btn-primary {
    background: var(--ai-gradient);
    color: #fff;
    box-shadow: var(--ai-glow);
}

.ai-btn-primary:active {
    transform: scale(0.98);
}

.ai-btn-outline {
    background: transparent;
    color: var(--ai-primary-light);
    border: 1px solid var(--ai-primary-light);
}

.ai-btn-block {
    width: 100%;
}

/* ===== 列表 ===== */
.ai-list {
    background: var(--ai-bg-card);
    border-radius: 12px;
    overflow: hidden;
}

.ai-list-item {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid var(--ai-border-light);
}

.ai-list-item:last-child {
    border-bottom: none;
}

.ai-list-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    color: var(--ai-primary-light);
    font-size: 18px;
}

.ai-list-content {
    flex: 1;
}

.ai-list-title {
    font-size: 15px;
    color: var(--ai-text-primary);
}

.ai-list-desc {
    font-size: 12px;
    color: var(--ai-text-muted);
    margin-top: 4px;
}

.ai-list-arrow {
    color: var(--ai-text-muted);
}

/* ===== 数据统计 ===== */
.ai-stats {
    display: flex;
    justify-content: space-around;
    padding: 15px 0;
}

.ai-stat-item {
    text-align: center;
}

.ai-stat-value {
    font-size: 22px;
    font-weight: bold;
    font-family: 'DIN Alternate', monospace;
    color: var(--ai-text-primary);
}

.ai-stat-label {
    font-size: 12px;
    color: var(--ai-text-muted);
    margin-top: 4px;
}

/* ===== 空状态 ===== */
.ai-empty {
    text-align: center;
    padding: 60px 20px;
}

.ai-empty-icon {
    font-size: 60px;
    color: var(--ai-text-muted);
    margin-bottom: 15px;
}

.ai-empty-text {
    font-size: 14px;
    color: var(--ai-text-muted);
}

/* ===== 加载动画 ===== */
.ai-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

.ai-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--ai-border);
    border-top-color: var(--ai-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 科技感装饰 ===== */
.ai-tech-bg {
    position: relative;
}

.ai-tech-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 0%, rgba(37, 99, 235, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(6, 182, 212, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 0% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
    pointer-events: none;
    z-index: 0;
}

/* 网格背景 */
.ai-grid-bg {
    background-image: 
        linear-gradient(rgba(59, 130, 246, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ===== 额外科技效果 ===== */

/* 发光文字 */
.ai-glow-text {
    text-shadow: var(--ai-glow-text);
}

/* 发光边框卡片 */
.ai-glow-card {
    border: 1px solid var(--ai-border-glow);
    box-shadow: 
        inset 0 0 20px rgba(59, 130, 246, 0.05),
        0 0 20px rgba(37, 99, 235, 0.2);
}

/* 数据流动线条动画 */
.ai-data-flow {
    position: relative;
    overflow: hidden;
}

.ai-data-flow::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--ai-cyan), transparent);
    animation: data-flow 3s linear infinite;
}

@keyframes data-flow {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* 脉冲点 */
.ai-pulse-dot {
    width: 8px;
    height: 8px;
    background: var(--ai-cyan);
    border-radius: 50%;
    position: relative;
}

.ai-pulse-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: var(--ai-cyan);
    border-radius: 50%;
    animation: pulse-ring 1.5s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

/* 渐变边框 */
.ai-gradient-border {
    position: relative;
    background: var(--ai-bg-card-solid);
    border-radius: 12px;
}

.ai-gradient-border::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(135deg, var(--ai-primary) 0%, var(--ai-cyan) 50%, var(--ai-primary) 100%);
    border-radius: 13px;
    z-index: -1;
    opacity: 0.5;
}

/* 扫光效果 */
.ai-scan-line {
    position: relative;
    overflow: hidden;
}

.ai-scan-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--ai-cyan-light), transparent);
    animation: scan 4s linear infinite;
}

@keyframes scan {
    0% { top: 0; opacity: 1; }
    50% { opacity: 0.5; }
    100% { top: 100%; opacity: 0; }
}

/* 悬浮发光效果 */
.ai-hover-glow {
    transition: all 0.3s ease;
}

.ai-hover-glow:hover {
    box-shadow: var(--ai-glow-strong);
    border-color: var(--ai-border-glow);
}

/* 数字跳动效果 */
.ai-number {
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

/* 状态指示器 - 在线 */
.ai-status-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    font-size: 12px;
    color: var(--ai-up);
}

.ai-status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--ai-up);
    border-radius: 50%;
    animation: blink 1.5s ease-in-out infinite;
}

/* 粒子背景 */
.ai-particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image: 
        radial-gradient(1px 1px at 20px 30px, rgba(59, 130, 246, 0.4), transparent),
        radial-gradient(1px 1px at 40px 70px, rgba(6, 182, 212, 0.3), transparent),
        radial-gradient(1px 1px at 50px 160px, rgba(59, 130, 246, 0.3), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(96, 165, 250, 0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(6, 182, 212, 0.3), transparent),
        radial-gradient(1px 1px at 160px 120px, rgba(59, 130, 246, 0.4), transparent);
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: particles-float 60s linear infinite;
}

@keyframes particles-float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-200px); }
}
