/* ===== 全局滚动条 ===== */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.30);
}
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.02);
}

/* ===== 侧边栏容器 ===== */
.left-sidebar-container {
    position: relative;
    width: 230px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    background: #1a1a1a;
    border-radius: 16px;
    padding: 18px 14px 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin: 12px 0 12px 12px;
    overflow-y: auto;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s ease;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

/* ===== Logo 区域 ===== */
.left-sidebar-container .logo-section {
    display: flex;
    align-items: center;
    padding: 4px 0 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 6px;
}
.left-sidebar-container .logo {
    display: flex;
    align-items: center;
    gap: 10px;
}
.left-sidebar-container .logo-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-weight: 700;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(248, 168, 184, 0.2);
}
.left-sidebar-container .logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #f8f8f8;
}
.left-sidebar-container .logo-text span {
    color: #d8e878;
    font-weight: 800;
}

/* ===== 汉堡菜单按钮 ===== */
.menu-toggle {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1002;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    background: rgba(20, 20, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 5px;
    cursor: pointer;
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: 0.2s;
}
.menu-toggle:hover {
    background: rgba(30, 30, 30, 0.95);
}
.menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background: #f0f0f0;
    border-radius: 2px;
    transition: 0.3s ease;
}
.menu-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle.open span:nth-child(2) {
    opacity: 0;
}
.menu-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ===== 导航列表 ===== */
.left-sidebar-container .nav-sidebar {
    display: flex;
    flex-direction: column;
    flex: 1;
}
.left-sidebar-container .menu-list {
    list-style: none;
    margin: 0 0 18px 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.left-sidebar-container .menu-item {
    padding: 10px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: all 0.2s ease;
    cursor: pointer;
    color: #b0b0b0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}
.left-sidebar-container .menu-item i {
    width: 22px;
    font-size: 16px;
    text-align: center;
    transition: 0.2s;
    color: #888;
}
.left-sidebar-container .menu-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #f0f0f0;
}
.left-sidebar-container .menu-item:hover i {
    color: #d8e878;
}
.left-sidebar-container .menu-item.active {
    background: rgba(248, 168, 184, 0.08);
    color: #f8f8f8;
    border-left: 3px solid #f8a8b8;
    box-shadow: inset 0 0 10px rgba(248, 168, 184, 0.02);
}
.left-sidebar-container .menu-item.active i {
    color: #f8a8b8;
}

/* ===== 工具分组标题 ===== */
.left-sidebar-container .tool-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #999;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 4px 6px 4px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: 0.2s;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    margin-top: 4px;
}
.left-sidebar-container .tool-title:hover {
    color: #d8e878;
}
.tool-title .fa-chevron-down {
    font-size: 12px;
    transition: transform 0.35s ease;
}
.tool-title .fa-chevron-down.rotated {
    transform: rotate(180deg);
}
.tool-title + .menu-list {
    margin-top: 2px;
}

/* ===== 底部用户卡片 ===== */
.sidebar-bottom {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* 登录状态卡片 */
.credits-info {
    background: rgba(248, 168, 184, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px 14px 14px;
    margin-bottom: 12px;
    transition: 0.3s;
}
.credits-info:hover {
    background: rgba(248, 168, 184, 0.07);
}

/* 头部：头像、用户名、通知 */
.credits-info .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}
.avatarsss {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;          /* ★ 关键：允许子元素收缩 */
    overflow: hidden;      /* ★ 确保溢出隐藏 */
}
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(248, 168, 184, 0.3);
    cursor: pointer;
    transition: 0.3s;
    flex-shrink: 0;
}
.avatar:hover {
    border-color: #d8e878;
    box-shadow: 0 0 12px rgba(216, 232, 120, 0.25);
}
.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #e8e8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;       /* 确保不会超出父容器 */
    flex-shrink: 1;
}
.action-btn {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: 0.2s;
    position: relative;
    flex-shrink: 0;
}
.action-btn:hover {
    color: #d8e878;
    transform: scale(1.05);
}
.notif-badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 30px;
    min-width: 18px;
    text-align: center;
    border: 1px solid #1a1a1a;
}

/* ===== 积分网格（修复溢出，完整显示数值） ===== */
.credit-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px 4px;
    margin-top: 2px;
}
.credit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    padding: 4px 0;
    transition: 0.2s;
    min-width: 0;
}
.credit-item:hover {
    background: rgba(255, 255, 255, 0.04);
}
.credit-item .label {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}
.credit-item .value {
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
    white-space: nowrap;
    word-break: keep-all;
    padding: 0 2px;
}
.credit-item .value.today {
    color: #d8e878;
}
.credit-item .value.recharge {
    color: #fbbf24;
}
.credit-item .value.total {
    color: #34d399;
}

/* 获取更多积分按钮 */
.left-sidebar-container .get-more {
    display: block;
    text-align: center;
    padding: 10px 0;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    border-radius: 30px;
    text-decoration: none;
    transition: 0.3s;
    box-shadow: 0 2px 12px rgba(248, 168, 184, 0.15);
}
.left-sidebar-container .get-more:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248, 168, 184, 0.25);
}

/* 游客登录按钮 */
.login-btn {
    display: block;
    width: 100%;
    padding: 12px 0;
    text-align: center;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    color: #1a1a1a;
    font-weight: 700;
    border-radius: 30px;
    text-decoration: none;
    transition: 0.3s;
    font-size: 15px;
    box-shadow: 0 2px 12px rgba(248, 168, 184, 0.15);
}
.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(248, 168, 184, 0.25);
}

/* ===== 通知模态框 ===== */
.notif-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.notif-modal.active {
    display: flex;
}
.notif-modal-content {
    background: rgba(26, 26, 26, 0.96);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    width: 92%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
    overflow: hidden;
}
.notif-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.notif-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f8f8f8;
}
.notif-modal-header h3 i {
    color: #d8e878;
}
.notif-close {
    background: transparent;
    border: none;
    color: #aaa;
    font-size: 28px;
    cursor: pointer;
    transition: 0.2s;
    padding: 0 4px;
}
.notif-close:hover {
    color: #f8f8f8;
    transform: rotate(90deg);
}
.notif-modal-body {
    padding: 12px 22px;
    overflow-y: auto;
    flex: 1;
    max-height: 50vh;
}
.notif-item {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: 0.2s;
    border-radius: 6px;
    padding-left: 6px;
    padding-right: 6px;
}
.notif-item:hover {
    background: rgba(255, 255, 255, 0.02);
}
.notif-item.unread {
    border-left: 3px solid #f8a8b8;
    padding-left: 14px;
}
.notif-title {
    font-weight: 600;
    color: #f0f0f0;
    margin-bottom: 4px;
    font-size: 15px;
}
.notif-content {
    font-size: 13px;
    color: #c0c0c0;
    line-height: 1.5;
}
.notif-time {
    font-size: 11px;
    color: #777;
    display: block;
    margin-top: 6px;
}
.notif-image {
    max-width: 100%;
    max-height: 120px;
    border-radius: 8px;
    margin-top: 8px;
    display: block;
}
.notif-empty, .notif-loading {
    text-align: center;
    color: #888;
    padding: 30px 0;
}
.notif-modal-footer {
    padding: 14px 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: right;
}
.notif-mark-all {
    padding: 8px 22px;
    background: linear-gradient(135deg, #f8a8b8, #d8e878);
    color: #1a1a1a;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    font-size: 13px;
    transition: 0.3s;
}
.notif-mark-all:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(248, 168, 184, 0.3);
}

/* ===== 遮罩层 ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    z-index: 999;
    backdrop-filter: blur(2px);
}
.sidebar-overlay.active {
    display: block;
}

/* ================================================================
   响应式：移动端抽屉（≤ 768px）
   ================================================================ */
@media (max-width: 768px) {
    .left-sidebar-container {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 285px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        margin: 0 !important;
        border-radius: 0 20px 20px 0 !important;
        transform: translateX(-100%) !important;
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.7) !important;
        z-index: 1000 !important;
        padding: 56px 16px 20px !important;
        overflow-y: auto !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
        background-color: #1a1a1a !important;
        display: flex !important;
        border: none !important;
    }
    .left-sidebar-container.open {
        transform: translateX(0) !important;
    }
    .menu-toggle {
        display: flex !important;
    }
    .left-sidebar-container .sidebar-bottom {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        width: auto !important;
        margin-top: auto !important;
        padding-top: 14px !important;
        border-top: 1px solid rgba(255, 255, 255, 0.05) !important;
    }
    .left-sidebar-container .nav-sidebar {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 !important;
        overflow-y: auto !important;
    }
    .left-sidebar-container .menu-list {
        gap: 2px !important;
    }
    .left-sidebar-container .menu-item {
        padding: 12px 14px !important;
        font-size: 15px !important;
    }
    .sidebar-overlay {
        display: none !important;
    }
    .sidebar-overlay.active {
        display: block !important;
    }

    /* 移动端积分网格微调 */
    .credit-grid {
        gap: 2px 2px;
    }
    .credit-item {
        padding: 2px 0;
    }
    .credit-item .value {
        font-size: 11px;
    }
    /* 移动端用户名同样处理 */
    .avatarsss {
        min-width: 0;
        overflow: hidden;
    }
    .user-name {
        font-size: 13px;
    }
}
@media (max-width: 480px) {
    .left-sidebar-container {
        width: 270px !important;
    }
    .credit-item .value {
        font-size: 10px;
    }
    .user-name {
        font-size: 12px;
    }
}