/* ================================================================
  合并后的主题与扩展样式
  合并来源: light-theme.css + chart-styles.css + dashboard-animations.css + ai-analyst.css
  生成时间: 2026-03-27 | 减少 4 个 HTTP 请求
  ================================================================ */


/* ===== Light Theme (light-theme.css) ===== */
/* ========================================
   浅色主题样式 - 仅当 data-theme="light" 时生效
   ======================================== */

/* 1. 根变量覆盖 - 仅在data-theme="light"时生效 */
[data-theme="light"] {
    /* 文字颜色 */
    --txt: #1f2937;
    --txt2: #6b7280;
    --txt3: #9ca3af;

    /* 背景 - 使用更亮的浅色渐变，与深色主题形成对比 */
    --bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    --bg-solid: #f8fafc;
    --bg-alt: #e2e8f0;

    /* 玻璃态 - 浅色主题使用白色玻璃效果 */
    --gla: rgba(255, 255, 255, 0.85);
    --gla2: rgba(139, 92, 246, 0.06);
    --gbr: rgba(139, 92, 246, 0.12);
    --gsh: 0 8px 32px rgba(139, 92, 246, 0.08);
    --gbl: blur(16px);

    /* 卡片 - 白色卡片配浅色阴影 */
    --card-bg: rgba(255, 255, 255, 0.92);
    --card-border: rgba(139, 92, 246, 0.15);
    --card-shadow: 0 4px 24px rgba(139, 92, 246, 0.06);

    /* 下拉菜单 */
    --dd: rgba(255, 255, 255, 0.98);
    --dd-border: rgba(139, 92, 246, 0.12);
    --dd-shadow: 0 12px 40px rgba(139, 92, 246, 0.12);

    /* 表格 */
    --tb: rgba(255, 255, 255, 0.95);
    --tb-header: rgba(139, 92, 246, 0.06);
    --tb-row: rgba(255, 255, 255, 0.7);
    --tb-row-alt: rgba(139, 92, 246, 0.02);
    --tb-border: rgba(139, 92, 246, 0.08);

    /* 输入框 */
    --ib: rgba(255, 255, 255, 0.9);
    --ib-border: rgba(139, 92, 246, 0.2);
    --ib-focus: rgba(139, 92, 246, 0.25);

    /* 悬浮 */
    --rh: rgba(139, 92, 246, 0.08);

    /* 主题切换 */
    --tc-bg: rgba(255, 255, 255, 0.9);
    --tc-border: rgba(139, 92, 246, 0.15);

    color-scheme: light;
}

/* 2. 页面背景 - 浅色主题使用浅色背景 */
[data-theme="light"] body {
    background: var(--bg) !important;
    min-height: 100vh;
}

/* 3. 深色主题背景 - 明确确保使用V8版本的深色渐变 */
/* 由于浅色主题覆盖了--bg变量，需要在非浅色主题下恢复深色背景 */
html:not([data-theme="light"]) body {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%) !important;
}

/* 3. 页面加载器 */
[data-theme="light"] .page-loader {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
}

[data-theme="light"] .loader-text {
    color: var(--txt);
}

/* 4. 头部导航 */
[data-theme="light"] .header {
    background: var(--gla);
    border-bottom: 1px solid var(--gbr);
    backdrop-filter: var(--gbl);
}

[data-theme="light"] .header h1 {
    color: var(--txt);
    text-shadow: none;
}

/* 5. 时间徽章 */
[data-theme="light"] .time-badge {
    background: var(--gla);
    border: 1px solid var(--gbr);
    color: var(--txt);
}

[data-theme="light"] .time-dot {
    background: var(--primary);
    box-shadow: 0 0 8px var(--primary);
}

/* 6. 数据变化提示 */
[data-theme="light"] .data-change {
    background: var(--gla);
    border: 1px solid var(--gbr);
}

[data-theme="light"] .data-change .change-added {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

[data-theme="light"] .data-change .change-removed {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

/* 7. 下拉菜单 */
[data-theme="light"] .refresh-dropdown .dropdown-menu {
    background: var(--dd);
    border: 1px solid var(--dd-border);
    box-shadow: var(--dd-shadow);
}

[data-theme="light"] .refresh-dropdown .dropdown-item {
    color: var(--txt);
}

[data-theme="light"] .refresh-dropdown .dropdown-item:hover {
    background: var(--rh);
}

[data-theme="light"] .refresh-dropdown .dropdown-item.selected {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

/* 8. 按钮 */
[data-theme="light"] .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pl) 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

[data-theme="light"] .btn-primary:hover {
    background: linear-gradient(135deg, var(--pl) 0%, var(--primary) 100%);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

[data-theme="light"] .btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

[data-theme="light"] .dropdown-trigger {
    background: var(--gla);
    border: 1px solid var(--gbr);
    color: var(--txt);
}

[data-theme="light"] .dropdown-trigger:hover {
    background: var(--gla2);
    border-color: var(--primary);
}

/* 9. 统计卡片 */
[data-theme="light"] .stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .stat-label {
    color: var(--txt2);
}

[data-theme="light"] .stat-num-big {
    color: var(--primary);
    text-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
}

[data-theme="light"] .stat-sub {
    color: var(--txt3);
}

/* 10. 排行榜 */
[data-theme="light"] .ranking-list {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
}

[data-theme="light"] .ranking-item {
    border-bottom: 1px solid var(--tb-border);
}

[data-theme="light"] .ranking-item:hover {
    background: var(--rh);
}

[data-theme="light"] .rank-badge {
    background: linear-gradient(135deg, var(--primary) 0%, var(--pl) 100%);
    color: white;
}

[data-theme="light"] .rank-name {
    color: var(--txt);
}

[data-theme="light"] .rank-amount {
    color: var(--primary);
}

/* 11. 玻璃卡片 */
[data-theme="light"] .glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .section-title {
    color: var(--txt);
    border-bottom: 2px solid var(--primary);
}

/* 12. 图表容器 */
[data-theme="light"] .chart-wrapper {
    background: rgba(139, 92, 246, 0.03);
    border-radius: 12px;
    padding: 16px;
}

/* 13. 环形图 */
[data-theme="light"] .chart-legend-item {
    background: rgba(139, 92, 246, 0.03);
}

[data-theme="light"] .chart-legend-item:hover {
    background: var(--rh);
}

[data-theme="light"] .legend-value {
    color: var(--primary);
}

/* 14. 表格 */
[data-theme="light"] .data-table {
    background: var(--tb);
    border: 1px solid var(--tb-border);
}

[data-theme="light"] .data-table thead {
    background: var(--tb-header);
}

[data-theme="light"] .data-table th {
    color: var(--primary);
    border-bottom: 2px solid var(--primary);
}

[data-theme="light"] .data-table td {
    color: var(--txt);
    border-bottom: 1px solid var(--tb-border);
}

[data-theme="light"] .data-table tbody tr {
    background: var(--tb-row);
}

[data-theme="light"] .data-table tbody tr:nth-child(even) {
    background: var(--tb-row-alt);
}

[data-theme="light"] .data-table tbody tr:hover {
    background: var(--rh);
}

/* 14.1 统计卡片内嵌表格 */
[data-theme="light"] .recharge-table th {
    color: var(--txt3);
    border-bottom: 1px solid var(--tb-border);
    font-weight: 400;
}
[data-theme="light"] .recharge-table td {
    color: var(--txt2);
}
[data-theme="light"] .recharge-table .agent-cell {
    color: var(--txt);
}
[data-theme="light"] .recharge-table .amount-cell {
    color: var(--primary);
    font-weight: 600;
}

/* 15. 筛选栏 */
[data-theme="light"] .filter-bar {
    background: var(--gla);
    border: 1px solid var(--gbr);
}

[data-theme="light"] .filter-label {
    color: var(--txt2);
}

[data-theme="light"] .filter-input {
    background: var(--ib);
    border: 1px solid var(--ib-border);
    color: var(--txt);
}

[data-theme="light"] .filter-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

[data-theme="light"] .filter-input::placeholder {
    color: var(--txt3);
}

[data-theme="light"] .multi-select-trigger {
    background: var(--ib);
    border: 1px solid var(--ib-border);
    color: var(--txt);
}

[data-theme="light"] .multi-select-trigger:hover {
    border-color: var(--primary);
}

[data-theme="light"] .multi-select-dropdown {
    background: var(--dd);
    border: 1px solid var(--dd-border);
    box-shadow: var(--dd-shadow);
}

[data-theme="light"] .multi-select-option {
    color: var(--txt);
}

[data-theme="light"] .multi-select-option:hover {
    background: var(--rh);
}

[data-theme="light"] .multi-select-option.selected {
    background: rgba(139, 92, 246, 0.1);
    color: var(--primary);
}

[data-theme="light"] .btn-reset {
    background: transparent;
    border: 1px solid var(--gbr);
    color: var(--txt2);
}

[data-theme="light"] .btn-reset:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #dc2626;
}

/* 16. 分页 */
[data-theme="light"] .pagination {
    background: var(--gla);
    border: 1px solid var(--gbr);
}

[data-theme="light"] .pagination button {
    background: transparent;
    border: 1px solid var(--gbr);
    color: var(--txt);
}

[data-theme="light"] .pagination button:hover:not(:disabled) {
    background: var(--rh);
    border-color: var(--primary);
    color: var(--primary);
}

[data-theme="light"] .pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

[data-theme="light"] .pagination button:disabled {
    opacity: 0.4;
}

/* 17. Toast提示 - 右对齐 */
[data-theme="light"] .toast {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--gbr);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    color: var(--txt);
}

[data-theme="light"] .toast.success {
    border-left: 4px solid #10b981;
}

[data-theme="light"] .toast.error {
    border-left: 4px solid #ef4444;
}

[data-theme="light"] .toast.warning {
    border-left: 4px solid #f59e0b;
}

[data-theme="light"] .toast.info {
    border-left: 4px solid var(--primary);
}

/* 18. 加载遮罩 */
[data-theme="light"] .loading-overlay {
    background: rgba(248, 250, 252, 0.9);
}

[data-theme="light"] .loading-text {
    color: var(--txt);
}

/* 19. 悬浮导航 */
[data-theme="light"] .float-nav {
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

[data-theme="light"] .float-nav-item {
    color: var(--txt2);
}

[data-theme="light"] .float-nav-item:hover {
    background: var(--rh);
    color: var(--primary);
}

[data-theme="light"] .float-nav-item.active {
    background: var(--primary);
    color: white;
}

[data-theme="light"] .float-nav-tooltip {
    background: var(--txt);
    color: white;
}

[data-theme="light"] .float-nav-tooltip::before {
    border-color: transparent var(--txt) transparent transparent;
}

/* 20. 键盘快捷键弹窗 */
[data-theme="light"] .shortcuts-help {
    background: rgba(248, 250, 252, 0.95);
}

[data-theme="light"] .shortcuts-content {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: var(--card-shadow);
}

[data-theme="light"] .shortcuts-content h3 {
    color: var(--txt);
}

[data-theme="light"] .shortcut-item span {
    color: var(--txt2);
}

[data-theme="light"] kbd {
    background: var(--gla);
    border: 1px solid var(--gbr);
    color: var(--txt);
}

/* 21. PWA安装提示 */
[data-theme="light"] .pwa-install-prompt {
    background: var(--gla);
    border: 1px solid var(--gbr);
}

/* 22. 表格内嵌排行榜 */
[data-theme="light"] .recharge-table {
    background: transparent;
}

[data-theme="light"] .recharge-table th {
    color: var(--txt2);
    border-bottom: 1px solid var(--tb-border);
}

[data-theme="light"] .recharge-table td {
    color: var(--txt);
    border-bottom: 1px solid var(--tb-border);
}

[data-theme="light"] .recharge-table tbody tr:hover {
    background: var(--rh);
}

/* 23. 背景粒子效果 - 浅色主题降低透明度 */
[data-theme="light"] .particle {
    background: rgba(139, 92, 246, 0.15);
}

[data-theme="light"] .bubble {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.1);
}

/* 24. 主题切换按钮 */
[data-theme="light"] .theme-toggle {
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
}

[data-theme="light"] .theme-btn {
    color: var(--txt2);
}

[data-theme="light"] .theme-btn:hover {
    background: var(--gla2);
    color: var(--primary);
}

[data-theme="light"] .theme-btn.active {
    background: var(--primary);
    color: white;
}

/* ========================================
   主题切换动画
   ======================================== */

/* 主题切换时的平滑过渡 */
body.theme-transitioning * {
    transition: 
        background-color 0.3s ease,
        border-color 0.3s ease,
        color 0.3s ease,
        box-shadow 0.3s ease !important;
}

/* 卡片入场动画 - 浅色主题优化 */
@keyframes fadeSlideUpLight {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

[data-theme="light"] .page-enter {
    animation: fadeSlideUpLight 0.5s ease forwards;
}

/* 悬浮导航展开动画 */
@keyframes floatNavPulseLight {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(139, 92, 246, 0.1);
    }
    50% {
        box-shadow: 0 8px 32px rgba(139, 92, 246, 0.2);
    }
}

[data-theme="light"] .float-nav:hover {
    animation: floatNavPulseLight 2s ease-in-out infinite;
}

/* 按钮点击涟漪效果 */
@keyframes rippleLight {
    0% {
        transform: scale(0);
        opacity: 0.6;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Toast滑入动画 */
@keyframes toastSlideInLight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

[data-theme="light"] .toast.show {
    animation: toastSlideInLight 0.3s ease forwards;
}

/* 下拉菜单展开动画 */
@keyframes dropdownExpandLight {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

[data-theme="light"] .dropdown-menu.show,
[data-theme="light"] .multi-select-dropdown.show {
    animation: dropdownExpandLight 0.2s ease forwards;
}

/* 统计数字跳动动画 - 浅色主题 */
@keyframes numberBounceLight {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

[data-theme="light"] .stat-num-big.updating {
    animation: numberBounceLight 0.4s ease;
}

/* 排行榜更新高亮 */
@keyframes rankHighlightLight {
    0% {
        background: rgba(139, 92, 246, 0.2);
    }
    100% {
        background: transparent;
    }
}

[data-theme="light"] .ranking-item.highlight {
    animation: rankHighlightLight 1s ease forwards;
}

/* 表格行更新高亮 */
@keyframes rowFlashLight {
    0% {
        background: rgba(139, 92, 246, 0.15);
    }
    100% {
        background: var(--tb-row);
    }
}

[data-theme="light"] .data-table tbody tr.updated {
    animation: rowFlashLight 1s ease forwards;
}

/* 加载旋转动画 - 浅色主题 */
@keyframes spinLight {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

[data-theme="light"] .loading-spinner {
    border: 3px solid var(--gbr);
    border-top-color: var(--primary);
    animation: spinLight 0.8s linear infinite;
}

/* 页面加载器旋转动画 */
@keyframes loaderSpinLight {
    from {
        transform: rotate(0deg);
        border-top-color: var(--primary);
        border-right-color: var(--primary);
    }
    25% {
        border-top-color: var(--primary);
        border-right-color: transparent;
    }
    50% {
        border-top-color: transparent;
        border-right-color: transparent;
        border-bottom-color: var(--pl);
    }
    75% {
        border-top-color: transparent;
        border-right-color: transparent;
        border-bottom-color: transparent;
        border-left-color: var(--sec);
    }
    to {
        transform: rotate(360deg);
        border-top-color: var(--primary);
        border-right-color: var(--primary);
        border-bottom-color: transparent;
        border-left-color: transparent;
    }
}

[data-theme="light"] .loader-spinner {
    animation: loaderSpinLight 1s ease-in-out infinite;
}

/* ========================================
   浅色主题响应式优化
   ======================================== */

@media (prefers-color-scheme: light) {
    /* 系统浅色模式下的默认样式 */
    html:not([data-theme]) {
        --txt: #1f2937;
        --txt2: #6b7280;
        --txt3: #9ca3af;
        --bg: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    }
}

@media (max-width: 768px) and (prefers-color-scheme: light) {
    [data-theme="light"] .header {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 16px;
    }

    [data-theme="light"] .float-nav {
        bottom: 20px;
        right: 20px;
        padding: 6px;
        gap: 4px;
    }

    [data-theme="light"] .float-nav-item {
        width: 44px;
        height: 44px;
    }

    [data-theme="light"] .stat-card {
        padding: 16px;
    }

    [data-theme="light"] .filter-bar {
        padding: 12px;
    }
}

/* ========================================
   浅色主题无障碍性增强
   ======================================== */

[data-theme="light"] *:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

[data-theme="light"] .btn-primary:focus-visible {
    outline-offset: 4px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    [data-theme="light"] {
        --txt: #000000;
        --txt2: #333333;
        --gbr: rgba(0, 0, 0, 0.3);
        --card-border: rgba(0, 0, 0, 0.3);
    }

    [data-theme="light"] .data-table {
        border: 2px solid #000;
    }

    [data-theme="light"] .data-table th,
    [data-theme="light"] .data-table td {
        border: 1px solid #000;
    }
}

/* 减少动画偏好支持 */
@media (prefers-reduced-motion: reduce) {
    [data-theme="light"] .page-enter,
    [data-theme="light"] .toast.show,
    [data-theme="light"] .dropdown-menu.show,
    [data-theme="light"] .loading-spinner,
    [data-theme="light"] .loader-spinner {
        animation: none;
    }

    [data-theme="light"] * {
        transition-duration: 0.01ms !important;
    }
}


/* ===== Chart.js Styles (chart-styles.css) ===== */
/* ========== Chart.js图表样式 ========== */

/* 图表容器 */
.chart-container {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 10px;
}

/* 迷你图表容器 */
.sparkline-container {
    position: relative;
    width: 100%;
    height: 60px;
    margin-top: 8px;
}

/* 图表卡片 */
.chart-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 16px;
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.chart-card:hover {
    border-color: rgba(139, 92, 246, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

/* 图表标题 */
.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title .chart-icon {
    font-size: 18px;
}

/* 图表统计信息 */
.chart-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.chart-stat {
    flex: 1;
    text-align: center;
    position: relative;
}

/* 趋势图标样式 */
.chart-stat .trend-icon {
    position: absolute;
    bottom: -4px;
    right: 8px;
    font-size: 14px;
    opacity: 0.6;
    transition: all 0.3s ease;
}

.chart-stat:hover .trend-icon {
    opacity: 1;
    transform: translateY(-2px);
}

.chart-stat-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.chart-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.chart-stat-value.up {
    color: #10b981;
}

.chart-stat-value.down {
    color: #ef4444;
}

/* 日活趋势图容器 */
.daily-active-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeInUp 0.6s ease-out;
}

.daily-active-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.daily-active-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-active-title::before {
    content: '📊';
}

.daily-active-controls {
    display: flex;
    gap: 8px;
}

.daily-active-btn {
    padding: 6px 14px;
    background: var(--ib);
    border: 1px solid var(--gbr);
    border-radius: var(--rsm);
    color: var(--txt);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.daily-active-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.daily-active-btn:hover::before {
    width: 300px;
    height: 300px;
}

.daily-active-btn:hover {
    background: var(--rh);
    border-color: var(--primary);
    color: var(--txt);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.daily-active-btn.active {
    background: rgba(139, 92, 246, 0.15);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.3);
}

.daily-active-btn:active {
    transform: translateY(0);
}

.daily-active-chart-wrapper {
    position: relative;
    height: 300px;
    margin-top: 16px;
}

/* 卡片内迷你图表增强 */
.stat-card-chart-wrapper {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 16px 16px;
    pointer-events: none;
}

.stat-card-chart-wrapper canvas {
    width: 100%;
    height: 100%;
}

/* 时间序列图表 */
.time-series-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.time-series-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.time-series-title {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-series-title::before {
    content: '📈';
}

/* 图表加载动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 图表加载状态 */
.chart-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.chart-loading-spinner {
    width: 30px;
    height: 30px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 图表空状态 */
.chart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.chart-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

/* 响应式 */
@media (max-width: 768px) {
    .daily-active-chart-wrapper,
    .time-series-chart-wrapper {
        height: 250px;
    }

    .chart-stats {
        flex-wrap: wrap;
        gap: 12px;
    }

    .chart-stat {
        flex: 1 1 calc(50% - 6px);
    }
}

/* 浅色主题适配 */
[data-theme="light"] .chart-card {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .chart-card:hover {
    border-color: rgba(139, 92, 246, 0.4);
}

[data-theme="light"] .chart-title {
    color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .chart-stat-label {
    color: rgba(0, 0, 0, 0.5);
}

[data-theme="light"] .chart-stat-value {
    color: rgba(0, 0, 0, 0.95);
}

[data-theme="light"] .daily-active-section,
[data-theme="light"] .time-series-section {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .daily-active-title,
[data-theme="light"] .time-series-title {
    color: rgba(0, 0, 0, 0.95);
}


/* ===== Dashboard Animations (dashboard-animations.css) ===== */
/* ========== 看板动画优化 ========== */

/* 卡片悬停效果增强 */
.stat-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.05),
        transparent
    );
    transition: left 0.6s ease;
    pointer-events: none;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

/* 角色代理卡片特殊效果 */
.role-agents-card:hover {
    box-shadow: 0 12px 40px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.3);
}

/* 充值金额卡片特殊效果 */
.recharge-amount-card:hover {
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
}

/* 物品记录卡片特殊效果 */
.item-top-card:hover {
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
}

/* 日活统计卡片特殊效果 */
.daily-active-card:hover {
    box-shadow: 0 12px 40px rgba(6, 182, 212, 0.2);
    border-color: rgba(6, 182, 212, 0.3);
}

/* 统计数值动画 */
.stat-num-big {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat-card .stat-num-big {
    transform: scale(1);
}

/* 趋势图标动画 */
.trend-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.stat-card:hover .trend-icon {
    transform: scale(1.2) rotate(-5deg);
}

/* 图表容器动画 */
.chart-wrapper,
.daily-active-section {
    transition: all 0.3s ease;
    position: relative;
}

.chart-wrapper:hover,
.daily-active-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* 图表加载动画 */
.chart-wrapper canvas,
.daily-active-section canvas {
    animation: chartFadeIn 0.8s ease-out;
}

@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 按钮交互增强 */
.daily-active-btn {
    position: relative;
    overflow: hidden;
}

.daily-active-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.daily-active-btn:hover::after {
    width: 200px;
    height: 200px;
}

.daily-active-btn.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(139, 92, 246, 0);
    }
}

/* 统计卡片数字滚动动画 */
@keyframes numberCountUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-num-big.counting {
    animation: numberCountUp 0.5s ease-out;
}

/* 迷你图表悬停效果 */
.sparkline-container:hover canvas {
    opacity: 0.8;
    transform: scale(1.02);
}

/* 图表工具提示动画 */
canvas {
    cursor: pointer;
}

/* 页面入场动画 */
.page-enter {
    animation: fadeInUp 0.6s ease-out forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.2s;
}

.delay-3 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 玻璃卡片悬停效果 */
.glass-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.15);
}

/* 排行榜卡片悬停 */
.ranking-compact .ranking-item {
    transition: all 0.2s ease;
    cursor: pointer;
}

.ranking-compact .ranking-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(4px);
}

/* 表格行悬停 */
.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* 筛选按钮动画 */
.btn-reset {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-reset:active {
    transform: translateY(0);
}

/* 多选下拉动画 */
.multi-select-options {
    animation: dropdownFadeIn 0.2s ease-out;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 视图切换按钮动画 */
.view-btn {
    transition: all 0.2s ease;
}

.view-btn:hover {
    transform: translateY(-2px);
}

.view-btn.active {
    animation: activePulse 0.3s ease-out;
}

@keyframes activePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Toast通知动画 */
.toast {
    animation: toastSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.hide {
    animation: toastSlideOut 0.3s ease-out forwards;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(120%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(120%);
    }
}

/* 加载动画优化 */
.loader-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 数据更新闪烁效果 */
@keyframes dataUpdateFlash {
    0% {
        background: rgba(139, 92, 246, 0.3);
    }
    100% {
        background: transparent;
    }
}

.data-updating {
    animation: dataUpdateFlash 0.5s ease-out;
}

/* 响应式动画优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 浅色主题适配 */
[data-theme="light"] .stat-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .glass-card:hover {
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1);
}

/* ========== 日活对比动画样式 ========== */
.active-compare {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(5px);
}

.active-compare.visible {
    opacity: 1;
    transform: translateY(0);
}

.active-compare.up {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.1));
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.active-compare.down {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(220, 38, 38, 0.1));
    color: #ef4444;
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.active-compare.neutral {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.2), rgba(75, 85, 99, 0.1));
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.3);
}

.compare-arrow {
    font-size: 14px;
    animation: arrowBounce 1s ease-in-out infinite;
}

.active-compare.up .compare-arrow {
    animation: arrowUp 0.6s ease-in-out infinite;
}

.active-compare.down .compare-arrow {
    animation: arrowDown 0.6s ease-in-out infinite;
}

.compare-value {
    font-size: 13px;
}

@keyframes arrowUp {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes arrowDown {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(2px); }
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-1px); }
}

/* 对比数字动画 */
.compare-value.animating {
    animation: comparePopIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes comparePopIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========== 日活趋势图优化 ========== */
.daily-active-section {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(6, 182, 212, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
}

.daily-active-section:hover {
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.15);
}

.daily-active-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.daily-active-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--txt1);
    display: flex;
    align-items: center;
    gap: 8px;
}

.daily-active-title::before {
    content: '📊';
    font-size: 20px;
}

.daily-active-controls {
    display: flex;
    gap: 8px;
}

.daily-active-btn {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
    color: var(--txt2);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.daily-active-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--txt1);
    transform: translateY(-1px);
}

.daily-active-btn.active {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* 统计数字动画 */
.stat-value.pulse {
    animation: statPulse 0.5s ease-out;
}

@keyframes statPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); color: #8b5cf6; }
    100% { transform: scale(1); }
}

.daily-active-chart-wrapper {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 16px;
    margin-top: 12px;
}

.chart-container {
    position: relative;
    height: 280px;
}

.chart-container canvas {
    animation: chartDrawIn 1s ease-out;
}

@keyframes chartDrawIn {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 趋势统计卡片 */
.trend-stats {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.trend-stat-card {
    flex: 1;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 12px 16px;
    text-align: center;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.trend-stat-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.trend-stat-card .stat-label {
    font-size: 11px;
    color: var(--txt3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.trend-stat-card .stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--txt1);
}

.trend-stat-card.total .stat-value {
    color: #8b5cf6;
}

.trend-stat-card.avg .stat-value {
    color: #06b6d4;
}

.trend-stat-card.max .stat-value {
    color: #10b981;
}

/* 无数据提示 */
.no-history-data {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--txt3);
    font-size: 14px;
}


/* ===== AI Analyst Styles (ai-analyst.css) ===== */
/* ========== AI 数据分析面板样式 ========== */

/* 悬浮按钮 - 右侧悬浮 */
.ai-float-btn {
    position: fixed;
    bottom: 140px;
    right: 20px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    font-size: 22px;
    cursor: pointer;
    z-index: 9990;
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: ai-float-pulse 3s ease-in-out infinite;
}

.ai-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(139, 92, 246, 0.7);
}

.ai-float-btn.ai-float-active {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    animation: none;
    transform: scale(1.05) rotate(10deg);
}

@keyframes ai-float-pulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5); }
    50% { box-shadow: 0 4px 30px rgba(139, 92, 246, 0.8), 0 0 0 8px rgba(139, 92, 246, 0.1); }
}

/* 面板容器 - 靠右显示，空出导航栏宽度 */
.ai-panel-container {
    position: fixed;
    bottom: 200px;  /* 悬浮按钮 bottom:140px + 按钮高度52px + 间距8px */
    right: 90px;    /* 空出导航栏宽度（约70px） */
    width: 380px;
    max-height: 600px;
    background: var(--card-bg, rgba(15, 15, 30, 0.97));
    backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    z-index: 9989;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.1);
    overflow: hidden;
    transform-origin: bottom right;
}

.ai-panel-enter {
    animation: ai-panel-open 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ai-panel-open {
    from { opacity: 0; transform: scale(0.8) translateY(20px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* 面板头部 */
.ai-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.05));
}

.ai-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--txt1, #e2e8f0);
}

.ai-icon {
    font-size: 18px;
    animation: ai-spin 4s linear infinite;
}

@keyframes ai-spin {
    0%, 90%, 100% { transform: rotate(0deg); }
    95% { transform: rotate(15deg); }
}

.ai-badge {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.ai-panel-actions {
    display: flex;
    gap: 4px;
}

.ai-btn-icon {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--txt2, #94a3b8);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-btn-icon:hover {
    background: rgba(139, 92, 246, 0.2);
    color: var(--txt1, #e2e8f0);
}

/* 快捷问题区 */
.ai-quick-questions {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.ai-quick-title {
    font-size: 11px;
    color: var(--txt3, #64748b);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ai-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ai-quick-btn {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.08);
    color: var(--txt2, #94a3b8);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.ai-quick-btn:hover {
    border-color: rgba(139, 92, 246, 0.6);
    background: rgba(139, 92, 246, 0.2);
    color: var(--txt1, #e2e8f0);
    transform: translateY(-1px);
}

/* 对话区 */
.ai-chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 200px;
    max-height: 320px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.ai-chat-area::-webkit-scrollbar { width: 4px; }
.ai-chat-area::-webkit-scrollbar-track { background: transparent; }
.ai-chat-area::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 4px; }

/* 消息行 */
.ai-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    animation: ai-msg-in 0.3s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

/* 用户消息延迟入场，AI消息即时 */
.ai-msg-row-user {
    flex-direction: row-reverse;
    animation-delay: 0.05s;
}

@keyframes ai-msg-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* 思考中气泡入场 */
.ai-msg-row-assistant:not(.ai-msg-row-user) {
    animation: ai-msg-in 0.2s ease-out both;
}

.ai-avatar {
    width: 28px;
    height: 28px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.15);
}

.ai-avatar-user {
    background: rgba(99, 102, 241, 0.15);
}

/* 气泡 */
.ai-msg-bubble {
    max-width: 82%;
    padding: 10px 13px;
    border-radius: 16px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--txt1, #e2e8f0);
}

.ai-msg-assistant {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-bottom-left-radius: 4px;
}

.ai-msg-user {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(99, 102, 241, 0.25));
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-bottom-right-radius: 4px;
}

/* 欢迎消息 */
.ai-welcome-msg {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

/* 思考动画 */
.ai-thinking {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
}

.ai-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(139, 92, 246, 0.7);
    animation: ai-dot-bounce 1.2s ease-in-out infinite;
}

.ai-dot:nth-child(1) { animation-delay: 0s; }
.ai-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-dot:nth-child(3) { animation-delay: 0.4s; }

/* 流式输出 - 打字机光标 */
@keyframes ai-cursor-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.ai-streaming::after {
    content: '▋';
    display: inline-block;
    margin-left: 2px;
    animation: ai-cursor-blink 0.8s ease-in-out infinite;
    color: rgba(139, 92, 246, 0.7);
}

.ai-streaming:not(:empty)::after {
    content: '▋';
}

@keyframes ai-dot-bounce {
    0%, 80%, 100% { transform: scale(0.7); opacity: 0.5; }
    40% { transform: scale(1.1); opacity: 1; }
}

/* 输入区 */
.ai-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 14px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.1);
}

.ai-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    color: var(--txt1, #e2e8f0);
    font-size: 13px;
    padding: 8px 12px;
    resize: none;
    font-family: inherit;
    transition: border-color 0.2s;
    line-height: 1.5;
}

.ai-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
    background: rgba(255, 255, 255, 0.07);
}

.ai-input::placeholder { color: var(--txt3, #64748b); }

.ai-send-btn {
    width: 40px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.5);
}

.ai-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 设置弹窗 ========== */
.ai-settings-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.ai-settings-content {
    background: var(--card-bg, rgba(15, 15, 30, 0.99));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    width: 380px;
    max-width: 90vw;
    overflow: hidden;
    animation: ai-panel-open 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ai-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-settings-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--txt1, #e2e8f0);
    margin: 0;
}

.ai-settings-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ai-settings-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-settings-row label {
    font-size: 12px;
    color: var(--txt3, #64748b);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ai-settings-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--txt1, #e2e8f0);
    font-size: 13px;
    padding: 10px 12px;
    width: 100%;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-family: monospace;
}

.ai-settings-input:focus {
    outline: none;
    border-color: rgba(139, 92, 246, 0.5);
}

.ai-toggle-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-mode-label {
    font-size: 13px;
    color: var(--txt2, #94a3b8);
}

/* 开关样式 */
.ai-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.ai-toggle-switch input { opacity: 0; width: 0; height: 0; }

.ai-toggle-slider {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    cursor: pointer;
    transition: 0.3s;
}

.ai-toggle-slider:before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    top: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.ai-toggle-switch input:checked + .ai-toggle-slider {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
}

.ai-toggle-switch input:checked + .ai-toggle-slider:before {
    transform: translateX(20px);
}

.ai-api-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-settings-footer {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    justify-content: flex-end;
}

/* 浮动导航中的AI按钮 */
.float-nav .ai-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 8px;
    border-radius: 12px;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.float-nav .ai-nav-btn:hover {
    background: rgba(139, 92, 246, 0.15);
}

/* 浅色主题适配 */
[data-theme="light"] .ai-panel-container {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .ai-msg-assistant {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.15);
    color: #1e293b;
}

[data-theme="light"] .ai-msg-user {
    color: #1e293b;
}

[data-theme="light"] .ai-input {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.2);
    color: #1e293b;
}

[data-theme="light"] .ai-input:focus {
    border-color: rgba(139, 92, 246, 0.5);
}

[data-theme="light"] .ai-panel-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(99, 102, 241, 0.03));
}

[data-theme="light"] .ai-settings-content {
    background: rgba(248, 250, 252, 0.99);
}

[data-theme="light"] .ai-settings-input {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.2);
    color: #1e293b;
}

/* 移动端适配 */
@media (max-width: 520px) {
    .ai-panel-container {
        right: 0;
        left: 0;
        bottom: 0;
        width: 100vw;
        max-height: 85vh;
        border-radius: 20px 20px 0 0;
        transform-origin: bottom center;
    }

    .ai-panel-enter {
        animation: ai-panel-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    }

    @keyframes ai-panel-slide-up {
        from { opacity: 0; transform: translateY(100%); }
        to   { opacity: 1; transform: translateY(0); }
    }

    .ai-float-btn {
        bottom: 90px;
        right: 14px;
        width: 46px;
        height: 46px;
        font-size: 20px;
    }

    .ai-panel-header { padding: 12px 14px 8px; }
    .ai-quick-questions { padding: 8px 12px; }
    .ai-chat-area { padding: 10px 12px; max-height: 260px; }
    .ai-input-area { padding: 10px 12px 12px; }
    .ai-input { font-size: 15px; }
    .ai-settings-content {
        width: 100vw;
        max-width: 100vw;
        border-radius: 20px 20px 0 0;
    }
    .ai-settings-content.ai-panel-enter {
        animation: ai-panel-slide-up 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    }
    .ai-quick-btn { font-size: 11px; padding: 3px 8px; }
    .ai-msg-bubble { font-size: 13px; max-width: 88%; }
    .ai-settings-modal { align-items: flex-end; }
}

@media (max-width: 380px) {
    .ai-quick-btn { font-size: 10px; padding: 3px 6px; }
    .ai-panel-title { font-size: 13px; }
}

/* ========== 排行榜详情面板样式 ========== */

/* 遮罩层 */
.ranking-panel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 90px;
}

.ranking-panel-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 面板容器 - 右侧弹出，宽度与AI面板一致 */
.ranking-panel-container {
    width: 380px;
    max-height: 85vh;
    background: var(--card-bg, rgba(15, 15, 30, 0.97));
    backdrop-filter: blur(24px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(139, 92, 246, 0.1);
    overflow: hidden;
    transform: translateX(30px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ranking-panel-overlay.show .ranking-panel-container {
    transform: translateX(0);
}

/* 面板头部 */
.ranking-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(99, 102, 241, 0.05));
}

.ranking-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--txt1, #e2e8f0);
}

.ranking-panel-title span:first-child {
    font-size: 18px;
}

/* 关闭按钮 */
.ranking-panel-close {
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--txt2, #94a3b8);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ranking-panel-close:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* 面板内容区 */
.ranking-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    min-height: 200px;
    max-height: calc(85vh - 60px);
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.3) transparent;
}

.ranking-panel-body::-webkit-scrollbar { width: 4px; }
.ranking-panel-body::-webkit-scrollbar-track { background: transparent; }
.ranking-panel-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.3); border-radius: 4px; }

/* 信息网格 */
.modal-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.modal-info-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 12px;
    padding: 12px;
}

.modal-info-label {
    font-size: 11px;
    color: var(--txt3, #64748b);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-info-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--txt1, #e2e8f0);
    word-break: break-all;
}

/* 物品明细区域 */
.modal-items-section {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 14px;
    margin-top: 4px;
}

.modal-items-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--txt2, #94a3b8);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-item-tag {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 20px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--txt2, #94a3b8);
}

/* 浅色主题适配 */
[data-theme="light"] .ranking-panel-container {
    background: rgba(248, 250, 252, 0.98);
    border-color: rgba(139, 92, 246, 0.2);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .ranking-panel-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(99, 102, 241, 0.03));
}

[data-theme="light"] .modal-info-item {
    background: rgba(139, 92, 246, 0.04);
    border-color: rgba(139, 92, 246, 0.15);
}

[data-theme="light"] .modal-info-label {
    color: #64748b;
}

[data-theme="light"] .modal-info-value {
    color: #1e293b;
}

[data-theme="light"] .modal-item-tag {
    background: rgba(139, 92, 246, 0.08);
    border-color: rgba(139, 92, 246, 0.2);
    color: #475569;
}

/* 移动端适配 */
@media (max-width: 520px) {
    .ranking-panel-overlay {
        padding-right: 0;
        align-items: flex-end;
        justify-content: center;
    }

    .ranking-panel-container {
        width: 100%;
        max-height: 80vh;
        border-radius: 20px 20px 0 0;
        transform: translateY(30px);
    }

    .ranking-panel-overlay.show .ranking-panel-container {
        transform: translateY(0);
    }

    .ranking-panel-body {
        max-height: calc(80vh - 60px);
    }

    .modal-info-grid {
        grid-template-columns: 1fr;
    }
}

/* ================================================================
   可访问性增强 (2026-03-27 优化)
   ================================================================ */

/* 跳过导航链接 - 键盘用户快速访问内容 */
.skip-link {
    position: fixed;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary, #8b5cf6);
    color: white;
    padding: 8px 16px;
    border-radius: 0 0 8px 8px;
    font-size: 13px;
    font-weight: 600;
    z-index: 99999;
    text-decoration: none;
    transition: top 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--primary, #8b5cf6);
    outline-offset: 2px;
}

/* 全局 focus-visible 样式 - 深色主题 */
html:not([data-theme="light"]) *:focus-visible {
    outline: 2px solid var(--primary, #8b5cf6);
    outline-offset: 2px;
    border-radius: 2px;
}

/* 主要交互元素的 focus-visible */
html:not([data-theme="light"]) .btn-primary:focus-visible,
html:not([data-theme="light"]) button:focus-visible,
html:not([data-theme="light"]) input:focus-visible {
    outline: 2px solid var(--primary, #8b5cf6);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25);
}

/* 数据表格焦点行高亮 */
html:not([data-theme="light"]) .data-table tbody tr:focus-visible {
    outline: 2px solid var(--primary, #8b5cf6);
    outline-offset: -2px;
    background: rgba(139, 92, 246, 0.15) !important;
}

