/* ============================================
   H5 移动端基础样式系统
   ============================================ */

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* 主色调 */
    --primary-color: #1677ff;
    --primary-hover: #4096ff;
    --primary-half-active: #0958d978;
    --primary-active: #0958d9;
    
    /* 功能色 */
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --info-color: #13c2c2;
    
    /* 中性色 */
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --text-disabled: #cccccc;
    
    /* 背景色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f7fa;
    --bg-tertiary: #f0f0f0;
    
    /* 边框色 */
    --border-color: #e8e8e8;
    --border-light: #f0f0f0;
    
    /* 阴影 */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    
    /* 字体 */
    --font-size-xs: 11px;
    --font-size-sm: 12px;
    --font-size-md: 14px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --font-size-4xl: 28px;
    
    /* 行高 */
    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* 过渡 */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    background-color: var(--bg-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* 通用组件样式 */
.navbar {
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95) !important;
}

/* 底部导航样式 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 max(8px, env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    border-top: 1px solid var(--border-light);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
    position: relative;
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    transition: color var(--transition-fast);
    min-height: 44px;
}

.nav-item:hover,
.nav-item:focus,
.nav-item:active {
    color: var(--text-secondary);
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: scale(1.1);
}

.nav-item i {
    font-size: 22px;
    margin-bottom: 2px;
    transition: transform var(--transition-fast);
}

.trade-button {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-half-active) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -28px;
    margin-bottom: -4px;
    color: white;
    box-shadow: 0 4px 16px rgba(22, 119, 255, 0.4);
    transition: all var(--transition-base);
    font-size: var(--font-size-sm);
    font-weight: 500;
}

.trade-button:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(22, 119, 255, 0.3);
}

.trade-button i {
    margin: 0;
    color: white;
}

#app {
    padding-bottom: calc(60px + env(safe-area-inset-bottom));
    min-height: 100vh;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-img {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

.logo-text {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

/* 通用工具类 */
.container {
    padding-left: var(--spacing-lg);
    padding-right: var(--spacing-lg);
}

/* 触摸友好的按钮 */
button, .btn, a[role="button"] {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
}

/* 平滑滚动 */
html {
    scroll-behavior: smooth;
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    #app {
        padding-bottom: calc(60px + max(0px, env(safe-area-inset-bottom)));
    }
} 