* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

/* 输入控件上始终允许选择、粘贴、中文输入法合成 */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* 原生容器中隐藏 Web 导航与备案号 */
html.native-host .bottom-nav,
html.native-host .icp-footer { display: none !important; }

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.main-content {
    flex: 1;
    overflow: auto;
    background: #fff;
    padding-bottom: env(safe-area-inset-bottom);
}

/* 底部导航栏 */
.bottom-nav {
    display: flex;
    background: #fff;
    border-top: 1px solid #e5e5e5;
    padding: 6px 0;
    padding-bottom: calc(6px + env(safe-area-inset-bottom));
    position: fixed;
    z-index: 100;
    bottom: 16px; /* 预留备案号高度 */
    width: 100%;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.nav-item:hover {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.nav-item.active {
    color: #1890ff;
}

.nav-icon {
    font-size: 14px;
    margin-bottom: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.nav-label {
    font-size: 8px;
    font-weight: 500;
    color: #666;
    transition: color 0.2s ease;
}

.nav-item.active .nav-label {
    color: #1890ff;
}

/* ICP备案号 */
.icp-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 7px;
    color: #999;
    padding: 4px 0 calc(4px + env(safe-area-inset-bottom));
    background: #fff;
    pointer-events: auto;
    z-index: 90;
}
.icp-footer a {
    color: inherit;
    text-decoration: none;
}
.icp-footer a:hover {
    text-decoration: underline;
}

/* 内容页面样式 */
.tab-content {
    min-height: 100%;
    display: none;
}

.tab-content.active {
    display: block;
}

/* AI聊天页面暂时空白样式 */
.ai-chat-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    color: #999;
    text-align: center;
    padding: 40px 20px;
}

.ai-chat-placeholder .icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.ai-chat-placeholder .title {
    font-size: 18px;
    margin-bottom: 8px;
    color: #666;
}

.ai-chat-placeholder .subtitle {
    font-size: 14px;
    color: #999;
}

/* 个人资料页面样式 */
.profile-container {
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.profile-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px 20px;
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.profile-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.profile-phone {
    font-size: 14px;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.profile-menu {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s ease;
}

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

.menu-item:hover {
    background: #f8f9fa;
}

.menu-item.danger:hover {
    background: #fef2f2;
    color: #ef4444;
}

.menu-icon {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-text {
    flex: 1;
    font-size: 16px;
    color: #333;
}

.menu-arrow {
    color: #ccc;
    font-size: 14px;
}

.menu-item.danger .menu-text {
    color: #ef4444;
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .profile-container {
        padding: 16px;
    }
    
    .profile-header {
        padding: 24px 16px 16px;
    }
    
    .profile-name {
        font-size: 20px;
    }
}

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

/* 过渡动画 */
.main-content {
    transition: opacity 0.3s ease;
}

.tab-switching {
    opacity: 0.7;
} 
