/* 通用样式 - 移动端优先 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    /* 隐藏滚动条 - 移动端APP风格 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 隐藏滚动条 - Webkit浏览器 (Chrome, Safari) */
*::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

:root {
    --primary-color: #4B7BFF;
    --secondary-color: #FF6B6B;
    --accent-color: #FFA502;
    --text-primary: #333;
    --text-secondary: #666;
    --text-light: #999;
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --border-color: #e5e5e5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 6px 20px rgba(0, 0, 0, 0.15);
    --gradient-blue: linear-gradient(135deg, #64B5F6 0%, #FFFFFF 100%);
    --gradient-orange: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

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

body {
    padding-bottom: 60px; /* 为底部导航栏留出空间 */
    opacity: 1;
    /* 移除过渡以提升切换速度 */
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    outline: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
}

/* 头部导航栏 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(135deg, #4B7BFF 0%, #3867D6 100%);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    /* 优化固定定位元素的渲染 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

/* 滚动后的头部样式 */
.header.scrolled {
    background: white !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
}

.header.scrolled .logo-text,
.header.scrolled .logo-text .brand-name,
.header.scrolled .logo-text .brand-slogan {
    color: #333 !important;
}

.header.scrolled .brand-slogan {
    opacity: 0.7;
}

.header.scrolled .icon-btn svg,
.header.scrolled .icon-btn svg path,
.header.scrolled .icon-btn svg circle {
    stroke: #333 !important;
}

.header.scrolled .icon-btn:active {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.header.scrolled .notification-badge {
    border-color: white !important;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 16px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #FFA502, #FF6B00);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
}

.logo-image-header {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 12px;
    /* 图片清晰度优化 */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.logo-text {
    display: flex;
    flex-direction: column;
    color: white;
    /* 优化字体渲染，防止模糊 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.brand-name {
    font-size: 16px;
    font-weight: 600;
    /* 字体清晰度优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    letter-spacing: 0.3px;
    /* 防止transform导致的模糊 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.brand-slogan {
    font-size: 11px;
    opacity: 0.9;
    /* 优化小字体渲染 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.header-actions {
    display: flex;
    gap: 12px;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.icon-btn:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.notification-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background-color: #FF4757;
    border-radius: 50%;
    border: 2px solid #4B7BFF;
}

/* 简单头部 */
.header-simple {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    padding: 12px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    /* 优化固定定位元素的渲染 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    will-change: transform;
}

.page-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    /* 字体清晰度优化 - 防止模糊 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    letter-spacing: 0.3px;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f5f5f5;
    border-radius: 20px;
    padding: 8px 16px;
    gap: 8px;
}

.search-icon {
    flex-shrink: 0;
    font-size: 18px;
}

.search-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 14px;
}

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

/* 主要内容区域 */
.main-content {
    padding-top: 56px;
    min-height: calc(100vh - 60px);
}

.header-simple ~ .main-content {
    padding-top: 64px;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: white;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--text-light);
    transition: all 0.1s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    user-select: none;
}

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

.nav-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
}

.nav-label {
    font-size: 11px;
}

.nav-item:active {
    background-color: rgba(0, 0, 0, 0.02);
}

/* 响应式设计 - 限制最大宽度 */
@media (min-width: 768px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    }
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* 通用卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

/* 通用按钮样式 */
.btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.1s;
}

.btn-primary {
    background: var(--gradient-blue);
    color: white;
}

.btn-primary:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(75, 123, 255, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

