/* ========================================
   首页重新设计 - 现代化样式
   ======================================== */

/* ========== 侧边栏全新设计风格 ========== */

/* 侧边栏整体样式 */
.sidebar {
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%) !important;
    position: relative !important;
}

/* 侧边栏装饰背景 */
.sidebar::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 300px !important;
    background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15) 0%, transparent 70%) !important;
    pointer-events: none !important;
}

.nav-menu {
    flex: 0 0 auto !important;
    padding: 8px 12px !important;
    position: relative !important;
    z-index: 1 !important;
}

/* 导航项全新样式 */
.sidebar .nav-menu .nav-item,
.nav-menu .nav-item {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 14px 16px !important;
    margin: 6px 0 !important;
    border-radius: 12px !important;
    color: rgba(255, 255, 255, 0.65) !important;
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    position: relative !important;
    overflow: hidden !important;
    border-left: none !important;
    backdrop-filter: blur(10px) !important;
}

/* 导航项发光背景效果 */
.sidebar .nav-menu .nav-item::after,
.nav-menu .nav-item::after {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0) 0%, 
        rgba(139, 92, 246, 0) 50%,
        rgba(168, 85, 247, 0) 100%) !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease !important;
}

/* 悬停效果 */
.sidebar .nav-menu .nav-item:hover,
.nav-menu .nav-item:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    color: white !important;
    transform: translateX(4px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
}

.sidebar .nav-menu .nav-item:hover::after,
.nav-menu .nav-item:hover::after {
    opacity: 1 !important;
}

/* 激活状态 - 卡片式设计 */
.sidebar .nav-menu .nav-item.active,
.nav-menu .nav-item.active {
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.25) 0%, 
        rgba(139, 92, 246, 0.15) 100%) !important;
    color: white !important;
    font-weight: 600 !important;
    border-left: none !important;
    box-shadow: 
        0 0 0 1px rgba(99, 102, 241, 0.3),
        0 4px 16px rgba(99, 102, 241, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
    transform: translateX(0) !important;
}

/* 激活状态的边框发光 */
.sidebar .nav-menu .nav-item.active::before,
.nav-menu .nav-item.active::before {
    content: '' !important;
    position: absolute !important;
    left: 0 !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 4px !important;
    height: 60% !important;
    background: linear-gradient(180deg, #6366f1 0%, #8b5cf6 100%) !important;
    border-radius: 0 4px 4px 0 !important;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.8) !important;
}

/* 图标容器 */
.sidebar .nav-menu .nav-icon,
.nav-menu .nav-icon {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 36px !important;
    height: 36px !important;
    margin-right: 0 !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-radius: 10px !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

/* 图标容器发光效果 */
.nav-menu .nav-item.active .nav-icon {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.4) 0%, rgba(139, 92, 246, 0.3) 100%) !important;
    box-shadow: 0 0 16px rgba(99, 102, 241, 0.4) !important;
}

.nav-menu .nav-item:hover .nav-icon {
    background: rgba(99, 102, 241, 0.25) !important;
    transform: scale(1.05) rotate(-5deg) !important;
}

/* SVG图标样式 */
.sidebar .nav-menu .nav-icon svg,
.nav-menu .nav-icon svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2.5 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2)) !important;
}

.nav-menu .nav-item.active .nav-icon svg {
    stroke: #c4b5fd !important;
    filter: drop-shadow(0 0 8px rgba(196, 181, 253, 0.6)) !important;
}

/* 文字样式 */
.nav-menu .nav-text {
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.3px !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
}

.nav-menu .nav-item.active .nav-text {
    font-weight: 600 !important;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.3) !important;
}

/* 侧边栏Logo区域优化 */
.sidebar-logo {
    padding: 24px 16px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-bottom: 12px !important;
    background: rgba(255, 255, 255, 0.03) !important;
    position: relative !important;
    z-index: 1 !important;
}

.logo-text {
    font-size: 20px !important;
    font-weight: 700 !important;
    background: linear-gradient(135deg, #ffffff 0%, #c4b5fd 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    letter-spacing: 1px !important;
}

/* 全局变量 */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #06b6d4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #f9fafb;
    --bg-secondary: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* 用户信息和余额卡片行 */
.dashboard-cards-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.info-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

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

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.balance-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.card-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}

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

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

.info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.balance-amount {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    padding: 10px 0;
}

.charge-btn-new {
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.charge-btn-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

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

/* 套餐概览卡片 */
.package-overview-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.package-header {
    display: flex;
    align-items: center;
    gap: 20px;
}

.package-badge {
    background: #f3f4f6;
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
}

.package-stats {
    display: flex;
    align-items: center;
    gap: 24px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
}

.package-count-info {
    margin-left: auto;
    font-size: 13px;
    color: var(--primary-color);
    text-decoration: underline;
}

/* 资源网格 */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.resource-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    gap: 16px;
    transition: all 0.2s;
}

.resource-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.resource-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.resource-card-content h4 {
    margin: 0 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.resource-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.stat-row span:last-child {
    font-weight: 600;
    color: var(--text-primary);
}

.num-highlight {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: var(--primary-color) !important;
}

.resource-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 4px;
}

.resource-action:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* 底部区域 */
.bottom-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 24px;
}

.quick-links-card,
.banners-card,
.notifications-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
}

/* 广告位固定大小 */
.banners-card {
    min-height: 300px;
    max-height: 300px;
    overflow: hidden;
}

/* 广告横幅容器 */
#homeBanners {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 现代广告卡片 */
.modern-banner {
    position: relative;
    height: 136px;
    padding: 24px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 16px;
    overflow: hidden;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modern-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modern-banner:active {
    transform: translateY(0);
}

/* 装饰性圆圈背景 */
.banner-decoration {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

.banner-circle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.banner-circle:first-child {
    width: 140px;
    height: 140px;
    top: -40px;
    right: -20px;
}

.banner-circle:last-child {
    width: 100px;
    height: 100px;
    bottom: -30px;
    right: 60px;
}

/* 广告图标 */
.banner-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* 广告文字 */
.banner-text {
    flex: 1;
    min-width: 0;
    z-index: 1;
}

.banner-title {
    color: white;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 6px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.banner-desc {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 广告箭头 */
.banner-arrow {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1;
}

.modern-banner:hover .banner-arrow {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(4px);
}

/* 空状态和错误状态 */
.banner-empty,
.banner-error {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
    font-size: 14px;
}

.banner-error {
    color: #f56c6c;
}

/* 广告加载状态样式 */
.banners-card .loading-placeholder {
    min-height: 260px;
}

.card-header-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.card-header-simple h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.quick-links-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-link-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.quick-link-btn:hover {
    background: white;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

.notifications-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 通知卡片也隐藏横向滚动条 */
.notifications-card {
    overflow-x: hidden;
}

/* 通知内容自适应宽度 */
.notifications-list > * {
    max-width: 100%;
    overflow: hidden;
    word-wrap: break-word;
}

/* 通知项内的所有元素都不超出 */
#notificationList * {
    max-width: 100%;
    box-sizing: border-box;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-size: 14px;
    gap: 12px;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    animation: spin 1s linear infinite;
}

.loading-spinner circle {
    stroke: var(--primary-color);
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* 响应式设计 */
@media (max-width: 1400px) {
    .bottom-section {
        grid-template-columns: 1fr 2fr;
    }
    
    .quick-links-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 1024px) {
    .dashboard-cards-row {
        grid-template-columns: 1fr;
    }
    
    .resources-grid {
        grid-template-columns: 1fr;
    }
    
    .bottom-section {
        grid-template-columns: 1fr;
    }
}

/* 数字高亮效果 */
.num-value {
    color: var(--primary-color);
    font-weight: 600;
}

/* 链接样式优化 */
.link {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

.link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* 隐藏旧样式的元素 */
.user-info,
.resources-section,
.docs-section {
    display: none !important;
}

/* 确保新的广告卡片样式优先级最高 */
.modern-banner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
}

.modern-banner * {
    font-family: inherit !important;
    box-sizing: border-box !important;
}

/* ========================================
   侧边栏底部装饰内容 - 全新风格
   ======================================== */

.sidebar-footer-content {
    margin-top: auto !important;
    padding: 20px 12px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    position: relative !important;
    z-index: 1 !important;
    overflow: hidden !important;
}

/* 快速操作按钮 */
.sidebar-quick-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
}

.quick-action-btn {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 12px 8px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    backdrop-filter: blur(10px) !important;
}

.quick-action-btn:hover {
    background: rgba(99, 102, 241, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2) !important;
}

.quick-action-btn span:first-child {
    font-size: 22px !important;
    line-height: 1 !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2)) !important;
}

/* 品牌标语 */
.sidebar-brand {
    text-align: center !important;
    padding: 12px 8px 12px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(255, 255, 255, 0.02) !important;
    border-radius: 8px !important;
    margin: 0 !important;
    overflow: hidden !important;
    min-height: auto !important;
    max-height: 60px !important;
}

.brand-text {
    font-size: 12px !important;
    color: rgba(255, 255, 255, 0.5) !important;
    font-weight: 600 !important;
    margin-bottom: 4px !important;
    letter-spacing: 0.5px !important;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.7) 0%, rgba(196, 181, 253, 0.7) 100%) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 0 4px !important;
}

.brand-version {
    font-size: 10px !important;
    color: rgba(255, 255, 255, 0.35) !important;
    font-weight: 500 !important;
    font-family: 'Courier New', monospace !important;
    line-height: 1.2 !important;
}

/* 导航项脉冲动画 - 为active状态添加微妙的呼吸效果 */
@keyframes navPulse {
    0%, 100% {
        box-shadow: 
            0 0 0 1px rgba(99, 102, 241, 0.3),
            0 4px 16px rgba(99, 102, 241, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow: 
            0 0 0 1px rgba(99, 102, 241, 0.4),
            0 4px 20px rgba(99, 102, 241, 0.35),
            inset 0 1px 0 rgba(255, 255, 255, 0.15);
    }
}

.nav-menu .nav-item.active {
    animation: navPulse 3s ease-in-out infinite !important;
}

