/* sidebar-shared.css - 统一侧边栏公共样式
 * 所有页面共享的侧边栏布局和组件样式
 */

/* ========== 侧边栏容器 ========== */
.app-sidebar {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    left: 16px;
    width: 56px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    z-index: 9990;
    overflow: visible;
    height: auto;
    padding: 8px 0;
    gap: 2px;
}

/* ========== 顶部品牌区域 ========== */
.sidebar-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    flex-shrink: 0;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transition: background 0.2s;
}
.sidebar-logo:hover {
    background: rgba(255, 133, 162, 0.08);
}
.sidebar-logo .brand-text {
    font-family: 'Montserrat', 'Segoe UI', 'PingFang SC', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: capitalize;
    background: linear-gradient(135deg, #FF4D8A 0%, #FF85A2 40%, #D946EF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 6px rgba(255, 77, 138, 0.3));
    transition: filter 0.3s;
    line-height: 1;
}
.sidebar-logo:hover .brand-text {
    filter: drop-shadow(0 0 10px rgba(255, 77, 138, 0.5));
}

/* 返回按钮（解说剧/对话剧页面） */
.sidebar-back-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    height: 100%;
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 10px;
}
.sidebar-back-btn:hover {
    background: rgba(255, 133, 162, 0.08);
    color: #FF85A2;
}
.sidebar-back-btn svg {
    flex-shrink: 0;
}

/* ========== 主导航区域（首页） ========== */
.sidebar-nav-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0;
}

.sidebar-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 48px;
    padding: 8px 2px;
    border-radius: 8px;
    cursor: pointer;
    color: #9ca3af;
    font-size: 10px;
    transition: all 0.2s;
    border: 1px solid transparent;
    background: transparent;
    text-align: center;
}
.sidebar-nav-item:hover {
    background: rgba(255, 133, 162, 0.10);
    color: #e5e5e5;
}
.sidebar-nav-item.active {
    background: rgba(255, 133, 162, 0.12);
    border-color: rgba(255, 133, 162, 0.3);
    color: #FF85A2;
}
.sidebar-nav-item .nav-icon-img {
    width: 20px;
    height: 20px;
    opacity: 0.55;
    filter: grayscale(100%) brightness(1.5);
    transition: all 0.2s;
}
.sidebar-nav-item:hover .nav-icon-img {
    opacity: 0.85;
    filter: grayscale(0%) brightness(1);
}
.sidebar-nav-item.active .nav-icon-img {
    opacity: 1;
    filter: grayscale(0%) brightness(1);
}
.sidebar-nav-item .nav-label {
    display: none;
}

/* ========== 步骤流程（解说剧/对话剧） ========== */
.sidebar-step-flow {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 4px;
}
.sidebar-step-flow.visible {
    display: flex;
}
.sidebar-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 48px;
    padding: 6px 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}
.sidebar-step:hover {
    background: rgba(255, 255, 255, 0.06);
}
.sidebar-step.active {
    background: rgba(255, 215, 0, 0.08);
}
.sidebar-step.active .step-num {
    background: #FFD700;
    color: #000;
}
.sidebar-step.active .step-name {
    color: #FFD700;
}
.sidebar-step.completed .step-num {
    background: #5dade2;
    color: #fff;
}
.sidebar-step.completed .step-name {
    color: #5dade2;
}
.sidebar-step .step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #333;
    color: #888;
    font-size: 10px;
    font-weight: 600;
    flex-shrink: 0;
}
.sidebar-step .step-name {
    display: none;
}

/* 项目名称 */
.sidebar-project-name {
    padding: 4px 4px;
    text-align: center;
    font-size: 9px;
    color: #FF85A2;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56px;
    letter-spacing: 0.3px;
}

/* 额外按钮区域 */
.sidebar-extra-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
}

/* ========== 底部独立悬浮气泡 ========== */
/* 对话剧页面隐藏底部气泡（避免遮挡片段列表） */
.dd-main .sidebar-bottom-bubble { display: none !important; }

.sidebar-bottom-bubble {
    position: fixed;
    bottom: 16px;
    left: 16px;
    width: 56px;
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 0;
    z-index: 9990;
    overflow: visible;
}

/* 积分+等级 */
.sidebar-user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 48px;
    padding: 4px 2px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    gap: 1px;
}
.sidebar-user-info:hover {
    background: rgba(255, 133, 162, 0.10);
}
.sidebar-user-info .sidebar-points {
    font-size: 11px;
    font-weight: 700;
    color: #10B981;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}
.sidebar-user-info .sidebar-level {
    font-size: 8px;
    font-weight: 500;
    color: #FF85A2;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user-info.low .sidebar-points { color: #f59e0b; }
.sidebar-user-info.empty .sidebar-points { color: #ef4444; }
.sidebar-user-info.permanent .sidebar-level { color: #34D399; }
.sidebar-user-info.warning .sidebar-level { color: #f59e0b; }
.sidebar-user-info.inactive .sidebar-level { color: #888; }

/* 头像 */
.sidebar-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 3px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
    position: relative;
    width: 48px;
}
.sidebar-avatar-wrap:hover {
    background: rgba(255, 133, 162, 0.10);
}
.sidebar-avatar-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF85A2, #D4A574);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-avatar-btn svg {
    width: 16px;
    height: 16px;
}
.sidebar-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}
.sidebar-login-text {
    display: none;
}

/* ========== 个人下拉菜单（气泡弹出） ========== */
.profile-dropdown {
    position: fixed;
    left: 80px;
    bottom: 60px;
    width: 220px;
    background: rgba(10,10,10,0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 133, 162, 0.20);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    z-index: 10000;
    display: none;
    overflow: hidden;
}
.profile-dropdown.show { display: block; }
.profile-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.profile-dropdown-uid {
    font-size: 15px;
    color: #FF85A2;
    font-weight: 600;
}
.profile-dropdown-email {
    font-size: 13px;
    color: #e0e0e0;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.profile-dropdown-role {
    font-size: 11px;
    color: rgba(255, 133, 162, 0.7);
    margin-top: 3px;
}
.profile-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 13px;
    color: #c0c0c0;
    cursor: pointer;
    transition: background 0.15s;
}
.profile-dropdown-item:hover {
    background: rgba(255, 133, 162, 0.08);
    color: #fff;
}
.profile-dropdown-item svg { width: 16px; height: 16px; color: #a0a0a0; flex-shrink: 0; }
.profile-dropdown-item:hover svg { color: #FF85A2; }
.profile-dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.06);
    margin: 2px 0;
}

/* ========== 汉堡菜单按钮 ========== */
.sidebar-menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar-menu-btn:hover {
    background: rgba(255, 133, 162, 0.10);
    color: #FF85A2;
}

/* ========== 汉堡菜单面板（气泡弹出） ========== */
.sidebar-menu-panel {
    position: fixed;
    left: 80px;
    bottom: 16px;
    width: auto;
    min-width: 140px;
    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 133, 162, 0.15);
    border-radius: 12px;
    z-index: 10000;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    opacity: 0;
    transform: scale(0.9) translateX(-8px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.sidebar-menu-panel.open {
    opacity: 1;
    transform: scale(1) translateX(0);
    pointer-events: auto;
}

.menu-panel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    text-align: left;
}
.menu-panel-item:hover {
    background: rgba(255, 133, 162, 0.10);
    color: #FF85A2;
}
.menu-panel-item svg {
    flex-shrink: 0;
}

/* ========== 独立 Logo（首页） ========== */
.floating-logo {
    position: fixed;
    top: 16px;
    left: 20px;
    z-index: 9995;
    pointer-events: none;
}
.floating-logo .brand-text {
    font-family: 'Montserrat', 'Segoe UI', 'PingFang SC', sans-serif;
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #FF4D8A 0%, #FF85A2 40%, #D946EF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
    filter: drop-shadow(0 0 6px rgba(255, 77, 138, 0.3));
}

/* ========== 内容区偏移（避开悬浮侧边栏） ========== */
.app-sidebar ~ .app-viewport {
    height: 100vh;
    margin-left: 0;
    width: 100vw;
    padding-left: 80px;
    box-sizing: border-box;
}
.app-sidebar ~ .sub-toolbar {
    left: 80px;
}
