/* 投资彩推助手 - 后台管理样式 v2 */

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

:root {
    --primary: #4f46e5;
    --primary-light: #818cf8;
    --primary-dark: #3730a3;
    --primary-50: #eef2ff;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-dark: #b91c1c;
    --warning: #f59e0b;
    --info: #3b82f6;
    --bg: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.78);
    --card-bg-solid: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border: rgba(226, 232, 240, 0.8);
    --border-strong: #e2e8f0;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-hover: 0 12px 40px rgba(15, 23, 42, 0.1);
    --shadow-glow: 0 0 40px rgba(79, 70, 229, 0.12);
    --radius: 20px;
    --radius-sm: 12px;
    --radius-xs: 8px;

    /* 中国股市配色 */
    --up: #ef4444;
    --up-light: #fee2e2;
    --down: #10b981;
    --down-light: #d1fae5;
}

[data-theme="dark"] {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #a5b4fc;
    --primary-50: rgba(99, 102, 241, 0.12);
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.15);
    --danger: #f87171;
    --danger-dark: #fca5a5;
    --warning: #fbbf24;
    --info: #60a5fa;
    --bg: #0f111a;
    --card-bg: rgba(30, 33, 48, 0.72);
    --card-bg-solid: #1e2130;
    --text: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-tertiary: #64748b;
    --border: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(148, 163, 184, 0.3);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.18);
    --up: #f87171;
    --up-light: rgba(248, 113, 113, 0.15);
    --down: #34d399;
    --down-light: rgba(52, 211, 153, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 50%, #f1f5f9 100%);
    z-index: -2;
    transition: opacity 0.4s ease;
}

[data-theme="dark"] body::before {
    background: linear-gradient(135deg, #0f111a 0%, #1a1d2b 50%, #161824 100%);
}

/* ---------- 全局页面加载器 ---------- */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.page-loader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.page-loader-inner .spinner {
    width: 48px;
    height: 48px;
    border-width: 4px;
}

/* ---------- 主题切换按钮 ---------- */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.25s ease;
    box-shadow: var(--shadow);
}

.theme-toggle:hover {
    transform: rotate(12deg) scale(1.05);
    border-color: var(--primary-light);
    box-shadow: var(--shadow-hover), var(--shadow-glow);
}

.theme-toggle:active {
    transform: scale(0.95);
}

/* ---------- 页面切换动画 ---------- */
.page-transition {
    opacity: 0;
    transform: translateY(12px) scale(0.995);
    animation: pageEnter 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes pageEnter {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.995);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.section-animate {
    opacity: 0;
    transform: translateY(16px);
    animation: sectionEnter 0.5s ease forwards;
}

@keyframes sectionEnter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bg-mesh {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
}

.mesh-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: float 20s ease-in-out infinite;
}

.mesh-blob-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #c7d2fe 0%, #a5b4fc 100%);
    top: -120px;
    left: -120px;
    animation-delay: 0s;
}

.mesh-blob-2 {
    width: 420px;
    height: 420px;
    background: linear-gradient(135deg, #ddd6fe 0%, #c4b5fd 100%);
    top: 40%;
    right: -100px;
    animation-delay: -7s;
}

.mesh-blob-3 {
    width: 360px;
    height: 360px;
    background: linear-gradient(135deg, #fbcfe8 0%, #f9a8d4 100%);
    bottom: -80px;
    left: 35%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
    33% { transform: translateY(-30px) rotate(120deg) scale(1.05); }
    66% { transform: translateY(15px) rotate(240deg) scale(0.95); }
}

/* ---------- 布局 ---------- */
.container {
    max-width: 1320px;
    margin: 0 auto;
    padding: 24px;
}

/* ---------- 顶部标题栏 ---------- */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 18px 26px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-icon {
    width: 46px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.25);
}

.brand-text h1 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.92rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.user-badge {
    background: var(--primary-50);
    color: var(--primary-dark);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
}

/* ---------- 导航 ---------- */
.nav {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 6px;
    border-radius: var(--radius);
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    font-size: 0.95rem;
}

.nav-icon {
    font-size: 1.05rem;
    opacity: 0.85;
}

.nav a::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: -1;
    border-radius: var(--radius-sm);
}

.nav a.active,
.nav a:hover {
    color: #fff;
    transform: translateY(-1px);
}

.nav a.active::before,
.nav a:hover::before {
    opacity: 1;
}

.nav a.active {
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.3);
}

/* ---------- 内容区 ---------- */
.content {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    min-height: 60vh;
}

/* ---------- 警示横幅 ---------- */
.alert-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 12px 16px;
    margin-bottom: 24px;
    color: #92400e;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
}

[data-theme="dark"] .alert-banner {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-icon {
    font-size: 1.1rem;
}

/* ---------- 玻璃卡片 ---------- */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.title-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-50);
    border-radius: 10px;
    font-size: 1.1rem;
}

.card-title h2 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.2px;
}

.card-subtitle {
    margin: 2px 0 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- 按钮 ---------- */
.btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 600;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    background: var(--text-tertiary);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    padding: 7px 14px;
    font-size: 0.82rem;
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    box-shadow: none;
}

.btn-outline:hover {
    background: var(--primary-50);
    color: var(--primary);
    border-color: var(--primary-light);
    box-shadow: none;
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 8px 20px rgba(239, 68, 68, 0.35);
}

/* ---------- Section ---------- */
.section {
    margin-bottom: 32px;
    animation: fadeInUp 0.5s ease forwards;
}

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

.section h2 {
    margin-bottom: 0;
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ---------- 图表容器 ---------- */
.chart-container {
    width: 100%;
    min-height: 280px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    position: relative;
}

/* ---------- 骨架屏 ---------- */
.skeleton-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
}

.skeleton-card {
    height: 90px;
    background: linear-gradient(90deg, var(--border-strong) 25%, var(--card-bg) 50%, var(--border-strong) 75%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    animation: shimmer 1.5s infinite;
}

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

/* ---------- 空状态 ---------- */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: var(--text-secondary);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.empty-state p {
    font-size: 0.95rem;
    font-weight: 500;
}

/* ---------- 股票卡片 ---------- */
.stock-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.stock-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stock-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--primary) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stock-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover), var(--shadow-glow);
    border-color: var(--primary-light);
}

.stock-card:hover::before {
    opacity: 1;
}

.stock-header {
    display: flex;
    align-items: center;
    margin-bottom: 14px;
    gap: 12px;
}

.rank {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.25);
    flex-shrink: 0;
}

.name {
    flex: 1;
    font-weight: 700;
    color: var(--text);
    font-size: 1.05rem;
}

.score {
    background: var(--primary-50);
    color: var(--primary-dark);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.stock-body p {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.stock-body strong {
    color: var(--text);
}

.reason {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.6;
    padding-top: 10px;
    border-top: 1px dashed var(--border);
}

.hint {
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-top: 10px;
    font-weight: 500;
}

/* ---------- 操作标签 ---------- */
.action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.8rem;
}

.action-买入 {
    background: var(--up-light);
    color: var(--danger-dark);
}

.action-卖出 {
    background: var(--down-light);
    color: #047857;
}

[data-theme="dark"] .action-卖出 {
    color: #34d399;
}

.action-持有 {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

[data-theme="dark"] .action-持有 {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
}

.action-观望 {
    background: #f3f4f6;
    color: #4b5563;
}

[data-theme="dark"] .action-观望 {
    background: rgba(148, 163, 184, 0.18);
    color: #cbd5e1;
}

.action-未知 {
    background: #f3f4f6;
    color: #6b7280;
}

[data-theme="dark"] .action-未知 {
    background: rgba(148, 163, 184, 0.18);
    color: #94a3b8;
}

/* ---------- 万元模拟收益 ---------- */
.profit-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    margin: 10px 0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.profit-up {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 3px solid var(--up);
}

[data-theme="dark"] .profit-up {
    background: var(--up-light);
}

.profit-down {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    border-left: 3px solid var(--down);
}

[data-theme="dark"] .profit-down {
    background: var(--down-light);
}

.profit-label {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
}

.profit-amount {
    font-weight: 800;
    font-size: 1.1rem;
}

.profit-up .profit-amount {
    color: var(--danger-dark);
}

.profit-down .profit-amount {
    color: #047857;
}

.profit-rate {
    color: var(--text-secondary);
    font-size: 0.78rem;
}

/* ---------- 组合收益横幅 ---------- */
.portfolio-banner {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #8b5cf6 100%);
    border-radius: var(--radius);
    padding: 26px 30px;
    margin-bottom: 28px;
    box-shadow: 0 8px 32px rgba(79, 70, 229, 0.3);
    position: relative;
    overflow: hidden;
}

.portfolio-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.12) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 40%);
    pointer-events: none;
}

.portfolio-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    transform: rotate(25deg);
    pointer-events: none;
}

.portfolio-item {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 1;
}

.portfolio-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.75);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.portfolio-value {
    font-size: 1.7rem;
    font-weight: 800;
    color: #fff;
}

.text-up {
    color: #fecaca !important;
}

.text-down {
    color: #a7f3d0 !important;
}

[data-theme="dark"] .text-up {
    color: var(--up) !important;
}

[data-theme="dark"] .text-down {
    color: var(--down) !important;
}

/* ---------- 回测卡片 ---------- */
.backtest-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
}

.backtest-card {
    flex: 1;
    min-width: 120px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px 14px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
}

.backtest-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.backtest-card-total {
    position: relative;
    border: 1px solid var(--primary);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(25, 118, 210, 0.08) 100%);
}

.backtest-card-total::after {
    content: '👁️ 查看明细';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    color: var(--primary);
    opacity: 0.85;
    font-weight: 600;
}

.backtest-card-win {
    position: relative;
    border: 1px solid var(--up);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(198, 40, 40, 0.06) 100%);
}

.backtest-card-win::after {
    content: '👁️ 盈利明细';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    color: var(--up);
    opacity: 0.85;
    font-weight: 600;
}

.backtest-card-loss {
    position: relative;
    border: 1px solid var(--down);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(46, 125, 50, 0.06) 100%);
}

.backtest-card-loss::after {
    content: '👁️ 亏损明细';
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65rem;
    color: var(--down);
    opacity: 0.85;
    font-weight: 600;
}

.backtest-detail-table {
    width: 100%;
    min-width: 640px;
}

.backtest-detail-table th,
.backtest-detail-table td {
    text-align: center;
    vertical-align: middle;
    padding: 10px 8px;
    font-size: 0.9rem;
}

.backtest-detail-table td:first-child,
.backtest-detail-table th:first-child {
    text-align: left;
}

.backtest-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.backtest-value {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

/* ---------- 彩票页标签 ---------- */
.lottery-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    background: var(--card-bg);
    padding: 6px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    width: fit-content;
}

.lottery-tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.25s ease;
}

.lottery-tab:hover {
    background: var(--card-bg-solid);
    color: var(--text);
}

.lottery-tab.active {
    background: var(--card-bg-solid);
    color: var(--primary);
    box-shadow: var(--shadow);
}

.tab-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.lottery-panel {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.lottery-panel.active {
    display: block;
}

/* ---------- 彩票卡片 ---------- */
.lottery-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
}

.lottery-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.lottery-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.lottery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    font-size: 1rem;
}

.lottery-score {
    background: var(--primary-50);
    color: var(--primary-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.lottery-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.ball {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    transition: transform 0.2s ease;
}

.ball:hover {
    transform: scale(1.12);
}

.ball.red {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.ball.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.lottery-reason,
.lottery-prob {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.lottery-prob {
    margin-bottom: 0;
    font-size: 0.8rem;
}

/* ---------- 复式推荐卡片 ---------- */
.multiple-card {
    border: 2px solid #c7d2fe;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

[data-theme="dark"] .multiple-card {
    border-color: var(--primary-light);
    background: var(--primary-50);
}

.lottery-cost {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* ---------- 冷热号分析 ---------- */
.analysis-period {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-left: 8px;
}

.hot-cold-analysis {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    border: 1px solid var(--border);
}

.hot-cold-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.hot-cold-label {
    flex-shrink: 0;
    width: 56px;
    padding: 6px 0;
    text-align: center;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
}

.label-hot {
    background: var(--up-light);
    color: var(--danger-dark);
}

.label-warm {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

.label-cold {
    background: var(--down-light);
    color: #047857;
}

.hot-cold-balls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ball-hot {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #fff;
}

.ball-warm {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
}

.ball-cold {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

/* ---------- 弹窗 ---------- */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

[data-theme="dark"] .modal {
    background: rgba(0, 0, 0, 0.65);
}

.modal-content {
    background: var(--card-bg-solid);
    padding: 28px;
    border-radius: var(--radius);
    max-width: 800px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.25);
    border: 1px solid var(--border);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: transparent;
}

.modal-close:hover {
    color: var(--danger);
    background: var(--up-light);
}

.modal-body {
    margin-top: 18px;
}

.detail-row {
    margin-bottom: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.score-pill {
    background: var(--primary-50);
    color: var(--primary-dark);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 700;
}

.stock-detail-summary {
    padding-bottom: 14px;
}

.profit-summary-row {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
}

/* ---------- AI 分析网格 ---------- */
.ai-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.ai-analysis-item {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    border: 1px solid var(--border);
    transition: all 0.25s ease;
}

.ai-analysis-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary-light);
}

.ai-analysis-item span {
    display: block;
    font-size: 0.76rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.ai-analysis-item strong {
    display: block;
    font-size: 1.1rem;
    color: var(--text);
}

.ai-explain {
    font-size: 0.74rem;
    color: var(--text-tertiary);
    margin-top: 4px;
    line-height: 1.4;
}

/* ---------- 加载动画 ---------- */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-strong);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 12px;
}

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

/* ---------- 日志表 ---------- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.log-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
    overflow: hidden;
}

.log-table th,
.log-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.log-table th {
    background: var(--card-bg);
    color: var(--text);
    font-weight: 700;
    white-space: nowrap;
}

[data-theme="dark"] .log-table th {
    background: var(--card-bg-solid);
}

.log-table tr:last-child td {
    border-bottom: none;
}

.log-table tr:hover td {
    background: var(--primary-50);
}

.log-level {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
}

.log-INFO {
    background: var(--down-light);
    color: #047857;
}

.log-ERROR {
    background: var(--up-light);
    color: var(--danger-dark);
}

.log-WARN {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
}

/* ---------- 推送页面 ---------- */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
}

.channel-status {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.channel-status h3 {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
}

.channel-status .hint {
    margin-top: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.push-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.push-group {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}

.push-group h4 {
    margin-bottom: 4px;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
}

.push-group-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.push-buttons-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.push-buttons {
    margin: 24px 0;
}

.push-buttons h3 {
    margin-bottom: 14px;
    color: var(--text);
    font-weight: 700;
}

.push-buttons .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}

.push-details {
    background: var(--card-bg);
    padding: 14px;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    font-size: 0.88rem;
    border: 1px solid var(--border);
}

.push-details p {
    margin-bottom: 8px;
}

.push-schedule {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.push-schedule ul {
    list-style: none;
}

.push-schedule li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
}

.push-schedule li span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.push-schedule li:last-child {
    border-bottom: none;
}

.push-result {
    margin-top: 24px;
}

.status-ok {
    color: #047857;
    background: var(--down-light);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    font-weight: 600;
}

[data-theme="dark"] .status-ok {
    color: #34d399;
    background: rgba(52, 211, 153, 0.12);
}

.status-warn {
    color: #b45309;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    font-weight: 600;
}

[data-theme="dark"] .status-warn {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.15);
}

.status-error {
    color: var(--danger-dark);
    background: var(--up-light);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 12px 0;
    font-weight: 600;
}

[data-theme="dark"] .status-error {
    color: #f87171;
    background: rgba(248, 113, 113, 0.12);
}

pre {
    background: var(--card-bg);
    padding: 14px;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    font-size: 0.84rem;
    border: 1px solid var(--border);
}

/* ---------- 用户持仓管理 ---------- */
.positions-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.position-user-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.position-user-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.position-user-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px;
    background: linear-gradient(135deg, var(--primary-50) 0%, rgba(255,255,255,0) 100%);
    border-bottom: 1px solid var(--border);
}

.position-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.position-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: var(--shadow);
}

.position-user-name {
    font-weight: 700;
    color: var(--text);
    font-size: 1.05rem;
}

.position-user-id {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.position-user-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.position-summary-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 70px;
}

.position-summary-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.position-summary-value {
    font-weight: 700;
    color: var(--text);
    font-size: 0.95rem;
}

.position-table th,
.position-table td {
    text-align: center;
    padding: 12px 10px;
}

.position-table td:first-child {
    text-align: left;
}

    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-left: 4px solid var(--primary);
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin: 14px 0;
    font-size: 0.86rem;
    color: var(--primary-dark);
    line-height: 1.6;
}

[data-theme="dark"] .tip-box {
    background: var(--primary-50);
    color: var(--primary-light);
}

.tip-box strong {
    color: var(--primary-dark);
}

[data-theme="dark"] .tip-box strong {
    color: var(--primary-light);
}

.tip-inline {
    margin-top: 0;
    margin-bottom: 16px;
}

.tip-large {
    font-size: 0.92rem;
    padding: 16px 18px;
    margin-bottom: 20px;
}

/* ---------- 自定义关注股票 ---------- */
.watch-add-box {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.watch-input {
    flex: 1;
    min-width: 200px;
    padding: 11px 14px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--card-bg);
    transition: all 0.25s ease;
    color: var(--text);
}

.watch-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

.watch-input:disabled {
    background: var(--card-bg);
    opacity: 0.6;
    cursor: not-allowed;
}

.watch-input.with-icon {
    padding-left: 40px;
}

.watch-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.input-icon {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
    font-size: 0.95rem;
    pointer-events: none;
}

.stock-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    max-height: 280px;
    overflow-y: auto;
    background: var(--card-bg-solid);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    z-index: 100;
    list-style: none;
    padding: 6px;
    margin: 0;
}

.stock-suggestion-item {
    display: grid;
    grid-template-columns: 76px 1fr 70px 70px;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.stock-suggestion-item:hover,
.stock-suggestion-item.focused {
    background: var(--primary-50);
}

[data-theme="dark"] .stock-suggestion-item:hover,
[data-theme="dark"] .stock-suggestion-item.focused {
    background: rgba(99, 102, 241, 0.25);
}

.stock-suggestion-item.focused {
    box-shadow: inset 0 0 0 1px var(--primary-light);
}

.suggestion-code {
    font-weight: 700;
    color: var(--primary-dark);
    font-family: "SF Mono", Consolas, monospace;
    letter-spacing: 0.5px;
}

.suggestion-name {
    color: var(--text);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.suggestion-price {
    color: var(--text-secondary);
    font-size: 0.84rem;
    text-align: right;
}

.suggestion-change {
    font-size: 0.84rem;
    font-weight: 700;
    text-align: right;
}

.stock-suggestion-empty {
    padding: 14px 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
}

.watch-msg {
    min-height: 1.4rem;
    font-size: 0.88rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.watch-msg-ok {
    color: #047857;
}

.watch-msg-error {
    color: var(--danger-dark);
}

.watch-empty {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 14px 0;
}

.watch-card {
    cursor: default;
    border-left: 4px solid var(--warning);
}

.watch-card:hover {
    border-left-color: var(--primary);
}

.stock-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.stock-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text);
}

.stock-code {
    font-size: 0.84rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.stock-badge {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #b45309;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.76rem;
    font-weight: 700;
}

.stock-card-body {
    margin-bottom: 14px;
}

.stock-price-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.stock-price {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
}

.stock-change {
    font-weight: 700;
    font-size: 0.95rem;
}

.stock-ai-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ai-score {
    background: var(--primary-50);
    color: var(--primary-dark);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
}

.watch-card .profit-box {
    margin: 12px 0;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}

.watch-card .stock-reason {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-top: 10px;
    line-height: 1.5;
}

.stock-card-footer {
    display: flex;
    gap: 10px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }

    .content {
        padding: 18px;
    }

    .admin-header {
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    .brand {
        justify-content: center;
    }

    .nav a {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .nav-icon {
        display: none;
    }

    .portfolio-banner {
        padding: 20px;
    }

    .portfolio-value {
        font-size: 1.4rem;
    }

    .stock-list,
    .lottery-list {
        grid-template-columns: 1fr;
    }

    .glass-card {
        padding: 18px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .lottery-tabs {
        width: 100%;
    }

    .lottery-tab {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }

    .modal-content {
        width: 96%;
        padding: 20px;
    }

    .backtest-cards,
    .channel-grid,
    .push-grid {
        grid-template-columns: 1fr;
    }

    .push-schedule li {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
}

@media (max-width: 480px) {
    .brand-text h1 {
        font-size: 1.1rem;
    }

    .brand-sub {
        display: none;
    }

    .watch-add-box {
        flex-direction: column;
    }

    .watch-input-wrapper,
    .watch-add-box .btn {
        width: 100%;
    }

    .stock-suggestion-item {
        grid-template-columns: 70px 1fr 60px;
    }

    .suggestion-price {
        display: none;
    }
}
