/* ========== common.css - 所有页面共用 ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: radial-gradient(circle at 10% 20%, #0a0f2a, #050814);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #ffffff;
    min-height: 100vh;
}

/* ========== 应用布局 ========== */
.app {
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 280px;
    background: rgba(11, 11, 33, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(204, 178, 153, 0.2);
    padding: 32px 20px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar-top {
    flex: 1;
}

.logo {
    font-size: 28px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 40px;
}

.logo span {
    font-size: 14px;
    color: #C9B095;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    color: #a0a8c0;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
}

.nav-item i {
    width: 22px;
    font-size: 18px;
}

.nav-item:hover {
    background: rgba(201, 176, 149, 0.1);
    color: #C9B095;
}

.nav-item.active {
    background: rgba(201, 176, 149, 0.15);
    color: #C9B095;
    border-left: 2px solid #C9B095;
}

/* ===== 侧边栏升级卡片（统一高级风格） ===== */
.sidebar-upgrade-card {
    margin-top: 20px;
    padding: 24px 20px;
    background: linear-gradient(135deg, rgba(204,178,153,0.08), rgba(204,178,153,0.02));
    backdrop-filter: blur(12px);
    border-radius: 20px;
    border: 1px solid rgba(204, 178, 153, 0.3);
    animation: pulseGlow 2.5s ease-in-out infinite;
}

.sidebar-premium-badge {
    display: inline-block;
    background: #C9B095;
    border: 1px solid #C9B095;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: #0A122B;
    letter-spacing: 1px;
    margin-bottom: 14px;
}

.sidebar-upgrade-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.sidebar-upgrade-desc {
    font-size: 12px;
    color: #7a85a5;
    line-height: 1.6;
    margin-bottom: 20px;
}

.sidebar-upgrade-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(201, 176, 149, 0.1);
    border: 1px solid rgba(201, 176, 149, 0.4);
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    color: #C9B095;
    font-weight: 600;
    font-size: 13px;
    transition: 0.2s;
}

.sidebar-upgrade-btn:hover {
    background: rgba(201, 176, 149, 0.2);
    color: #ffd700;
    transform: translateX(2px);
}

/* ========== 主内容区 ========== */
.main {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    text-align: left !important;
}

/* ========== 卡片通用样式 ========== */
.card {
    background: rgba(20, 30, 55, 0.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(201, 176, 149, 0.15);
    border-radius: 28px;
    padding: 24px;
    transition: all 0.3s;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(201, 176, 149, 0.35);
}

/* ========== 按钮样式 ========== */
.btn-primary {
    background: linear-gradient(135deg, #2f3e7a, #1f2a50);
    border: none;
    padding: 10px 24px;
    border-radius: 40px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #3e5090, #2a3768);
    transform: scale(1.02);
}

.btn-danger {
    background: rgba(255, 80, 80, 0.15);
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    color: #ff8888;
    cursor: pointer;
    transition: 0.2s;
}

.btn-danger:hover {
    background: rgba(255, 80, 80, 0.3);
}

.btn-secondary {
    background: rgba(201, 176, 149, 0.1);
    border: 1px solid rgba(201, 176, 149, 0.2);
    padding: 8px 18px;
    border-radius: 30px;
    color: #C9B095;
    cursor: pointer;
    transition: 0.2s;
}

.btn-secondary:hover {
    background: rgba(201, 176, 149, 0.2);
}

/* ========== 表格样式 ========== */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th, .data-table td {
    padding: 14px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(201, 176, 149, 0.1);
}

.data-table th {
    color: #C9B095;
    font-weight: 600;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: rgba(20, 30, 55, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(201, 176, 149, 0.12);
    transition: 0.3s;
}

.stat-card:hover {
    border-color: rgba(201, 176, 149, 0.3);
    transform: translateY(-2px);
}

.stat-title {
    font-size: 13px;
    color: #a0a8c0;
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #C9B095;
}

/* ========== 弹窗样式 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.modal-card {
    background: linear-gradient(145deg, #0E1A3A, #0A122B);
    border-radius: 32px;
    width: 480px;
    max-width: 90%;
    padding: 0;
    border: 1px solid rgba(201, 176, 149, 0.3);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #0F1C3F, #0A122B);
    padding: 20px 24px;
    border-bottom: 1px solid rgba(201, 176, 149, 0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #C9B095;
}

.modal-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: #C9B095;
}

.modal-body {
    padding: 24px;
}

/* ========== 移动端汉堡菜单 ========== */
.menu-toggle {
    display: none;
    width: fit-content;
    background: rgba(201, 176, 149, 0.2);
    border: 1px solid rgba(201, 176, 149, 0.4);
    border-radius: 12px;
    padding: 8px 12px;
    cursor: pointer;
    color: #C9B095;
    font-size: 18px;
    transition: 0.2s;
    margin-bottom: 20px;
    margin-left: 0;
    text-align: left;
}

.menu-toggle.hidden {
    display: none;
}

.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    pointer-events: auto;
    cursor: pointer;
}

/* ========== 响应式 ========== */
@media (max-width: 1000px) {
    .sidebar {
        width: 240px;
    }
    .main {
        padding: 24px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        position: relative;
        top: 16px;
        left: 0px;
        z-index: 1002;
    }
    
    /* ========== 新的悬浮菜单动画 - 从左滑出 ========== */
    .sidebar {
        position: fixed;
        top: 8px;
        left: 8px;
        bottom: 8px;
        width: auto;
        max-width: 300px;
        height: auto;
        background: rgba(10, 18, 43, 0.98);
        backdrop-filter: blur(20px);
        border-radius: 32px;
        border: 1px solid rgba(201, 176, 149, 0.3);
        box-shadow: 0 20px 40px rgba(0,0,0,0.4);
        padding: 28px 20px;
        overflow-y: auto;
        z-index: 1001;
        transition: none;
        opacity: 0;
        transform: translateX(-100%);
        visibility: hidden;
        will-change: transform, opacity;
        backface-visibility: hidden;
    }
    
    /* 菜单打开时的状态 - 从左滑出 */
    .sidebar.open {
        opacity: 1;
        transform: translateX(0);
        visibility: visible;
        animation: slideInFromLeft 0.35s cubic-bezier(0.2, 0.9, 0.4, 1.1) forwards;
    }
    
    /* 从左滑出入场动画 */
    @keyframes slideInFromLeft {
        0% {
            opacity: 0;
            transform: translateX(-100%);
        }
        100% {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    /* 菜单项入场动画 - 从底部缓慢向上 */
    .sidebar.open .sidebar-top,
    .sidebar.open .sidebar-upgrade-card {
        animation: slowFadeUp 0.4s ease-out forwards;
    }
    
    .sidebar.open .nav-item {
        animation: slowFadeUp 0.4s ease-out forwards;
        opacity: 0;
        transform: translateY(20px);
    }
    
    /* 菜单项逐个延迟入场 */
    .sidebar.open .nav-item:nth-child(1) { animation-delay: 0.05s; }
    .sidebar.open .nav-item:nth-child(2) { animation-delay: 0.1s; }
    .sidebar.open .nav-item:nth-child(3) { animation-delay: 0.15s; }
    .sidebar.open .nav-item:nth-child(4) { animation-delay: 0.2s; }
    .sidebar.open .nav-item:nth-child(5) { animation-delay: 0.25s; }
    .sidebar.open .nav-item:nth-child(6) { animation-delay: 0.3s; }
    .sidebar.open .nav-item:nth-child(7) { animation-delay: 0.35s; }
    .sidebar.open .nav-item:nth-child(8) { animation-delay: 0.4s; }
    
    .sidebar.open .sidebar-upgrade-card {
        animation-delay: 0.45s;
    }
    
    /* 从底部缓慢向上出现动画 */
    @keyframes slowFadeUp {
        0% {
            opacity: 0;
            transform: translateY(20px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* Logo 入场动画 */
    .sidebar.open .logo {
        animation: logoFadeUp 0.35s ease-out forwards;
        opacity: 0;
        transform: translateY(15px);
        animation-delay: 0s;
    }
    
    @keyframes logoFadeUp {
        0% {
            opacity: 0;
            transform: translateY(15px);
        }
        100% {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* ========== upgrade 卡片样式（确保脉冲发光生效） ========== */
    .sidebar-upgrade-card {
        margin-top: 20px;
        padding: 24px 20px;
        background: rgba(20, 30, 55, 0.6);
        backdrop-filter: blur(12px);
        border-radius: 20px;
        text-align: left;
        border: 1px solid rgba(201, 176, 149, 0.3);
        flex-shrink: 0;
        /* 脉冲发光动画 - 持续呼吸效果 */
        animation: pulseGlow 2.5s ease-in-out infinite;
    }
    
    .sidebar-upgrade-card:hover {
        animation: none;
        transform: translateY(-2px);
    }
    
    /* 脉冲发光动画定义 */
    @keyframes pulseGlow {
        0% { 
            box-shadow: inset 0 0 10px rgba(201, 176, 149, 0.08), 0 0 5px rgba(201, 176, 149, 0.05); 
            border-color: rgba(201, 176, 149, 0.2); 
        }
        50% { 
            box-shadow: inset 0 0 25px rgba(201, 176, 149, 0.25), 0 0 15px rgba(201, 176, 149, 0.12); 
            border-color: rgba(201, 176, 149, 0.5); 
        }
        100% { 
            box-shadow: inset 0 0 10px rgba(201, 176, 149, 0.08), 0 0 5px rgba(201, 176, 149, 0.05); 
            border-color: rgba(201, 176, 149, 0.2); 
        }
    }
    
    .sidebar-premium-badge {
        display: inline-block;
        background: #C9B095;
        border: 1px solid #C9B095;
        padding: 4px 12px;
        border-radius: 20px;
        font-size: 11px;
        font-weight: 600;
        color: #0A122B;
        letter-spacing: 1px;
        margin-bottom: 14px;
    }
    
    .sidebar-upgrade-title {
        font-size: 16px;
        font-weight: 700;
        color: #ffffff;
        margin-bottom: 12px;
    }
    
    .sidebar-upgrade-desc {
        font-size: 12px;
        color: #7a85a5;
        line-height: 1.6;
        margin-bottom: 20px;
    }
    
    .sidebar-upgrade-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        background: rgba(201, 176, 149, 0.1);
        border: 1px solid rgba(201, 176, 149, 0.4);
        padding: 8px 20px;
        border-radius: 30px;
        text-decoration: none;
        color: #C9B095;
        font-weight: 600;
        font-size: 13px;
        transition: 0.2s;
    }
    
    .sidebar-upgrade-btn:hover {
        background: rgba(201, 176, 149, 0.2);
        color: #ffd700;
        transform: translateX(2px);
    }
    
    .menu-overlay {
        z-index: 1000;
    }
    
    .menu-overlay.active {
        display: block;
    }
    
    .main {
        padding: 16px 16px;
        margin-top: 30px;
    }

    .welcome-header {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    /* 手机版菜单项垂直排列 */
    .nav {
        flex-direction: column;
    }
}

/* 强制手机版 upgrade 卡片发光 - 放在文件最底部 */
@media (max-width: 768px) {
    .sidebar-upgrade-card {
        animation: pulseGlow 2.5s ease-in-out infinite !important;
    }
    
    @keyframes pulseGlow {
        0% { 
            box-shadow: inset 0 0 10px rgba(201, 176, 149, 0.08), 0 0 5px rgba(201, 176, 149, 0.05); 
            border-color: rgba(201, 176, 149, 0.2); 
        }
        50% { 
            box-shadow: inset 0 0 25px rgba(201, 176, 149, 0.25), 0 0 15px rgba(201, 176, 149, 0.12); 
            border-color: rgba(201, 176, 149, 0.5); 
        }
        100% { 
            box-shadow: inset 0 0 10px rgba(201, 176, 149, 0.08), 0 0 5px rgba(201, 176, 149, 0.05); 
            border-color: rgba(201, 176, 149, 0.2); 
        }
    }
}

.overview-card-content {
    position: relative;
    z-index: 1;
}

.overview-card-content .overview-label,
.overview-card-content .overview-value,
.overview-card-content .overview-tag {
    position: relative;
    z-index: 2;
}

.bubble-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;  /* 确保在最底层 */
}

/* ========== 统一手机版菜单样式（所有页面共用） ========== */

/* 移动端顶部栏 */
.mobile-top-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 0 12px 0;
}

.menu-toggle {
    background: rgba(204, 178, 153, 0.15);
    border: 1px solid rgba(204, 178, 153, 0.3);
    border-radius: 12px;
    padding: 10px 14px;
    cursor: pointer;
    color: #CCB299;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo img {
    height: 40px;
    width: auto;
}

/* 遮罩层 */
.menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 999;
    cursor: pointer;
}

.menu-overlay.active {
    display: block;
}

/* 手机版侧边栏样式 */
@media (max-width: 768px) {
    
    .mobile-top-bar {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 16px;
        left: 16px;
        bottom: 16px;
        width: 280px;
        max-width: calc(100% - 32px);
        max-height: calc(100vh - 32px);
        background: rgba(11, 11, 33, 0.1);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-radius: 24px;
        border: 1px solid rgba(204, 178, 153, 0.3);
        padding: 24px 16px;
        overflow-y: auto;
        z-index: 1001;
        transform: translateX(-120%);
        transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .sidebar::-webkit-scrollbar {
        display: none;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    /* 从下往上动画 */
    .sidebar .logo,
    .sidebar .nav-item,
    .sidebar .sidebar-upgrade-card {
        opacity: 0;
        transition: opacity 0.2s ease;
    }
    
    .sidebar.open .logo,
    .sidebar.open .nav-item,
    .sidebar.open .sidebar-upgrade-card {
        opacity: 1;
    }
    
    /* 逐项延迟 */
    .sidebar.open .sidebar-upgrade-card { transition-delay: 0s; }
    .sidebar.open .nav-item:nth-child(9) { transition-delay: 0.02s; }
    .sidebar.open .nav-item:nth-child(8) { transition-delay: 0.04s; }
    .sidebar.open .nav-item:nth-child(7) { transition-delay: 0.06s; }
    .sidebar.open .nav-item:nth-child(6) { transition-delay: 0.08s; }
    .sidebar.open .nav-item:nth-child(5) { transition-delay: 0.1s; }
    .sidebar.open .nav-item:nth-child(4) { transition-delay: 0.12s; }
    .sidebar.open .nav-item:nth-child(3) { transition-delay: 0.14s; }
    .sidebar.open .nav-item:nth-child(2) { transition-delay: 0.16s; }
    .sidebar.open .nav-item:nth-child(1) { transition-delay: 0.18s; }
    .sidebar.open .logo { transition-delay: 0.2s; }
    
    .main {
        margin-left: 0;
        padding: 16px;
    }
}

/* ===== 压缩侧边栏 Upgrade 卡片高度 ===== */
.sidebar-upgrade-card {
    padding: 14px 16px !important;
    margin-top: 12px !important;
    border-radius: 16px !important;
}
.sidebar-premium-badge {
    font-size: 10px !important;
    padding: 2px 10px !important;
    margin-bottom: 8px !important;
}
.sidebar-upgrade-title {
    font-size: 14px !important;
    margin-bottom: 6px !important;
}
.sidebar-upgrade-desc {
    font-size: 11px !important;
    line-height: 1.4 !important;
    margin-bottom: 12px !important;
}
.sidebar-upgrade-btn {
    font-size: 12px !important;
    padding: 5px 14px !important;
}