/**
 * AI Trade - 主样式文件
 * 实现现代化玻璃拟态设计
 */

/* ========== 全局样式 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 浅色模式颜色 */
    --color-primary: #667eea;
    --color-secondary: #764ba2;
    --color-success: #48bb78;
    --color-warning: #ed8936;
    --color-error: #f56565;
    --color-text: #2d3748;
    --color-text-light: #718096;
    --color-bg: #f7fafc;
    --color-bg-gradient-start: #ffffff;
    --color-bg-gradient-end: #e6f0ff;
    
    /* 字体 */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* 深色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --color-text: #e2e8f0;
        --color-text-light: #a0aec0;
        --color-bg: #1a202c;
        --color-bg-gradient-start: #1e2538;
        --color-bg-gradient-end: #0f1419;
    }
}

body {
    font-family: var(--font-sans);
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========== 背景渐变和动画形状 ========== */
.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        var(--color-bg-gradient-start) 0%, 
        var(--color-bg-gradient-end) 100%);
    z-index: -2;
}

.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.shape-2 {
    width: 350px;
    height: 350px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    bottom: -150px;
    left: -150px;
    animation-delay: 5s;
}

.shape-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -30px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

/* ========== 导航栏 ========== */
.navbar {
    position: sticky;
    top: var(--spacing-md);
    margin: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 12px;
    color: var(--color-text-light);
    font-weight: 500;
}

.nav-actions {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

/* 语言选择器 */
.language-selector {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 8px 16px;
    border: none;
    cursor: pointer;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 150px;
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.language-selector:hover .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-option {
    display: block;
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    background: transparent;
    color: var(--color-text);
    text-align: left;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.lang-option:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* ========== 主内容区域 ========== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-md);
}

.page-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.page-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 登录页面 ========== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.login-card {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-2xl);
    border-radius: var(--radius-xl);
}

.card-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.icon-container {
    display: inline-block;
    margin-bottom: var(--spacing-lg);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.card-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.card-subtitle {
    font-size: 14px;
    color: var(--color-text-light);
}

.card-body {
    margin-bottom: var(--spacing-lg);
}

/* 钱包信息 */
.wallet-info {
    padding: var(--spacing-lg);
    border-radius: var(--radius-md);
    background: rgba(102, 126, 234, 0.05);
    margin-bottom: var(--spacing-lg);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

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

.info-label {
    font-size: 14px;
    color: var(--color-text-light);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    font-family: 'Monaco', monospace;
}

.status-connected {
    color: var(--color-success);
}

/* 按钮样式 */
.connect-button,
.sign-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.connect-button {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: var(--color-text);
}

.connect-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.sign-button {
    background: linear-gradient(135deg, #6a5af9 0%, #d66efd 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(106, 90, 249, 0.3);
}

.sign-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(106, 90, 249, 0.4);
}

.button-icon {
    font-size: 20px;
}

.button-text {
    flex: 1;
    text-align: center;
}

/* 分隔线 */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: var(--spacing-xl) 0;
    color: var(--color-text-light);
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.divider span {
    padding: 0 var(--spacing-md);
}

/* 功能预览 */
.features-preview {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: translateX(4px);
}

.feature-icon {
    font-size: 24px;
}

.feature-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.card-footer {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.footer-text {
    font-size: 12px;
    color: var(--color-text-light);
}

/* ========== 用户配置页面 ========== */
.dashboard-container {
    max-width: 1000px;
    margin: 0 auto;
}

.welcome-section {
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.welcome-subtitle {
    font-size: 14px;
    color: var(--color-text-light);
    font-family: 'Monaco', monospace;
}

.logout-button {
    padding: 10px 20px;
}

/* 功能卡片网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.feature-card {
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
}

.feature-header {
    margin-bottom: var(--spacing-lg);
}

.feature-icon-large {
    font-size: 48px;
    display: block;
    margin-bottom: var(--spacing-md);
}

.feature-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
}

.feature-description {
    flex: 1;
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-lg);
}

.feature-button {
    width: 100%;
    padding: 12px;
    border: none;
}

/* ========== 通知组件 ========== */
.notification-container {
    position: fixed;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.notification {
    min-width: 300px;
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: rgba(72, 187, 120, 0.9);
    color: white;
}

.notification.error {
    background: rgba(245, 101, 101, 0.9);
    color: white;
}

.notification.info {
    background: rgba(102, 126, 234, 0.9);
    color: white;
}

/* ========== 加载指示器 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-md);
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--color-text);
    font-size: 14px;
}

/* ========== 响应式设计 ========== */
@media (max-width: 768px) {
    .navbar {
        margin: var(--spacing-sm);
        padding: var(--spacing-sm) var(--spacing-md);
    }
    
    .nav-brand {
        flex-direction: column;
        gap: 0;
    }
    
    .logo-text {
        font-size: 20px;
    }
    
    .main-content {
        padding: var(--spacing-lg) var(--spacing-sm);
    }
    
    .login-card {
        padding: var(--spacing-lg);
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .welcome-section {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
}

