/* AI 分析页面样式 */
/* 强制移动端识别 */
@-ms-viewport {
    width: device-width;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --success-color: #ef4444;
    --danger-color: #10b981;
    --warning-color: #f59e0b;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --border-color: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    /* 安全区域 */
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-height: 100vh;
    min-height: -webkit-fill-available;
}

/* 背景动画 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
}

.bg-animation canvas {
    width: 100%;
    height: 100%;
}

/* 主容器 */
.ai-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航栏 */
.top-navbar {
    background: rgba(30, 41, 59, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-left {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.back-btn:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    font-size: 1.5rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

.logo-text-short {
    display: none;
}

@media (max-width: 768px) {
    .logo-text-full {
        display: none;
    }
    .logo-text-short {
        display: inline;
    }
}

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

/* 内容包装器 */
.content-wrapper {
    display: flex;
    flex: 1;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    gap: 2rem;
    padding: 2rem;
}

/* 左侧边栏 */
.sidebar {
    width: 280px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-primary);
}

.sidebar-header i {
    color: var(--primary-color);
    font-size: 1.3rem;
}

.sidebar-menu {
    list-style: none;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    position: relative;
}

.menu-item i:first-child {
    font-size: 1.1rem;
    width: 20px;
}

.menu-item span {
    flex: 1;
    font-weight: 500;
}

.menu-item .arrow {
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.3s;
}

.menu-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    transform: translateX(5px);
}

.menu-item:hover .arrow {
    opacity: 1;
}

.menu-item.active {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.menu-item.active .arrow {
    opacity: 1;
}

/* 主内容区 */
.main-content {
    flex: 1;
    min-width: 0;
}

/* 模块容器 */
#moduleContainer {
    animation: fadeIn 0.5s ease-in-out;
}

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

/* 模块标题 */
.module-header {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.module-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.module-title i {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.module-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
}

/* 卡片样式 - 紧凑版 */
.ai-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.ai-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.12);
    transform: translateY(-1px);
}

.card-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.card-title i {
    color: var(--primary-color);
}

/* 主力阶段标签 */
.stage-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: slideIn 0.5s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 吸筹阶段 - 蓝色 */
.stage-xichou {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 洗盘阶段 - 黄色 */
.stage-xipan {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 拉升阶段 - 红色 */
.stage-lasheng {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 出货阶段 - 紫色 */
.stage-chuhuo {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 预测标签 */
.prediction-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    animation: slideIn 0.6s ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
}

/* 预测上涨 - 红色边框 */
.prediction-up {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: #ef4444;
    font-weight: 800;
}

/* 预测下跌 - 绿色边框 */
.prediction-down {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: #10b981;
    font-weight: 800;
}

/* 预测震荡 - 灰色边框 */
.prediction-sideways {
    background: rgba(107, 114, 128, 0.15);
    color: #6b7280;
    border-color: #6b7280;
    font-weight: 800;
}

/* 建议观望 - 橙色边框 */
.prediction-wait {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border-color: #f59e0b;
    font-weight: 800;
}

/* 标签动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* AI 分析结果样式 - 紧凑版 */
.ai-insight {
    background: rgba(99, 102, 241, 0.05);
    border-left: 3px solid var(--primary-color);
    border-radius: 8px;
    padding: 1rem;
    margin: 0.8rem 0;
}

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
}

.insight-content {
    line-height: 1.9;
    color: var(--text-primary);
    font-size: 0.95rem;
    padding: 0.8rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
}

.insight-content p {
    margin-bottom: 0.8rem;
    text-align: justify;
}

.insight-content h3 {
    color: var(--primary-color);
    margin: 1.5rem 0 1rem 0;
    font-size: 1.15rem;
    font-weight: 700;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid var(--border-color);
    letter-spacing: 0.3px;
}

.insight-content strong {
    color: var(--primary-color);
    font-weight: 700;
}

.insight-highlight {
    color: var(--primary-color);
    font-weight: 600;
}

/* AI内容格式化样式 - 紧凑优化版 */
.ai-formatted-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary) !important;
    padding: 0.2rem;
}

.ai-formatted-content * {
    color: var(--text-primary) !important;
}

/* 章节容器 - 紧凑版 */
.ai-section-wrapper {
    margin-bottom: 0.8rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 0.5rem;
    transition: all 0.3s ease;
}

.ai-section-wrapper:hover {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}

.ai-formatted-content p {
    margin: 0.4rem 0;
    line-height: 1.65;
    text-align: justify;
    text-indent: 0;
}

.ai-formatted-content p:first-child {
    margin-top: 0;
}

.ai-formatted-content p:last-child {
    margin-bottom: 0;
}

.ai-section-title {
    color: var(--primary-color);
    font-size: 1.4rem;
    font-weight: 700;
    margin: 2.5rem 0 1.2rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
    display: block;
    letter-spacing: 0.5px;
}

.ai-section-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.08) 100%);
    border-left: 3px solid var(--primary-color);
    padding: 0.5rem 0.8rem;
    margin: 0 0 0.5rem 0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.1);
    letter-spacing: 0.3px;
}

.ai-emoji {
    font-size: 1.4rem;
    display: inline-block;
    margin-right: 0.15rem;
}

.ai-section-content {
    padding: 0.4rem 0 0.4rem 1rem;
    margin: 0.2rem 0 0.6rem 0;
    border-left: 2px solid rgba(99, 102, 241, 0.25);
    background: rgba(255, 255, 255, 0.01);
    color: var(--text-primary);
}

.ai-paragraph {
    margin: 0.35rem 0;
    line-height: 1.6;
    text-align: justify;
    color: var(--text-primary);
    font-weight: 400;
}

.ai-list-container {
    margin: 0.4rem 0;
    padding: 0.2rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 6px;
}

.ai-list-item {
    margin: 0.25rem 0;
    padding: 0.4rem 0.6rem;
    padding-left: 1.8rem;
    position: relative;
    line-height: 1.55;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 3px solid rgba(99, 102, 241, 0.2);
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 400;
}

.ai-list-item:hover {
    background: rgba(99, 102, 241, 0.08);
    border-left-color: var(--primary-color);
}

.ai-list-number,
.ai-bullet {
    position: absolute;
    left: 0.5rem;
    top: 0.4rem;
    color: var(--primary-color);
    font-size: 0.7rem;
    font-weight: 800;
    font-size: 1.1rem;
}

.ai-percent {
    color: #ef4444;
    font-weight: 800;
    background: rgba(239, 68, 68, 0.15);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 1em;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(239, 68, 68, 0.2);
}

.ai-positive {
    color: #ef4444;
    font-weight: 800;
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

.ai-negative {
    color: #10b981;
    font-weight: 800;
    font-size: 1.1em;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.ai-stock-code {
    color: #8b5cf6;
    font-weight: 700;
    background: rgba(139, 92, 246, 0.15);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    box-shadow: 0 1px 3px rgba(139, 92, 246, 0.2);
}

.ai-amount {
    color: #f59e0b;
    font-weight: 700;
}

/* 新增高亮样式 */
.ai-date {
    color: #06b6d4;
    font-weight: 600;
    background: rgba(6, 182, 212, 0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

.ai-time {
    color: #14b8a6;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    background: rgba(20, 184, 166, 0.12);
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}

.ai-price-range {
    color: #f97316;
    font-weight: 700;
    background: rgba(249, 115, 22, 0.12);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    white-space: nowrap;
    font-size: 1.1em;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.insight-content div {
    margin: 0.5rem 0;
}

.insight-content br + br {
    display: block;
    content: "";
    margin-top: 0.5rem;
}

/* 统计数据卡片 - 紧凑版 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin: 0.8rem 0;
}

.stat-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
    transition: all 0.3s;
}

.stat-item:hover {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--primary-color);
}

.stat-value {
    font-size: 1.7rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.4rem;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

/* 图表容器 */
.chart-container {
    min-height: 400px;
    margin: 1.5rem 0;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 1rem;
}

/* 表格样式 */
.ai-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.ai-table thead {
    background: rgba(99, 102, 241, 0.1);
}

.ai-table th,
.ai-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.ai-table th {
    font-weight: 600;
    color: var(--primary-color);
}

.ai-table tbody tr {
    transition: all 0.2s;
}

.ai-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

/* 搜索框 */
.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-btn {
    background: var(--gradient-1);
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.3);
}

/* 加载动画 */
.ai-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.ai-loading.active {
    display: flex;
}

.loading-content {
    text-align: center;
}

.brain-icon {
    font-size: 4rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: brainPulse 1.5s ease-in-out infinite;
    margin-bottom: 1rem;
}

@keyframes brainPulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.2); opacity: 1; }
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.loading-subtext {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.progress-bar {
    width: 300px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 顶部导航按钮样式 */
.nav-btn-login {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-btn-login:hover {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
}

.nav-btn-register {
    background: var(--gradient-1);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s;
}

.nav-btn-register:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.nav-points-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(245, 158, 11, 0.15);
    padding: 0.5rem 0.8rem;
    border-radius: 20px;
    color: #f59e0b;
    font-weight: 600;
    font-size: 0.9rem;
}

.nav-btn-recharge {
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s;
}

.nav-btn-recharge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}


/* 用户导航样式 */
.user-info-navbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    position: relative;
}

.user-info-navbar i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.user-name {
    font-weight: 500;
}

.user-dropdown-navbar {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    min-width: 200px;
    display: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.user-info-navbar:hover .user-dropdown-navbar {
    display: block;
}

.user-dropdown-navbar a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
}

.user-dropdown-navbar a:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* ========================================
   移动端强制样式 (通过JS检测添加 .is-mobile 类)
   ======================================== */
html.is-mobile body,
body.is-mobile {
    padding-bottom: 65px !important;
}

html.is-mobile .ai-container,
body.is-mobile .ai-container {
    padding-top: 55px !important;
}

html.is-mobile .top-navbar,
body.is-mobile .top-navbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1000 !important;
    padding: 0.5rem 0.8rem !important;
    height: 55px !important;
}

html.is-mobile .sidebar,
body.is-mobile .sidebar {
    display: none !important;
}

html.is-mobile .mobile-nav,
body.is-mobile .mobile-nav {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
}

html.is-mobile .logo-text-full,
body.is-mobile .logo-text-full {
    display: none !important;
}

html.is-mobile .logo-text-short,
body.is-mobile .logo-text-short {
    display: inline !important;
}

html.is-mobile .nav-btn-text,
body.is-mobile .nav-btn-text {
    display: none !important;
}

html.is-mobile .user-name,
body.is-mobile .user-name,
html.is-mobile .nav-chevron,
body.is-mobile .nav-chevron {
    display: none !important;
}

html.is-mobile .content-wrapper,
body.is-mobile .content-wrapper {
    padding: 0.5rem !important;
    gap: 0 !important;
}

html.is-mobile .main-content,
body.is-mobile .main-content {
    width: 100% !important;
    padding: 0 !important;
}

html.is-mobile .module-header,
body.is-mobile .module-header {
    padding: 0.8rem !important;
    margin-bottom: 0.8rem !important;
}

html.is-mobile .module-title,
body.is-mobile .module-title {
    font-size: 1.1rem !important;
}

html.is-mobile .ai-card,
body.is-mobile .ai-card {
    padding: 0.8rem !important;
    margin-bottom: 0.6rem !important;
}

html.is-mobile .stats-grid,
body.is-mobile .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
}

html.is-mobile .stat-value,
body.is-mobile .stat-value {
    font-size: 1.2rem !important;
}

html.is-mobile .stat-label,
body.is-mobile .stat-label {
    font-size: 0.7rem !important;
}

/* ========================================
   响应式设计 - 平板端 (768px - 1024px)
   ======================================== */
@media (max-width: 1024px) and (min-width: 769px) {
    .content-wrapper {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }
    
    .sidebar {
        width: 100%;
        position: static;
        padding: 1rem;
    }
    
    .sidebar-header {
        display: none;
    }
    
    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .menu-item {
        flex: 1;
        min-width: 140px;
        padding: 0.8rem;
        justify-content: center;
        margin-bottom: 0;
    }
    
    .menu-item .arrow {
        display: none;
    }
}

/* ========================================
   响应式设计 - 手机端 (小于768px)
   ======================================== */
@media (max-width: 768px) {
    /* 基础布局 */
    body {
        padding-bottom: 65px;
    }
    
    .ai-container {
        padding-top: 55px;
    }
    
    /* 顶部导航 - 固定 */
    .top-navbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding: 0.5rem 0.8rem;
        height: 55px;
    }
    
    .navbar-left .logo {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .navbar-left .logo i {
        font-size: 1.1rem;
    }
    
    .navbar-left .logo span {
        font-size: 0.9rem;
    }
    
    /* 顶部导航右侧 */
    .navbar-right {
        gap: 0.4rem !important;
    }
    
    .nav-btn-text {
        display: none !important;
    }
    
    .nav-btn-login,
    .nav-btn-register {
        padding: 0.45rem 0.6rem !important;
        font-size: 1rem;
    }
    
    .nav-points-badge {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
        gap: 0.25rem;
    }
    
    .nav-btn-recharge {
        padding: 0.4rem 0.55rem !important;
    }
    
    .user-info-navbar {
        padding: 0.35rem 0.5rem !important;
    }
    
    .user-info-navbar .user-name,
    .user-info-navbar .nav-chevron,
    .user-info-navbar .fa-chevron-down {
        display: none !important;
    }
    
    /* 隐藏侧边栏 */
    .sidebar {
        display: none !important;
    }
    
    /* 主内容区 */
    .content-wrapper {
        padding: 0.5rem;
        gap: 0;
    }
    
    .main-content {
        width: 100%;
        padding: 0;
    }
    
    /* 模块头部 */
    .module-header {
        padding: 0.8rem;
        margin-bottom: 0.8rem;
        border-radius: 10px;
    }
    
    .module-title {
        font-size: 1.1rem;
        gap: 0.4rem;
        flex-wrap: wrap;
    }
    
    .module-title i {
        font-size: 1.1rem;
    }
    
    .module-desc {
        font-size: 0.8rem;
        margin-top: 0.25rem;
        line-height: 1.4;
    }
    
    /* 卡片 */
    .ai-card {
        padding: 0.8rem;
        margin-bottom: 0.6rem;
        border-radius: 8px;
    }
    
    .card-title {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        padding-bottom: 0.4rem;
        gap: 0.4rem;
    }
    
    /* 统计网格 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .stat-item {
        padding: 0.6rem;
        border-radius: 8px;
    }
    
    .stat-value {
        font-size: 1.2rem;
    }
    
    .stat-label {
        font-size: 0.7rem;
    }
    
    /* 搜索框 */
    .search-input {
        padding: 0.7rem 0.9rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    .search-btn {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
        border-radius: 8px;
    }
    
    /* 图表 */
    .chart-container {
        min-height: 250px;
        padding: 0.5rem;
        margin: 0.8rem 0;
    }
    
    /* 表格 */
    .ai-table {
        font-size: 0.8rem;
    }
    
    .ai-table th,
    .ai-table td {
        padding: 0.5rem 0.3rem;
    }
    
    /* AI分析内容 */
    .ai-insight {
        padding: 0.6rem;
        margin: 0.5rem 0;
    }
    
    .insight-content {
        font-size: 0.85rem;
        padding: 0.4rem;
        line-height: 1.7;
    }
    
    .ai-section-header {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    
    .ai-section-content {
        padding: 0.3rem 0 0.3rem 0.8rem;
    }
    
    .ai-list-item {
        padding: 0.3rem 0.4rem 0.3rem 1.5rem;
        font-size: 0.8rem;
        margin: 0.2rem 0;
    }
    
    .ai-paragraph {
        font-size: 0.8rem;
        margin: 0.3rem 0;
        line-height: 1.5;
    }
    
    .ai-section-wrapper {
        margin-bottom: 0.5rem;
        padding: 0.4rem;
    }
    
    .ai-formatted-content {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* ========================================
   底部移动端导航栏
   ======================================== */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    z-index: 1001;
    padding: 0.4rem 0;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
}

@media (max-width: 768px) {
    .mobile-nav {
        display: flex;
        justify-content: space-around;
        align-items: center;
    }
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.65rem;
    transition: all 0.2s;
    flex: 1;
    max-width: 70px;
    cursor: pointer;
}

.mobile-nav-item i {
    font-size: 1.15rem;
    margin-bottom: 0.15rem;
}

.mobile-nav-item span {
    white-space: nowrap;
}

.mobile-nav-item.active {
    color: white;
    background: var(--gradient-1);
}

/* ========================================
   超小屏幕 (小于380px)
   ======================================== */
@media (max-width: 380px) {
    .top-navbar {
        padding: 0.4rem 0.5rem;
        height: 50px;
    }
    
    .ai-container {
        padding-top: 50px;
    }
    
    .navbar-left .logo span {
        font-size: 0.8rem;
    }
    
    .navbar-left .logo i {
        font-size: 1rem;
    }
    
    .nav-btn-login,
    .nav-btn-register {
        padding: 0.35rem 0.5rem !important;
    }
    
    .nav-points-badge {
        padding: 0.3rem 0.4rem;
        font-size: 0.75rem;
    }
    
    .mobile-nav-item {
        padding: 0.3rem 0.3rem;
        font-size: 0.6rem;
    }
    
    .mobile-nav-item i {
        font-size: 1rem;
    }
    
    .module-header {
        padding: 0.6rem;
    }
    
    .module-title {
        font-size: 1rem;
    }
    
    .ai-card {
        padding: 0.6rem;
    }
    
    .card-title {
        font-size: 0.9rem;
    }
}

/* ========================================
   流式输出 - 打字指示器样式
   ======================================== */
.ai-typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1rem;
}

.ai-typing-indicator span {
    width: 10px;
    height: 10px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out both;
}

.ai-typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.ai-typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

.ai-typing-indicator span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes typing-bounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.3;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 流式内容容器 */
#streamContent {
    transition: all 0.3s ease;
    max-height: 80vh;
    overflow-y: auto;
}

#streamContent::-webkit-scrollbar {
    width: 6px;
}

#streamContent::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

#streamContent::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

/* 实时更新动画 */
.ai-stream-updating {
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
    }
}

/* ========================================
   风险提示样式
   ======================================== */
.risk-disclaimer {
    padding: 1rem 2rem;
    margin-top: auto;
    text-align: center;
}

.risk-disclaimer p {
    font-size: 0.7rem;
    color: #6b7280;
    line-height: 1.6;
    margin: 0;
    max-width: 800px;
    margin: 0 auto;
}

/* 移动端风险提示 */
@media (max-width: 768px) {
    .risk-disclaimer {
        padding: 0.8rem 1rem;
        margin-bottom: 60px;
    }
    
    .risk-disclaimer p {
        font-size: 0.65rem;
    }
}

html.is-mobile .risk-disclaimer,
body.is-mobile .risk-disclaimer {
    margin-bottom: 65px;
}

/* 弹跳动画 */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* 旋转动画 */
@keyframes spin {
    to { transform: rotate(360deg); }
}

