/* 🎨 AIAStock - 美学深空主题样式 */

/* 🚨 修复显示比例问题 - 移除所有zoom设置 */
html {
    font-size: 16px;
    /* 完全移除zoom和transform，让浏览器自然渲染 */
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    /* 不设置任何zoom或transform */
}

/* 🚨 强制桌面端显示 - 禁用响应式移动端适配 */
/* 电脑端无论窗口多小都保持桌面端Layout */

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

/* 🖥️ 桌面端布局 */
body {
    /* 移除强制最小宽度，恢复正常显示 */
    width: 100%;
}

.main-content {
    /* 移除强制最小宽度 */
    width: 100%;
    max-width: 100%;
}

/* Panel标准尺寸 */
.panel {
    width: 420px;
    height: 380px;
}

/* 🎆 美学动画系统 */
@keyframes pageLoad {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-10px) rotate(1deg); }
    66% { transform: translateY(5px) rotate(-0.5deg); }
}

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

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

:root {
    /* 🎨 主色彩系统 - 深空美学 */
    --bg-primary: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    --bg-secondary: linear-gradient(145deg, #1e1e3f 0%, #2d2d4a 100%);
    --bg-panel: linear-gradient(145deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.85) 100%);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    
    /* 文字系统 - 优雅层次 */
    --text-primary: #f8fafc;
    --text-secondary: rgba(248, 250, 252, 0.85);
    --text-muted: rgba(248, 250, 252, 0.65);
    --text-accent: #e0e7ff;
    
    /* 边框系统 - 细腻美学 */
    --border-primary: rgba(99, 102, 241, 0.2);
    --border-secondary: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(139, 92, 246, 0.3);
    
    /* 主色调系统 - 科技美感 */
    --accent-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-secondary: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
    --accent-tertiary: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --accent-blue: #6366f1;
    
    /* 间距规范 */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    
    /* 🎦 动画系统 - 流畅美感 */
    --transition-primary: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-secondary: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-fast: 0.2s ease-out;
    --transition-slow: 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-elastic: 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    
    /* 阴影系统 - 深度美学 */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.15);
    --shadow-medium: 0 8px 32px rgba(0, 0, 0, 0.2);
    --shadow-strong: 0 16px 48px rgba(0, 0, 0, 0.25);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
    --shadow-glow-hover: 0 0 30px rgba(99, 102, 241, 0.25);
    
    /* 页面切换动画配置 */
    --page-transition-duration: 0.4s;
    --page-transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --panel-slide-distance: 20px;
    --fade-opacity-start: 0;
    --fade-opacity-end: 1;
    
    /* 交互反馈颜色 */
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-warning: #f59e0b;
    --color-info: #3b82f6;
    
    /* 股票涨跌颜色系统 */
    --stock-up: #22c55e;      /* 上涨绿色 */
    --stock-down: #ef4444;    /* 下跌红色 */
    --stock-flat: #6b7280;    /* 平盘灰色 */
    --stock-up-bg: rgba(34, 197, 94, 0.1);
    --stock-down-bg: rgba(239, 68, 68, 0.1);
    --stock-flat-bg: rgba(107, 114, 128, 0.1);
    
    /* ===== 新增：从JavaScript配置转换的CSS变量 ===== */
    /* 模板尺寸规范 - 固定规则 */
    --template-width: 417.33px;
    --template-height: 380px;
    --template-header-height: 50px;
    --template-body-height: 344px;
    --template-min-padding: 8px;
    
    /* 图表颜色配置 */
    --chart-primary: #6366f1;
    --chart-success: #22c55e;
    --chart-danger: #ef4444;
    --chart-warning: #f59e0b;
    --chart-red-horse: #ef4444;
    --chart-yellow-horse: #f59e0b;
    
    /* 字体配置 */
    --font-family-primary: 'HarmonyOS Sans SC', 'HarmonyOS Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-xxl: 1.5rem;    /* 24px */
    
    /* 动画持续时间 */
    --animation-duration: 300ms;
    --racing-update-interval: 2000ms;
    --data-refresh-interval: 30000ms;
    --news-check-interval: 3000ms;
    --resize-debounce: 100ms;
}

/* 基础样式 */
body {
    font-family: 'HarmonyOS Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    overflow-y: visible;
    position: relative;
    
    /* 🌌 文字渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'kern' 1, 'liga' 1;
}

/* 🎆 背景动态效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(6, 182, 212, 0.02) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes backgroundShift {
    0% { transform: scale(1) rotate(0deg); opacity: 0.5; }
    100% { transform: scale(1.05) rotate(1deg); opacity: 0.8; }
}

/* =================================
   简洁Header结构 - 统一所有设备
   ================================= */
.header {
    height: 60px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    position: relative;
    z-index: 100;
}

/* Logo (header-left) - 左侧居中 */
.header-left {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 100%;
}

.logo {
    width: 40px;
    height: 40px;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform var(--transition-time);
}
/* News Scroller (header-center) - 中间居中 */
.header-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    margin: 0 20px;
}

#simpleNews {
    width: 100%;
    max-width: 600px;
    height: 40px;
    background: transparent; /* 🚨 改为透明背景 */
    border: none; /* 🚨 移除边框 */
    border-radius: 0; /* 🚨 移除圆角 */
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: all var(--transition-time);
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 40px;
}

#simpleNews:hover {
    background: transparent; /* 🚨 hover时也保持透明 */
    border-color: transparent; /* 🚨 hover时边框也透明 */
}

/* 统一Stock Input样式 - 适用于所有使用场景 */
.stock-input {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 0 16px;
    font-size: 16px;  /* 防止iOS自动缩放，最小16px */
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-family-primary);
    transition: all var(--transition-time);
}

/* Header中的Input Box - 特定定位样式 */
.header-center .stock-input {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 600px;
    height: 44px;
    display: none;
    z-index: 2;
}

.stock-input.active {
    display: block;
}

.stock-input::placeholder {
    color: var(--text-muted);
}

/* AI Button 样式保留但不再在头部使用（避免布局受影响） */

/* News滚动动画 */
@keyframes newsScroll {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(-100%);
    }
}

/* 移动端防缩放专用规则 - 适用于所有input元素 */
@media screen and (max-width: 768px) {
    input[type="text"], 
    input[type="search"], 
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    .stock-input {
        font-size: 16px !important;  /* iOS防缩放强制16px */
        -webkit-text-size-adjust: 100%;  /* 防止webkit调整字体大小 */
        text-size-adjust: 100%;
        -webkit-appearance: none;  /* 移除默认样式 */
        appearance: none;
    }
    
    /* 输入框获得焦点时防止页面跳动 */
    input:focus, 
    .stock-input:focus {
        font-size: 16px !important;
        transform: none;
        /* 移除zoom设置 */
        outline: none;
        -webkit-tap-highlight-color: transparent;  /* 移除点击高亮 */
    }
}


/* 手机模式下的Sidebar切换按钮 */
.mobile-sidebar-toggle {
    display: none;  /* 默认隐藏 */
    position: fixed;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    z-index: 10000;  /* 确保在最上层 */
}

/* 移动端显示切换按钮 */
@media (max-width: 768px) {
    .mobile-sidebar-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 8px;
        color: var(--text-primary);
        cursor: pointer;
        transition: all var(--transition-time);
        margin-right: 8px;
    }
    
    /* sidebar隐藏状态 */
    body.sidebar-hidden .sidebar {
        transform: translateX(-100%);
        width: 0 !important;
        min-width: 0 !important;
    }
    
    body.sidebar-hidden .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    body.sidebar-hidden .mobile-sidebar-toggle {
        left: 10px;
        background: var(--accent-blue);
    }
}

.mobile-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-blue);
}

.mobile-sidebar-toggle svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

/* 手机模式遮罩层 - 默认隐藏 */
.mobile-sidebar-overlay {
    display: none;
}



/* 手机模式下拉导航菜单 */
.mobile-nav-dropdown {
    display: none; /* 默认隐藏 */
    position: absolute;
    top: 100%;
    right: 0;
    width: 140px; /* 减小宽度，节省空间 */
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    backdrop-filter: blur(20px);
    /* box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3); */  /* 去掉黑色阴影 */
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.mobile-nav-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mobile-nav-list {
    list-style: none;
    padding: 4px 0; /* 减小顶部底部padding */
    margin: 0;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 12px; /* 减小padding适应更小宽度 */
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.mobile-nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.mobile-nav-item.active {
    background: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.mobile-nav-item .nav-icon {
    width: 20px; /* 减小图标尺寸 */
    height: 20px;
    margin-right: 8px; /* 减小间距 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-nav-item .nav-icon svg {
    width: 16px; /* 进一步减小SVG图标 */
    height: 16px;
    stroke: currentColor;
}

.mobile-nav-item .nav-label {
    font-size: 13px; /* 稍微减小字体 */
    font-weight: 500;
    white-space: nowrap; /* 防止文字换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 超长文字显示省略号 */
}

/* 访问者统计在下拉菜单底部 */
.mobile-nav-footer {
    padding: 8px 12px; /* 减小padding */
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.mobile-visitor-stats {
    display: flex;
    align-items: center;
    gap: 4px; /* 减小间距 */
    font-size: 11px; /* 减小字体 */
    color: var(--text-muted);
    justify-content: center; /* 居中显示 */
}

.mobile-visitor-stats .visitor-icon {
    font-size: 14px; /* 减小访问者图标 */
}

.mobile-visitor-stats .visitor-count {
    font-weight: 600;
    color: var(--text-primary);
}

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

/* 主容器 */
.main-container {
    display: flex;
    min-height: calc(100vh - 60px);  /* 최소 높이 */
    height: auto;                    /* 콘텐츠에 따라 자동 확장 */
}

/* 侧边栏 */
.sidebar {
    width: 50px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: relative;
    justify-content: space-between; /* 确保footer在底部 */
    transition: width 0.3s ease;  /* 添加平滑过渡 */
}

/* 移动端侧边栏优化 */
@media (max-width: 768px) {
    .sidebar {
        width: 40px !important;  /* 移动端减小宽度，节省空间 */
        min-width: 40px !important;
        max-width: 40px !important;
    }
    
    .nav-item {
        width: 32px !important;  /* 适配更窄的sidebar */
        height: 32px !important;
        margin: 4px auto !important;
        font-size: 16px !important;  /* 稍微减小图标大小 */
    }
}

.sidebar-nav {
    flex: 1;
    padding: var(--spacing-md) 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* 防止内容溢出 */
}

/* 🔮 美学导航项 */
.nav-item {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-primary);
    position: relative;
    border-radius: 14px;
    margin: 6px auto;
    background: 
        linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(255, 255, 255, 0.01) 100%),
        radial-gradient(circle at center, rgba(99, 102, 241, 0.03) 0%, transparent 70%);
    color: rgba(248, 250, 252, 0.7);
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.02);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.03);
    
    /* 光效动画 */
    background-size: 200% 200%;
    animation: navGlow 8s ease-in-out infinite alternate;
}

@keyframes navGlow {
    0% { background-position: 0% 50%; opacity: 0.8; }
    100% { background-position: 100% 50%; opacity: 1; }
}

/* 🎆 导航项悬停效果 */
.nav-item:hover {
    background: 
        linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(139, 92, 246, 0.12) 100%),
        radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    color: #e0e7ff;
    /* transform: translateY(-2px) scale(1.05); - removed hover scale animation */
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 
        0 8px 25px rgba(99, 102, 241, 0.12),
        0 0 0 1px rgba(99, 102, 241, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.nav-item.active {
    background: rgba(59, 130, 246, 0.2);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 24px;
    background: var(--accent-blue);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 24px;
    height: 24px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.nav-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 8px;
    padding: 4px 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
}

.sidebar-footer {
    padding: var(--spacing-sm) var(--spacing-xs);  /* 减少padding以适应窄边栏 */
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0; /* 防止被压缩 */
}

.visitor-stats {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.visitor-icon {
    font-size: 18px;  /* 稍微减小以适应窄边栏 */
    margin-bottom: 2px;
    display: block;
    line-height: 1;
}

.visitor-count {
    font-size: 10px;  /* 进一步减小字体 */
    color: var(--text-secondary);
    font-weight: normal;  /* 移除粗体 */
    line-height: 1;
}

/* 🔒 완전 완성 - 절대 수정 금지 */
/* 主内容区 - 타자치듯이 자연스러운 플로우 레이아웃 */
.main-content {
    flex: 1;
    background: var(--bg-primary);
    padding: var(--spacing-lg);
    
    /* 🎯 자연스러운 플로우 레이아웃 (타자치듯이) */
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-start;
    justify-content: flex-start;
    
    /* 🚨 중요: 자동 크기 조정 - 패널 수에 따라 높이 자동 확장 */
    min-height: calc(100vh - 60px);  /* 최소 높이: 화면 높이 - 헤더 */
    height: auto;                    /* 콘텐츠에 따라 자동 높이 */
    max-height: none;                /* 최대 높이 제한 없음 */
    
    /* 스크롤 처리 - 横向滚动绝对禁止 */
    overflow-x: hidden; /* 🚨 HARD RULE: 가로 스크롤 절대 금지 */
    overflow-y: visible; /* 세로는 자연스럽게 확장 */
}
/* 🔒 완전 완성 - 절대 수정 금지 */

.content-grid {
    display: grid;
    /* 🚨 HARD RULE: Panel摆放规则 - 空间充分往右，不够往下换行 */
    grid-template-columns: repeat(auto-fit, 417.33px);
    gap: var(--spacing-lg);
    /* 🚨 REMOVED: 删除固定高度限制，让Panel可以往下摆放 */
    /* height: calc(100vh - 120px); */
    /* 确保换行而不是被挤压 */
    grid-auto-flow: row;
    /* 固定行高 */
    grid-auto-rows: 380px;
    /* 在有限空间内左对齐 */
    justify-content: start;
    /* 强制所有网格项完全一样大 */
    align-items: stretch !important;
    justify-items: stretch !important;
}

/* 强制Grid中的所有Panel完全相同尺寸 */
.content-grid > * {
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
}

/* 所有Panel强制统一尺寸 - 绝对不允许变化 */
/* ❌ 2025-11-15: 已废弃 - 游资赛马和机构赛乌龟已统一使用.panel-template样式 */
/* .racing-panel,
.static-panel {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: 1 !important;
} */

/* Panel Header - 强制统一高度 (按设计规范36px) */
.panel-header {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    flex-shrink: 0 !important;
}

.panel-header h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
}

/* panel-action 样式已移除 - 不再使用手动刷新按钮 */

/* Panel Body - 强制统一尺寸占用剩余空间 (按设计规范padding为0) */
.panel-body {
    flex: 1 !important;
    padding: 0 !important;
    overflow: hidden !important;
    position: relative;
    display: flex !important;
    flex-direction: column !important;
    /* 确保所有Panel Body完全一样大 */
    min-height: 0 !important;
    height: var(--template-body-height, 344px) !important;
    /* 内容占满整个body区域 */
    justify-content: flex-start;
    align-items: stretch;
}

/* 交易信号、交易记录、盈亏统计、富途仓位Panel的特殊滚动设置 */
#trading-signals-panel .panel-body,
#trading-orders-panel .panel-body,
#trading-pnl-panel .panel-body,
#pnl-panel .panel-body,
#futu-positions-panel .panel-body,
[data-target="trading-signals"] .panel-body,
[data-target="trading-orders"] .panel-body,
[data-target="trading-pnl"] .panel-body {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 12px !important;
    max-height: 344px !important; /* 更新为417.33x344px规格 */
}

/* 所有Panel Body内的图表容器优化 - 从style_new.css */
.panel-body .chart-container,
.panel-body .kline-chart-container,
.panel-body .mini-charts {
    width: 100% !important;
    height: 100% !important;
    position: relative;
    min-height: 0;
    max-height: 600px;
    overflow-y: auto;
    flex: 1;
}

/* 静态区域内的图表特别优化 - 从style_new.css */
.static-panel .chart-container,
.static-panel .kline-chart-container,
.static-panel .mini-charts {
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    flex: 1;
}

.racing-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.race-tracks {
    height: calc(100% - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
}

.race-track {
    height: 40px;
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.racing-item {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: left 0.5s ease;
}

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

.racing-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.stock-code {
    font-size: 12px;
    color: var(--text-secondary);
}

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

.mini-leaderboard {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 41, 59, 0.95);
    border-top: 1px solid var(--border-color);
    padding: var(--spacing-sm);
    border-radius: 0 0 8px 8px;
}

.leaderboard-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.leader-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 2px 0;
}

/* 静态面板样式已合并到上面的统一Panel样式中 */

.loading-placeholder {
    text-align: center;
    color: var(--text-muted);
    padding: var(--spacing-xl);
}

/* 报告模态框 */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.report-content {
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: auto;
    position: relative;
}

.report-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-time);
}

.report-close:hover {
    background: var(--bg-primary);
    transform: rotate(90deg);
}

#report-body {
    padding: var(--spacing-xl);
}

/* 🎆 全局美学滚动条系统 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: 
        linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(30, 41, 59, 0.1) 100%);
    border-radius: 3px;
    margin: 1px;
}

::-webkit-scrollbar-thumb {
    background: 
        linear-gradient(180deg, rgba(99, 102, 241, 0.3) 0%, rgba(139, 92, 246, 0.25) 100%);
    border-radius: 3px;
    box-shadow: 
        0 0 4px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: all var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
    background: 
        linear-gradient(180deg, rgba(99, 102, 241, 0.5) 0%, rgba(139, 92, 246, 0.4) 100%);
    box-shadow: 
        0 0 8px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: scaleY(1.1);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

/* 动画效果 */
.spark {
    position: absolute;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, rgba(251, 191, 36, 0.8) 0%, transparent 70%);
    border-radius: 50%;
    animation: spark-fade 0.8s ease-out forwards;
}

@keyframes spark-fade {
    to {
        transform: scale(2);
        opacity: 0;
    }
}

.dust {
    position: absolute;
    width: 15px;
    height: 15px;
    background: radial-gradient(circle, rgba(156, 163, 175, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: dust-fade 1s ease-out forwards;
}

@keyframes dust-fade {
    to {
        transform: scale(1.5) translateY(-10px);
        opacity: 0;
    }
}

/* 静态内容样式 */
.market-status-grid,
.volume-charts-grid,
.hot-sectors-grid {
    display: grid;
    gap: var(--spacing-md);
    padding: var(--spacing-sm);
}

.market-overview,
.volume-section,
.limit-section,
.sectors-section,
.stocks-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: var(--spacing-sm);
}

.market-overview h4,
.volume-section h4,
.limit-section h4,
.sectors-section h4,
.stocks-section h4 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.overview-stats,
.volume-stats,
.limit-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stat-item,
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.stat-item .label,
.stat-row .label {
    color: var(--text-secondary);
}

.stat-item .value,
.stat-row .value {
    color: var(--text-primary);
    font-weight: 500;
}

.indices-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.index-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
}

.index-name {
    color: var(--text-secondary);
}

.index-value {
    font-weight: 500;
}

.sectors-list,
.stocks-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sector-item,
.stock-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 12px;
}

.stock-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 8px;
}

.stock-code {
    color: var(--text-muted);
    font-size: 11px;
}

.stock-name,
.sector-name {
    color: var(--text-secondary);
}

.stock-change,
.sector-change {
    font-weight: 500;
}

/* 状态颜色 */
.up, .value.up, .index-value.up, .stock-change.up, .sector-change.up {
    color: #10b981;
}

.down, .value.down, .index-value.down, .stock-change.down, .sector-change.down {
    color: #ef4444;
}

.neutral, .value.neutral, .index-value.neutral {
    color: var(--text-primary);
}

/* 错误和占位符状态 */
.error-state,
.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    text-align: center;
    min-height: 200px;
}

.error-icon,
.placeholder-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
    opacity: 0.6;
}

.error-text,
.placeholder-text {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.error-subtitle,
.placeholder-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
}

.retry-btn {
    padding: 8px 16px;
    background: var(--accent-blue);
    border: none;
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-time);
}

.retry-btn:hover {
    background: #2563eb;
}

/* 报告模态框内容样式 */
.report-header {
    padding: var(--spacing-xl);
    border-bottom: 1px solid var(--border-color);
}

.report-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.report-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.report-summary {
    padding: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.02);
    margin: var(--spacing-lg);
    border-radius: 8px;
}

.report-sections {
    padding: 0 var(--spacing-xl);
}

.report-section {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.report-section:last-child {
    border-bottom: none;
}

.report-section h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.report-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.report-footer {
    padding: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
}

.disclaimer {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

/* 股票分析报告样式 */

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

.analysis-logo {
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    border-radius: 50%;
}

.analysis-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.analysis-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.analysis-close-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-time);
}

.analysis-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.analysis-content-wrapper {
    flex: 1;
    overflow: auto;
    background: var(--bg-primary);
}

.analysis-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    color: var(--text-primary);
    line-height: 1.6;
}

.analysis-content h1,
.analysis-content h2,
.analysis-content h3 {
    color: var(--text-primary);
    margin: var(--spacing-lg) 0 var(--spacing-md) 0;
}

.analysis-content h1 {
    font-size: 24px;
    border-bottom: 2px solid var(--accent-blue);
    padding-bottom: var(--spacing-sm);
}

.analysis-content h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: var(--spacing-xs);
}

.analysis-content h3 {
    font-size: 16px;
}

.analysis-content p {
    margin: var(--spacing-sm) 0;
}

.analysis-content pre {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: var(--spacing-md);
    overflow-x: hidden; /* 🚨 HARD RULE: 가로 스크롤 절대 금지 */
}

.analysis-content code {
    background: var(--bg-secondary);
    padding: 2px 4px;
    border-radius: 2px;
    font-family: 'Courier New', monospace;
}

.analysis-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-md) 0;
}

.analysis-content th,
.analysis-content td {
    border: 1px solid var(--border-color);
    padding: var(--spacing-sm);
    text-align: left;
}

.analysis-content th {
    background: var(--bg-secondary);
    font-weight: 600;
}

/* 分析加载覆盖层 - 已禁用，改用新闻滚动条提示 */
.analysis-loading-overlay {
    display: none !important; /* 强制隐藏全屏加载 */
}

.analysis-loading-overlay .loading {
    display: none !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mermaid图表样式 */
.mermaid-diagram {
    text-align: center;
    margin: var(--spacing-md) 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: var(--spacing-md);
}

.mermaid-error {
    color: #ef4444;
    padding: var(--spacing-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    border-radius: 4px;
    margin: var(--spacing-md) 0;
}

/* Mini图表样式 */
.mini-charts-grid,
.mini-charts {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
    width: 100% !important;
    height: 100% !important;
    box-sizing: border-box !important;
    position: relative;
    overflow: hidden;
}

#mini-charts {
    width: 100% !important;
    height: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

.mini-chart {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    padding: 10px !important;
    min-height: 120px !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative;
}

.mini-chart-title {
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    margin-bottom: 8px !important;
    text-align: center;
}

.mini-chart-content {
    flex: 1 !important;
    width: 100% !important;
    height: 60px !important;
    min-height: 60px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 4px !important;
    overflow: hidden !important;
}

.mini-chart-change {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 11px !important;
    font-weight: bold !important;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.3);
}

.mini-chart-change.positive {
    color: #10b981 !important;
    border: 1px solid #10b981;
}

.mini-chart-change.negative {
    color: #ef4444 !important;
    border: 1px solid #ef4444;
}

.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 12px;
}

/* ECharts容器优化 - 从style_new.css复制的响应式设置 */
.mini-chart-content .echarts-container,
.mini-charts .echarts-container,
.chart-container .echarts-container,
.kline-chart-container .echarts-container {
    width: 100% !important;
    height: 100% !important;
}

/* 强制所有图表子元素响应式 - 从style_new.css */
.mini-chart-content > *,
.mini-charts > *,
.chart-container > *,
.kline-chart-container > *,
.mini-chart-content > div,
.mini-charts > div,
.chart-container > div,
.kline-chart-container > div {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* 确保Canvas和SVG元素也响应式 - 从style_new.css */
.mini-chart-content canvas,
.mini-chart-content svg,
.mini-charts canvas,
.mini-charts svg,
.chart-container canvas,
.chart-container svg,
.kline-chart-container canvas,
.kline-chart-container svg {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    display: block !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    /* vertical-align 在块级元素上无效，避免诊断告警 */
}

/* TradingView或其他第三方图表库优化 - 从style_new.css */
.mini-chart-content iframe,
.mini-charts iframe,
.chart-container iframe,
.kline-chart-container iframe {
    width: 100% !important;
    height: 100% !important;
    border: none;
}

/* 响应式图表的JavaScript辅助类 - 从style_new.css */
.chart-responsive {
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

.chart-responsive * {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* 统一内容容器样式 */
.static-content-container,
#static-content-container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative;
    overflow: hidden;
}

/* 确保静态内容区域的mini图表显示正确并能响应窗口变化 */
.static-panel .mini-charts,
.static-panel #mini-charts {
    width: 100% !important;
    height: 100% !important;
    min-height: 250px !important;
    /* 确保在窗口变化时能正确调整 */
    position: relative;
}

.panel-body .mini-charts,
.panel-body #mini-charts {
    width: 100% !important;
    height: 100% !important;
    /* 让图表容器能响应父容器大小变化 */
    position: relative;
    min-height: 0;
    flex: 1;
}

/* 强制重新计算图表尺寸的工具类 - 从style_new.css */
.chart-resize-trigger {
    animation: chart-resize 0.1s ease-out;
}

@keyframes chart-resize {
    0% { transform: scale(1); }
    50% { transform: scale(1.001); }
    100% { transform: scale(1); }
}

/* 图表响应式强制刷新工具 - 从style_new.css */
.chart-force-resize {
    animation: force-chart-resize 0.1s ease-out;
}

@keyframes force-chart-resize {
    0% { 
        width: 100%; 
        height: 100%; 
    }
    50% { 
        width: 99.9%; 
        height: 99.9%; 
    }
    100% { 
        width: 100%; 
        height: 100%; 
    }
}

/* 窗口大小变化时的过渡效果 - 从style_new.css */
@media (prefers-reduced-motion: no-preference) {
    .chart-container,
    .kline-chart-container,
    .mini-charts {
        transition: width 0.3s ease, height 0.3s ease;
    }
}

/* 响应式mini图표 - 데스크탑과 모바일 동일한 2x2 레이아웃 유지 */
@media (max-width: 768px) {
    .mini-charts-grid {
        grid-template-columns: 1fr 1fr !important;  /* 🚨 HARD RULE: 모바일에서도 데스크탑과 같은 2x2 레이아웃 유지 */
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .mini-chart {
        min-height: 100px !important;
        padding: 8px !important;
    }
    
    .mini-chart-content {
        height: 50px !important;
        min-height: 50px !important;
    }
    
    /* 小屏幕图表特别优化 - 从style_new.css */
    .chart-container,
    .kline-chart-container,
    .mini-charts {
        min-height: 200px;
    }
}

/* 中等屏幕优化 - 从style_new.css */
@media (max-width: 1024px) {
    .chart-container,
    .kline-chart-container,
    .mini-charts {
        min-height: 250px;
    }
}

/* 超小屏幕优化 - 从style_new.css */
@media (max-width: 480px) {
    .chart-container,
    .kline-chart-container,
    .mini-charts {
        min-height: 150px;
    }
}

/* =================================
   移动端响应式布局 - 自动伸缩Panel
   ================================= */
@media (max-width: 768px) {
    .main-content {
        padding: 8px; /* 减小移动端内边距 */
        margin-left: 40px; /* 适配更窄的sidebar */
        width: calc(100% - 40px);
    }

    .content-grid {
        /* 在移动端，将网格布局改为单列，宽度为100% */
        grid-template-columns: 1fr;
        /* 允许Panel高度根据内容自适应 */
        grid-auto-rows: auto;
        gap: 10px; /* 减小Panel之间的间距 */
    }

    /* ❌ 2025-11-15: 已废弃 - 移动端racing-panel样式已不再使用 */
    /* .racing-panel,
    .static-panel {
        width: 100% !important;
        height: auto !important;
        min-height: 300px;
        max-height: 500px;
        overflow-y: auto;
        margin: 0 !important;
        box-sizing: border-box;
    } */
    
    /* Panel内容区域优化 */
    .panel-body {
        height: auto !important;
        max-height: 400px !important;
        overflow-y: auto !important;
    }
    
    /* 🚨 修复: Header响应式布局优化 */
    .header {
        padding: 0 8px !important; /* 减小左右padding */
    }
    
    .header-center {
        margin: 0 10px !important; /* 减小margin确保AI按钮可见 */
        max-width: calc(100vw - 140px) !important; /* 为左右按钮预留空间 */
    }
    
    .header-left,
    .header-right {
        flex: 0 0 45px !important; /* 稍微减小按钮区域 */
        width: 45px !important;
        min-width: 45px !important;
    }
    
    #simpleNews {
        font-size: 13px !important; /* 稍微减小字体 */
        padding-right: 10px !important; /* 确保文字不会覆盖AI按钮 */
    }
    
    /* 注销：重复的stock-input定义已移除 */
}

/* 🚨 超小屏幕额外优化 */
@media (max-width: 480px) {
    .header {
        padding: 0 5px !important;
    }
    
    .header-center {
        margin: 0 8px !important;
        max-width: calc(100vw - 120px) !important;
    }
    
    .header-left,
    .header-right {
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
    }
    
    #simpleNews {
        font-size: 12px !important;
        padding-right: 8px !important;
    }
    
    /* AI按钮在超小屏幕时稍微缩小 */
    #aiHelper {
        width: 35px !important;
        height: 35px !important;
    }
}

/* ===== AI 分析报告弹窗样式 ===== */
/* 符合设计规范的分析报告弹窗 */



.analysis-title-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.analysis-logo {
    width: 32px;
    height: 32px;
    background: var(--accent-blue, #3b82f6);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.analysis-logo::before {
    content: "AI";
    color: var(--text-primary, #ffffff);
    font-weight: bold;
    font-size: 14px;
}

.analysis-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.analysis-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.analysis-close-btn {
    background: none;
    border: none;
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.analysis-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #ffffff);
}

.analysis-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.analysis-content {
    color: var(--text-primary, #ffffff);
    line-height: 1.6;
    font-family: 'HarmonyOS Sans SC', 'HarmonyOS Sans', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Helvetica Neue', Arial, sans-serif;
}

/* Markdown content styling */
.analysis-content h1,
.analysis-content h2,
.analysis-content h3,
.analysis-content h4,
.analysis-content h5,
.analysis-content h6 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.analysis-content h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid var(--border-color, rgba(255, 255, 255, 0.1));
    padding-bottom: 0.5rem;
}

.analysis-content h2 {
    font-size: 1.5rem;
}

.analysis-content h3 {
    font-size: 1.25rem;
}

.analysis-content p {
    margin-bottom: 1rem;
}

.analysis-content ul,
.analysis-content ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.analysis-content li {
    margin-bottom: 0.5rem;
}

.analysis-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: var(--font-mono, monospace);
    font-size: 0.9em;
}

.analysis-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: hidden; /* 🚨 HARD RULE: 가로 스크롤 절대 금지 */
    margin-bottom: 1rem;
}

.analysis-content pre code {
    background: none;
    padding: 0;
}

.analysis-content blockquote {
    border-left: 4px solid var(--accent-blue, #3b82f6);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
}

.analysis-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.analysis-content th,
.analysis-content td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
}

.analysis-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.analysis-content tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.analysis-content strong {
    color: var(--text-primary, #ffffff);
    font-weight: 600;
}

.analysis-content em {
    color: var(--text-muted, rgba(255, 255, 255, 0.9));
}

.analysis-content a {
    color: var(--accent-blue, #3b82f6);
    text-decoration: none;
}

.analysis-content a:hover {
    text-decoration: underline;
}

/* Loading overlay - 已禁用，改用新闻滚动条提示 */
.analysis-loading-overlay {
    display: none !important; /* 强制隐藏全屏加载 */
}

.analysis-loading-overlay .loading {
    display: none !important;
}

.analysis-loading-overlay span {
    display: none !important;
}

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

/* Error message styling */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-down, #ef4444);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.error-message h3 {
    color: var(--color-down, #ef4444);
    margin-top: 0;
}

.error-message p {
    color: var(--text-muted, rgba(255, 255, 255, 0.6));
}

/* Mermaid diagram styling */
.mermaid-diagram {
    margin: 1rem 0;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem;
    border-radius: 8px;
}

.mermaid-error {
    color: var(--color-down, #ef4444);
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-down, #ef4444);
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stock-analysis-container {
        width: 95%;
        max-height: 95vh;
    }
    
    .analysis-header {
        padding: 1rem;
    }
    
    .analysis-content-wrapper {
        padding: 1rem;
    }
    
    .analysis-title {
        font-size: 1.25rem;
    }
}

/* ===== 报告滚动优化样式 ===== */
/* Logo点击：无滚动条 */
.analysis-content-wrapper.no-scroll {
    overflow: hidden !important;
}

/* aiA股按钮：优化滚动条 */
.analysis-content-wrapper.optimized-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.8) transparent;
}

.analysis-content-wrapper.optimized-scroll::-webkit-scrollbar {
    width: 8px;
}

.analysis-content-wrapper.optimized-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.analysis-content-wrapper.optimized-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #6366f1, #8b5cf6);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.analysis-content-wrapper.optimized-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5b5bd6, #7c3aed);
}

/* 标准滚动条：股票分析 */
.analysis-content-wrapper.standard-scroll {
    scrollbar-width: auto;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

.analysis-content-wrapper.standard-scroll::-webkit-scrollbar {
    width: 12px;
}

.analysis-content-wrapper.standard-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.analysis-content-wrapper.standard-scroll::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
}

.analysis-content-wrapper.standard-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* ===== 从script.js的generateCoreStyles()迁移的CSS样式 ===== */
/* 这些样式之前通过JavaScript动态注入，现在移动到静态CSS文件以消除双重加载 */

/* 🎨 1. 美学Panel系统 - 玻璃拟态设计 */
.panel-template {
    width: var(--template-width) !important;
    height: var(--template-height) !important;
    margin: 0 !important; /* 🔥 2025-11-15 统一间距：所有panel使用相同的margin，间距由main-content的gap控制 */
    background:
        linear-gradient(145deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.6) 100%),
        radial-gradient(circle at top right, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
    border-radius: 1.2rem;
    border: 1px solid rgba(99, 102, 241, 0.15);
    overflow: hidden;
    position: relative;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all var(--transition-primary);
    
    /* 光效动画 */
    animation: panelGlow 6s ease-in-out infinite alternate;
}

@keyframes panelGlow {
    0% { box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    100% { box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(99, 102, 241, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 30px rgba(99, 102, 241, 0.05);
    }
}

.panel-template:hover {
    /* transform: translateY(-2px) scale(1.01); - removed hover scale animation */
    border-color: rgba(99, 102, 241, 0.25);
    box-shadow: 
        0 16px 48px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(99, 102, 241, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 40px rgba(99, 102, 241, 0.1);
}

/* 🎆 Panel Header - 优雅头部 */
.panel-template .panel-header {
    height: var(--template-header-height) !important;
    background: 
        linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.05) 100%),
        linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.02) 50%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px !important;
    border-bottom: 1px solid rgba(99, 102, 241, 0.15);
    position: relative;
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--text-accent);
    
    /* 顶部高光 */
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 1.2rem 1.2rem 0 0;
}

.panel-template .panel-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.4), transparent);
}

/* 🎨 Panel Body - 内容区域美化 */
.panel-template .panel-body {
    height: var(--template-body-height, 344px) !important;
    background: 
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.02) 0%, transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.01) 0%, rgba(255, 255, 255, 0.005) 100%);
    position: relative;
    padding: var(--template-min-padding);
    overflow: auto;
    line-height: normal;
    
    /* 滚动条美化 */
    scrollbar-width: thin;
    scrollbar-color: rgba(99, 102, 241, 0.3) transparent;
}

.panel-template .panel-body::-webkit-scrollbar {
    width: 6px;
}

.panel-template .panel-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.panel-template .panel-body::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.3));
    border-radius: 3px;
    transition: all var(--transition-fast);
}

.panel-template .panel-body::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.6), rgba(139, 92, 246, 0.5));
}

/* 技术分析和K线图的panel-body需要作为定位参照 */
.panel-template .panel-body.chart-full-body {
    padding: 0 !important;
    position: relative !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

/* 2. 图表容器最大化空间利用 */
.panel-template .chart-container {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    position: relative;
}

/* 🔧 修复：需要绝对定位的chart-container，其父元素panel-body必须设置position:relative */
.panel-template[data-panel-type="market-status"] .panel-body,
.panel-template[data-panel-type="chart-panel"] .panel-body,
.panel-template[data-panel-type="kline-panel"] .panel-body,
.panel-template[data-panel-type="horse-racing"] .panel-body,
.panel-template[data-panel-type="turtle-racing"] .panel-body,
.panel-template .panel-body.chart-full-body {
    position: relative !important;
}

.panel-template .panel-body.chart-full-body .chart-container,
.panel-template[data-panel-type="market-status"] .panel-body .chart-container,
.panel-template[data-panel-type="chart-panel"] .panel-body .chart-container,
.panel-template[data-panel-type="kline-panel"] .panel-body .chart-container,
.panel-template[data-panel-type="horse-racing"] .panel-body .chart-container,
.panel-template[data-panel-type="turtle-racing"] .panel-body .chart-container {
    /* 2025-12-04: 修复 canvas 脱离容器问题 - 改为 relative 定位 */
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

/* 2025-12-04: 强制 ECharts 内部 Wrapper 绝对定位 */
.chart-container > div {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden !important;
}

/* 3. 技术分析和K线图专用：占满Panel Body */
/* 移除技术分析和K线图panel的内边距，让chart占满整个panel-body */
#technicalChart,
[id^="technicalChart"],
#klineChart,
[id^="klineChart"] {
    width: 100% !important;
    height: 100% !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: transparent !important; /* 透明背景 - 用户的要求 */
}

/* 技术分析和K线图panel body保持透明 */
.panel-template .panel-body.chart-full-body {
    background: transparent !important; /* 透明背景 - 符合用户要求 */
    padding: 0 !important;
    position: relative !important;
    overflow: hidden !important;
}

/* 3. 赛马系统专用容器 */
.panel-template .racing-container {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    position: relative;
    overflow: hidden;
}

/* 4. 增强的响应式支持 */
@media (max-width: 768px) {
    .panel-template {
        width: calc(100vw - 20px) !important;  /* 减少边距，更充分利用屏幕宽度 */
        max-width: 100vw !important;  /* 确保不超出屏幕 */
        height: auto !important;
        min-height: 300px;
        max-height: 500px;
        margin: 10px auto !important;  /* 居中显示 */
        position: relative !important;  /* 相对定位 */
        left: 0 !important;
        right: 0 !important;
        overflow: visible !important;  /* 防止内容被裁剪 */
        box-sizing: border-box !important;
    }
    
    /* Panel Header 移动端优化 */
    .panel-template .panel-header {
        height: 60px !important;  /* 稍微减小高度 */
        padding: 8px 12px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
    }
    
    /* Panel Body 移动端优化 */
    .panel-template .panel-body {
        height: calc(100% - 60px) !important;
        max-height: 400px !important;
        min-height: 240px !important;
        overflow-y: auto !important;
        padding: 10px !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch;  /* iOS平滑滚动 */
    }
    
    /* AI Chat Panel特殊优化 */
    .gemini-chat-panel,
    .deepseek-chat-panel,
    .lumina-chat-panel,
    .ai-chat-panel {
        width: calc(100vw - 20px) !important;
        height: auto !important;
        min-height: 350px !important;
        max-height: 80vh !important;
    }
    
    .gemini-chat-panel .panel-body,
    .deepseek-chat-panel .panel-body,
    .lumina-chat-panel .panel-body,
    .ai-chat-panel .panel-body {
        height: auto !important;
        min-height: 280px !important;
        max-height: calc(80vh - 60px) !important;
        overflow-y: auto !important;
    }
    
    /* Panel激活时的全屏显示 */
    /* 🔥 2025-11-15: 移除.racing-panel.active和.static-panel.active */
    .panel-template.active {
        position: fixed !important;
        left: 10px !important;
        right: 10px !important;
        top: 60px !important;  /* 避开header */
        width: calc(100vw - 20px) !important;
        height: auto !important;
        max-height: calc(100vh - 80px) !important;
        z-index: 9999 !important;  /* 确保在最上层 */
        overflow-y: auto !important;
        background: var(--bg-primary) !important;  /* 确保背景不透明 */
        border: 2px solid rgba(99, 102, 241, 0.5) !important;  /* 激活状态边框 */
    }
    
    /* 通用Panel内容优化 */
    .panel-template * {
        box-sizing: border-box !important;
    }
    
    /* 图表容器移动端优化 */
    .panel-template .chart-container {
        width: 100% !important;
        height: 100% !important;
        min-height: 200px !important;
        position: relative !important;
        overflow: hidden !important;
    }
    
    /* 按钮和输入框移动端优化 */
    .panel-template button {
        min-height: 44px !important;  /* 触摸友好的按钮大小 */
        font-size: 14px !important;
        padding: 8px 16px !important;
    }
    
    .panel-template input,
    .panel-template textarea {
        min-height: 40px !important;
        font-size: 16px !important;  /* 防止iOS缩放 */
        padding: 8px 12px !important;
    }
}

/* 5. 使用默认滚动条 - 移除自定义样式 */

/* 6. 简单Pin按钮样式 */
.pin-button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pin-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.9);
}

.pin-button.pinned {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.5);
    color: #60a5fa;
}

/* 7. 数据表格样式增强 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-size-sm);
}

.data-table th {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.data-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* 盈亏统计Panel特殊样式 */
.pnl-summary {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pnl-stats {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: space-around;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-label {
    font-size: 11px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 14px;
    font-weight: bold;
}

.stat-value.positive {
    color: #10b981;
}

.stat-value.negative {
    color: #ef4444;
}

/* 7. 侧边栏样式增强 (迁移自generateCoreStyles) */
.sidebar {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* 移动端覆盖桌面端设置 */
@media (max-width: 768px) {
    .sidebar {
        width: 40px !important;  /* 移动端更窄 */
        min-width: 40px !important;
        max-width: 40px !important;
    }
}

.nav-item {
    width: 48px;
    height: 48px;
    margin: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-time) ease;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

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

/* 8. 新闻滚动条样式增强 (迁移自generateCoreStyles) */
.news-ticker-container {
    display: none;
    flex: 1;
    overflow: hidden;
    margin: 0 20px;
}

.news-ticker-container.active {
    display: none; /* 🚨 禁用这个滚动容器系统，使用simple_news.js统一管理 */
}

.news-ticker {
    display: none; /* 🚨 禁用这个滚动系统，使用simple_news.js统一管理 */
    animation: none;
}

@keyframes scroll-left {
    from { transform: translateX(100%); }
    to { transform: translateX(-100%); }
}

.news-item {
    white-space: nowrap;
    padding: 0 30px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.news-item.high-priority {
    color: var(--chart-danger);
    font-weight: 600;
}

.news-item.medium-priority {
    color: var(--chart-warning);
}

/* 9. Header样式增强 (64px固定高度) - 迁移自generateCoreStyles */
.header {
    height: 64px !important;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

/* 10. Logo样式增强 (迁移自generateCoreStyles) */
.logo {
    cursor: pointer;
    transition: transform var(--transition-time) ease;
}

/* 11. 股票输入区域增强 (迁移自generateCoreStyles) */
.center-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* 注销：重复的stock-input定义已移除，统一使用header中的定义 */

.ai-analysis-btn {
    padding: 8px 16px;
    background: var(--chart-primary);
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    transition: all var(--transition-time) ease;
}

.ai-analysis-btn:hover {
    background: var(--chart-primary)dd;
    transform: translateY(-1px);
}

/* ===== 2025-08-09 UI优化 - 按钮交互增强 ===== */

/* 🔮 美学按钮系统增强 */
button, .btn, .ai-analysis-btn, .retry-btn {
    background: var(--accent-primary);
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
    transition: all var(--transition-primary);
    box-shadow: 
        0 4px 16px rgba(99, 102, 241, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    
    /* 光效 */
    background-size: 200% 200%;
}

/* 按钮内部光效 */
button::before, .btn::before, .ai-analysis-btn::before, .retry-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

/* 通用按钮交互 */
button, .btn, .ai-analysis-btn, .retry-btn, .pin-button, .sidebar-item {
    transition: all var(--transition-primary) ease;
    position: relative;
}

/* 💥 点击激活效果 */
button:active, .btn:active, .ai-analysis-btn:active, .retry-btn:active {
    /* transform: translateY(-1px) scale(0.98); - removed hover scale animation */
    box-shadow: 
        0 6px 20px rgba(99, 102, 241, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1),
        inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pin-button:active {
    /* transform: scale(0.95); - removed hover scale animation */
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* 🎆 悬停美学效果 */
button:hover, .btn:hover, .ai-analysis-btn:hover, .retry-btn:hover {
    background: linear-gradient(135deg, #5855f5 0%, #7c3aed 100%);
    /* transform: translateY(-3px) scale(1.02); - removed hover scale animation */
    box-shadow: 
        0 12px 32px rgba(99, 102, 241, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 40px rgba(99, 102, 241, 0.08);
}

button:hover::before, .btn:hover::before, .ai-analysis-btn:hover::before, .retry-btn:hover::before {
    left: 100%;
}

/* 其他按钮悬停效果 */
.pin-button:hover, .mobile-sidebar-control-btn:hover {
    /* transform: translateY(-2px) scale(1.05); - removed hover scale animation */
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.2);
}

/* 波纹效果基础 */
.btn-ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
    pointer-events: none;
}

.btn-ripple:active::after {
    width: 200px;
    height: 200px;
}

/* 加载状态指示器 */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1;
}

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

/* 成功/错误状态反馈 */
.btn-success {
    background: var(--color-success) !important;
    animation: pulse-success 0.6s ease-in-out;
}

.btn-error {
    background: var(--color-danger) !important;
    animation: pulse-error 0.6s ease-in-out;
}

@keyframes pulse-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px var(--color-success); }
    100% { transform: scale(1); }
}

@keyframes pulse-error {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 0 20px var(--color-danger); }
    100% { transform: scale(1); }
}

/* 禁用状态 */
button:disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Panel交互反馈 */
.panel-template:hover {
    /* transform: translateY(-2px); - removed hover scale animation */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-time) ease;
}

.panel-loading {
    position: relative;
}

.panel-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--accent-blue) 50%, 
        transparent 100%);
    animation: loading-bar 1.5s infinite;
}

@keyframes loading-bar {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== 2025-08-09 卡片设计升级系统 ===== */

/* 增强的Panel卡片设计 */
.panel-template {
    /* 美观的渐变背景 */
    background: linear-gradient(135deg, 
        rgba(15, 23, 42, 0.95) 0%, 
        rgba(30, 41, 59, 0.90) 50%, 
        rgba(15, 23, 42, 0.95) 100%) !important;
    
    /* 多层次阴影效果 */
    box-shadow: 
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    
    /* 美观的边框 */
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    
    /* 毛玻璃效果 */
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    
    /* 过渡效果 */
    transition: all var(--transition-time) cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Panel悬停效果升级 */
.panel-template:hover {
    /* 悬停时提升 - removed hover scale animation */
    /* transform: translateY(-4px) scale(1.02) !important; - removed */
    
    /* 增强阴影 */
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(59, 130, 246, 0.2) !important;
    
    /* 边框发光 */
    border-color: rgba(59, 130, 246, 0.3) !important;
}

/* Panel活跃状态 */
.panel-template.active {
    /* 活跃时的蓝色边框发光 */
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.15),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 2px rgba(59, 130, 246, 0.5) !important;
    
    border-color: rgba(59, 130, 246, 0.6) !important;
    /* transform: translateY(-2px) !important; - removed hover scale animation */
}

/* Panel Header 美化 */
.panel-template .panel-header {
    /* 头部渐变 */
    background: linear-gradient(90deg, 
        rgba(255, 255, 255, 0.08) 0%, 
        rgba(255, 255, 255, 0.04) 50%, 
        rgba(255, 255, 255, 0.08) 100%) !important;
    
    /* 美观的底部边框 */
    border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
    
    /* 内阴影效果 */
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.1) !important;
}

/* Panel Body 美化 */
.panel-template .panel-body {
    /* 内容区域背景 */
    background: rgba(255, 255, 255, 0.02) !important;
    
    /* 内容区域的内阴影 */
    box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* 特殊Panel类型的增强 */
/* ❌ 2025-11-15: 已废弃 - racing-panel和institutional-panel主题样式已不再使用 */
/* 游资赛马和机构赛乌龟已统一使用标准panel-template样式 */
/* .panel-template.racing-panel {
    background: linear-gradient(135deg,
        rgba(239, 68, 68, 0.05) 0%,
        rgba(15, 23, 42, 0.95) 30%,
        rgba(15, 23, 42, 0.95) 100%) !important;
}

.panel-template.racing-panel:hover {
    border-color: rgba(239, 68, 68, 0.3) !important;
    box-shadow:
        0 20px 25px -5px rgba(239, 68, 68, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(239, 68, 68, 0.2) !important;
}

.panel-template.institutional-panel {
    background: linear-gradient(135deg,
        rgba(34, 197, 94, 0.05) 0%,
        rgba(15, 23, 42, 0.95) 30%,
        rgba(15, 23, 42, 0.95) 100%) !important;
}

.panel-template.institutional-panel:hover {
    border-color: rgba(34, 197, 94, 0.3) !important;
    box-shadow:
        0 20px 25px -5px rgba(34, 197, 94, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(34, 197, 94, 0.2) !important;
} */

/* AI聊天Panel特殊样式 */
.panel-template.ai-chat-panel,
.panel-template.gemini-chat-panel,
.panel-template.deepseek-chat-panel,
.panel-template.lumina-chat-panel {
    /* AI Panel - 紫色主题 */
    background: linear-gradient(135deg, 
        rgba(147, 51, 234, 0.05) 0%, 
        rgba(15, 23, 42, 0.95) 30%, 
        rgba(15, 23, 42, 0.95) 100%) !important;
}

.ai-chat-panel:hover,
.gemini-chat-panel:hover,
.deepseek-chat-panel:hover,
.lumina-chat-panel:hover {
    border-color: rgba(147, 51, 234, 0.3) !important;
    box-shadow: 
        0 20px 25px -5px rgba(147, 51, 234, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(147, 51, 234, 0.2) !important;
}

/* 移动端Panel优化 */
@media (max-width: 768px) {
    .panel-template {
        /* 移动端阴影减弱 */
        box-shadow: 
            0 2px 4px -1px rgba(0, 0, 0, 0.1),
            0 1px 2px -1px rgba(0, 0, 0, 0.06),
            0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    }
    
    .panel-template:hover {
        /* 移动端悬停效果适中 - removed hover scale animation */
        /* transform: translateY(-2px) scale(1.01) !important; - removed */
        
        box-shadow: 
            0 10px 15px -3px rgba(0, 0, 0, 0.1),
            0 4px 6px -2px rgba(0, 0, 0, 0.05),
            0 0 0 1px rgba(59, 130, 246, 0.2) !important;
    }
}

/* Panel组合效果 */
.panel-template + .panel-template {
    margin-top: var(--spacing-md);
}

/* Panel进入动画 */
@keyframes panelSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.panel-template.panel-entering {
    animation: panelSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Panel装饰元素 */
.panel-template::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    z-index: 1;
}

/* ===== 股票涨跌颜色编码系统 ===== */

/* 涨跌幅基础样式 */
.stock-change {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all var(--transition-fast) ease;
}

/* 上涨样式 */
.stock-up {
    color: var(--stock-up);
    background: var(--stock-up-bg);
}

.stock-up::before {
    content: '▲ ';
    font-size: 0.8em;
}

/* 下跌样式 */
.stock-down {
    color: var(--stock-down);
    background: var(--stock-down-bg);
}

.stock-down::before {
    content: '▼ ';
    font-size: 0.8em;
}

/* 平盘样式 */
.stock-flat {
    color: var(--stock-flat);
    background: var(--stock-flat-bg);
}

.stock-flat::before {
    content: '— ';
    font-size: 0.8em;
}

/* 大号涨跌显示 */
.stock-change-large {
    font-size: 1.1em;
    padding: 4px 8px;
    font-weight: 700;
}

/* 小号涨跌显示 */
.stock-change-small {
    font-size: 0.8em;
    padding: 1px 4px;
}

/* 百分比格式化 */
.percentage {
    font-family: 'Courier New', monospace;
}

.percentage.positive {
    color: var(--stock-up);
}

.percentage.negative {
    color: var(--stock-down);
}

.percentage.zero {
    color: var(--stock-flat);
}

/* 价格显示 */
.price-display {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.price-up {
    color: var(--stock-up);
    animation: price-flash-up 0.3s ease-in-out;
}

.price-down {
    color: var(--stock-down);
    animation: price-flash-down 0.3s ease-in-out;
}

@keyframes price-flash-up {
    0% { background: transparent; }
    50% { background: var(--stock-up-bg); }
    100% { background: transparent; }
}

@keyframes price-flash-down {
    0% { background: transparent; }
    50% { background: var(--stock-down-bg); }
    100% { background: transparent; }
}

/* 成交量变化指示 */
.volume-change {
    font-size: 0.85em;
    opacity: 0.8;
}

.volume-high {
    color: var(--color-warning);
    font-weight: 600;
}

.volume-low {
    color: var(--text-muted);
}

/* 趋势指示器 */
.trend-indicator {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
}

.trend-up {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 6px solid var(--stock-up);
}

.trend-down {
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 6px solid var(--stock-down);
}

.trend-flat {
    border-top: 2px solid var(--stock-flat);
    width: 8px;
}

/* ===== 小型趋势图表系统 ===== */

/* 图表容器基础样式 */
.mini-chart-container {
    display: inline-block;
    vertical-align: middle;
    margin: 2px 4px;
}

.sparkline-container {
    display: inline-block;
    vertical-align: middle;
    margin: 1px 2px;
}

/* 图表和文字的组合显示 */
.chart-with-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-with-text .mini-chart-container {
    flex-shrink: 0;
}

.chart-with-text .chart-text {
    flex: 1;
    font-size: 0.9em;
}

/* 股票行情中的小图表 */
.stock-row {
    display: flex;
    align-items: center;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color var(--transition-fast) ease;
}

.stock-row:hover {
    background-color: var(--bg-panel);
}

.stock-row .stock-symbol {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 80px;
}

.stock-row .stock-price {
    min-width: 60px;
    text-align: right;
}

.stock-row .stock-change {
    min-width: 80px;
    text-align: right;
}

.stock-row .stock-chart {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 8px;
}

/* Panel中的图表网格 */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    padding: 8px;
}

.chart-item {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 8px;
    text-align: center;
    transition: all var(--transition-fast) ease;
}

.chart-item:hover {
    border-color: var(--accent-blue);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
}

.chart-item .chart-title {
    font-size: 0.8em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.chart-item .chart-value {
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 6px;
}

.chart-item .mini-chart-container {
    margin: 0;
}

/* 图表loading状态 */
.chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    color: var(--text-muted);
    font-size: 0.8em;
}

.chart-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--accent-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

/* 图表错误状态 */
.chart-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    color: var(--color-danger);
    font-size: 0.8em;
}

/* 响应式图表 */
@media (max-width: 768px) {
    .chart-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
        padding: 6px;
    }
    
    .chart-item {
        padding: 6px;
    }
    
    .stock-row {
        font-size: 0.9em;
        padding: 4px 6px;
    }
    
    .stock-row .mini-chart-container {
        transform: scale(0.8);
    }
}

/* 图表工具提示 */
.chart-tooltip {
    position: absolute;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.8em;
    color: var(--text-primary);
    pointer-events: none;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.chart-tooltip.visible {
    opacity: 1;
}

/* 12. 访问者统计增强 (迁移自generateCoreStyles) - 已注释以避免与前面的优化样式冲突 */
/* 
原始样式：
.visitor-stats {
    text-align: center;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}
.visitor-count {
    font-size: var(--font-size-lg);  // 这会覆盖我们的10px优化
    font-weight: 600;                // 这会覆盖我们的normal字重
    color: var(--chart-primary);
}

现在使用前面定义的优化样式：10px字体，normal字重，flexbox居中布局
*/

/* 13. 加载动画 (迁移自generateCoreStyles) */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--chart-primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* 14. 报告模态框增强 (迁移自generateCoreStyles) */
.report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.report-content {
    background: rgba(20, 20, 20, 0.95);
    border-radius: 12px;
    max-width: 900px;
    max-height: 90vh;
    overflow: auto;
    padding: 30px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.report-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background var(--transition-time) ease;
}

.report-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 15. 分析报告样式增强 (迁移自generateCoreStyles) */
.analysis-content {
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: #e0e0e0;
}

.analysis-content h1 { 
    font-size: var(--font-size-xxl); 
    margin: 20px 0;
    color: white;
}

.analysis-content h2 { 
    font-size: var(--font-size-xl); 
    margin: 16px 0;
    color: var(--chart-primary);
}

.analysis-content h3 { 
    font-size: var(--font-size-lg); 
    margin: 12px 0;
}

.analysis-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.analysis-content th,
.analysis-content td {
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.analysis-content th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
}

.analysis-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: var(--font-size-sm);
}

.analysis-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 16px;
    border-radius: 6px;
    overflow-x: hidden; /* 🚨 HARD RULE: 가로 스크롤 절대 금지 */
}

/* 16. 统计卡片 (迁移自generateCoreStyles) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 4px 0;
}

.stat-label {
    font-size: var(--font-size-xs);
    opacity: 0.8;
}

.positive { color: var(--chart-success); }
.negative { color: var(--chart-danger); }
.neutral { color: var(--chart-warning); }

/* 报告生成加载提示样式 */
.loading-ticker {
    animation: loadingPulse 2s ease-in-out infinite;
}

@keyframes loadingPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.news-ticker-container.loading-ticker {
    border-left: 3px solid var(--chart-primary);
    background: rgba(99, 102, 241, 0.1);
}

.news-ticker-container.loading-ticker .news-text {
    color: var(--chart-primary);
    font-weight: 500;
}

/* 进度指示器样式 */
.progress-indicator {
    display: inline-block;
    margin-left: 8px;
}

.progress-indicator::after {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 2px solid transparent;
    border-top: 2px solid var(--chart-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 报告生成中状态样式 */
.generating-report {
    border-left: 4px solid var(--chart-primary);
    animation: generatePulse 3s ease-in-out infinite;
}

@keyframes generatePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }
}

.generating-report .analysis-title::after {
    content: ' 🔄';
    animation: spin 2s linear infinite;
}

/* 热门板块流式布局样式 */
.flow-dashboard {
    display: flex;
    gap: 20px;
    height: 100%;
    width: 100%;
}

.flow-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.flow-section h3 {
    margin: 0 0 15px 0;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    color: var(--text-primary);
}

.flow-list {
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
    overflow-y: auto;
}

.flow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

.flow-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(2px);
}

.flow-item-info {
    flex: 1;
    min-width: 0;
}

.flow-item-name {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.flow-item-change {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    margin-left: 8px;
}

.flow-item-change.positive {
    color: var(--chart-success);
}

.flow-item-change.negative {
    color: var(--chart-danger);
}

/* 流式项目淡入动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式优化 */
@media (max-width: 767px) {
    .flow-dashboard {
        gap: 15px;
    }
    
    .flow-section {
        max-height: none; /* 移除高度限制，让内容自然填充panel-body */
    }
    
    .flow-list {
        overflow-y: auto;
    }
}

/* ===== 多选功能面板布局系统 ===== */
/* 多面板容器 - 支持多选功能的网格布局 */
.multi-panel-container {
    display: grid !important;
    gap: 15px !important;
    height: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* 2个面板的网格布局 */
.multi-panel-container.panel-count-2 {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr !important;
}

/* 3个面板的网格布局 */
.multi-panel-container.panel-count-3 {
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: 1fr !important;
}

/* 4个面板的网格布局 - 2x2格式 */
.multi-panel-container.panel-count-4 {
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
}

/* 5个面板的网格布局 - 3x2格式 */
.multi-panel-container.panel-count-5 {
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
}

/* 6个面板的网格布局 - 3x2格式 */
.multi-panel-container.panel-count-6 {
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
}

/* 面板包装器 - 每个独立面板的容器 */
.panel-wrapper {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

/* 面板包装器内的面板模板 */
.panel-wrapper .panel-template {
    width: 100% !important;
    height: 100% !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* 面板包装器内的header */
.panel-wrapper .panel-header {
    flex-shrink: 0 !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* 面板包装器内的body */
.panel-wrapper .panel-body {
    flex: 1 !important;
    background: transparent !important;
    overflow: auto !important;
}

/* AI按钮分析状态样式 - 简洁边框动画 */
#aiStockBtn.analyzing {
    background: var(--chart-primary) !important;
    cursor: not-allowed !important;
    border: 2px solid #6366f1 !important;
    border-radius: 8px !important;
    animation: simpleRotate 1.5s linear infinite;
}

/* 简单旋转边框动画 */
@keyframes simpleRotate {
    0% { 
        border-color: #6366f1;
        transform: rotate(0deg);
    }
    25% { 
        border-color: #8b5cf6;
    }
    50% { 
        border-color: #ec4899;
        transform: rotate(180deg);
    }
    75% { 
        border-color: #10b981;
    }
    100% { 
        border-color: #6366f1;
        transform: rotate(360deg);
    }
}

/* 保留原有的脉冲动画（给其他元素使用） */
@keyframes pulse {
    0% { opacity: 0.8; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* 响应式支持 - 小屏幕下改为单列布局 */
@media (max-width: 768px) {
    .multi-panel-container.panel-count-2,
    .multi-panel-container.panel-count-3,
    .multi-panel-container.panel-count-4,
    .multi-panel-container.panel-count-5,
    .multi-panel-container.panel-count-6 {
        grid-template-columns: 1fr !important;
        grid-template-rows: repeat(auto, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 10px !important;
    }
    
    /* 多面板容器内的Panel优化 */
    .multi-panel-container .panel-wrapper {
        width: 100% !important;
        height: auto !important;
        min-height: 300px !important;
        margin: 0 !important;
    }
    
    .multi-panel-container .panel-template {
        width: 100% !important;
        height: auto !important;
        min-height: 280px !important;
        margin: 0 !important;
    }
}

/* 中等屏幕优化 */
@media (max-width: 1024px) and (min-width: 769px) {
    .multi-panel-container.panel-count-3,
    .multi-panel-container.panel-count-4,
    .multi-panel-container.panel-count-5,
    .multi-panel-container.panel-count-6 {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: repeat(auto, 1fr) !important;
    }
}

/* ===== AI输入框和按钮增强样式 ===== */
#ai-input-container {
    animation: slideInFromRight 0.3s ease-out;
    z-index: 100;
    position: relative;
}

#stock-code-input {
    transition: all 0.3s ease;
    z-index: 101;
    position: relative;
}

#stock-code-input:focus {
    border-color: #6366f1 !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
    background: rgba(26, 32, 46, 1) !important;
}

#stock-code-input::placeholder {
    color: rgba(226, 232, 240, 0.5);
}

/* AI按钮核心样式修复 */
#aiStockBtn {
    position: relative !important;
    z-index: 102 !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    border-radius: 8px !important;
}

#aiStockBtn:hover {
    /* transform: scale(1.05) !important; - removed hover scale animation */
    cursor: pointer !important;
}

/* AI按钮激活状态动画 */
@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes aiActivePulse {
    0% { 
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); 
    }
    50% { 
        box-shadow: 0 0 25px rgba(99, 102, 241, 0.8); 
    }
    100% { 
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.5); 
    }
}

/* AI按钮激活状态 */
#aiStockBtn.ai-active {
    animation: aiActivePulse 2s infinite ease-in-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    #ai-input-container {
        margin-right: 8px;
    }
    
    #stock-code-input {
        width: 100px !important;
        font-size: 13px !important;
    }
}

/* Market Status Panel - 四大指数2x2网格布局 */
.market-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 8px;
    width: 100%;
    height: 100%;
    padding: 8px;
}

/* Market Panel Grid - 确保在所有设备上保持2x2布局 */
.market-panel-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-template-rows: 1fr 1fr !important;
    gap: 10px !important;
    height: 100% !important;
}

.index-chart {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.index-chart .chart-title {
    font-size: 11px;
    color: var(--text-secondary);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.3);
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    flex-shrink: 0;
}

.index-chart .chart-container {
    flex: 1;
    position: relative;
    min-height: 0;
}

/* 响应式：移动端保持2x2布局 */
@media (max-width: 768px) {
    .market-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        gap: 6px;
    }
    
    /* Market Panel Grid - 在移动端也保持2x2布局 */
    .market-panel-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr !important;
        gap: 8px !important;
        height: 100% !important;
    }
    
    .index-chart .chart-title {
        font-size: 12px;
        padding: 6px;
    }
}

/* ========================================
   页面切换动画系统 - Task 7
   ======================================== */

/* 页面切换动画基础样式 */
.page-transition {
    transition: all var(--page-transition-duration) var(--page-transition-ease);
}

/* 淡入淡出效果 */
.fade-enter {
    opacity: var(--fade-opacity-start);
    transform: translateY(var(--panel-slide-distance));
}

.fade-enter-active {
    opacity: var(--fade-opacity-end);
    transform: translateY(0);
}

.fade-exit {
    opacity: var(--fade-opacity-end);
    transform: translateY(0);
}

.fade-exit-active {
    opacity: var(--fade-opacity-start);
    transform: translateY(calc(-1 * var(--panel-slide-distance)));
}

/* Panel切换动画 */
.panel-enter {
    opacity: 0;
    transform: translateX(var(--panel-slide-distance)) scale(0.95);
}

.panel-enter-active {
    opacity: 1;
    transform: translateX(0) scale(1);
    transition: all var(--page-transition-duration) var(--page-transition-ease);
}

.panel-exit {
    opacity: 1;
    transform: translateX(0) scale(1);
}

.panel-exit-active {
    opacity: 0;
    transform: translateX(calc(-1 * var(--panel-slide-distance))) scale(0.95);
    transition: all var(--page-transition-duration) var(--page-transition-ease);
}

/* 侧边栏切换动画 */
.sidebar-slide-enter {
    transform: translateX(-100%);
}

.sidebar-slide-enter-active {
    transform: translateX(0);
    transition: transform var(--page-transition-duration) var(--page-transition-ease);
}

.sidebar-slide-exit {
    transform: translateX(0);
}

.sidebar-slide-exit-active {
    transform: translateX(-100%);
    transition: transform var(--page-transition-duration) var(--page-transition-ease);
}

/* 内容区域加载动画 */
.content-loading {
    position: relative;
    overflow: hidden;
}

.content-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.1), 
        transparent);
    animation: shimmer 1.5s infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

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

/* Panel模态弹出动画 */
.panel-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    backdrop-filter: blur(4px);
    transition: all var(--page-transition-duration) var(--page-transition-ease);
}

.panel-modal-overlay.active {
    opacity: 1;
}

.panel-modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    max-width: 90vw;
    max-height: 90vh;
    transform: scale(0.8) translateY(20px);
    transition: all var(--page-transition-duration) var(--page-transition-ease);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
}

.panel-modal-overlay.active .panel-modal-content {
    transform: scale(1) translateY(0);
}

/* 数据加载状态动画 */
.data-loading {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* 成功/错误状态动画 */
.success-animation {
    animation: successBounce 0.6s ease-out;
}

.error-animation {
    animation: errorShake 0.5s ease-in-out;
}

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

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 响应式页面切换 */
@media (max-width: 768px) {
    :root {
        --page-transition-duration: 0.3s;
        --panel-slide-distance: 15px;
    }

    .panel-modal-content {
        max-width: 95vw;
        max-height: 85vh;
        margin: 20px;
    }
}

/* ================================
   异常涨跌幅标记样式
   ================================ */

/* 异常涨跌幅单元格样式 */
.abnormal-change {
    background: linear-gradient(135deg,
        rgba(255, 152, 0, 0.15) 0%,
        rgba(255, 111, 0, 0.1) 100%) !important;
    border-left: 3px solid #ff9800 !important;
    font-weight: 600;
    position: relative;
    animation: abnormal-pulse 2s ease-in-out infinite;
}

/* 异常值动画效果 */
@keyframes abnormal-pulse {
    0%, 100% {
        box-shadow: inset 0 0 5px rgba(255, 152, 0, 0.2);
    }
    50% {
        box-shadow: inset 0 0 10px rgba(255, 152, 0, 0.4);
    }
}

/* hover时显示更明显的提示 */
.abnormal-change:hover {
    background: linear-gradient(135deg,
        rgba(255, 152, 0, 0.25) 0%,
        rgba(255, 111, 0, 0.2) 100%) !important;
    cursor: help;
    transform: scale(1.02);
    transition: all 0.2s ease;
}

/* =====================================================
   报告生成状态指示器样式 - 固定右上角通知区域
   ===================================================== */
.report-status-indicator {
    position: fixed;
    top: 12px;
    right: 16px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.95) 0%, rgba(25, 30, 45, 0.95) 100%);
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 8px;
    padding: 8px 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(99, 102, 241, 0.2);
    backdrop-filter: blur(10px);
    animation: report-slide-in 0.3s ease-out;
}

@keyframes report-slide-in {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.report-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(99, 102, 241, 0.3);
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: report-spin 1s linear infinite;
}

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

.report-stock-info {
    font-size: 12px;
    font-weight: 600;
    color: #e2e8f0;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.report-status-text {
    font-size: 11px;
    color: #a78bfa;
    animation: report-text-pulse 1.5s ease-in-out infinite;
}

@keyframes report-text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
