/* ==========================================
   1. 极简硬核色板：黑曜石 (Obsidian) + 琥珀金 (Amber)
   ========================================== */
:root {
    --bg-base: #09090b;
    --bg-surface: #121214;
    --bg-hover: #1f1f22;

    --border-subtle: #27272a;
    --border-strong: #3f3f46;

    --text-title: #ffffff;
    --text-body: #a1a1aa;
    --text-muted: #71717a;

    --accent-color: #f59e0b;
    /* 琥珀金 */
    --accent-bg: rgba(245, 158, 11, 0.1);
}

body {
    background-color: var(--bg-base) !important;
    color: var(--text-body);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* 覆盖所有的 a 标签默认行为 */
a {
    color: var(--text-body);
    text-decoration: none !important;
    transition: color 0.2s;
}

a:hover {
    color: var(--text-title);
}

/* ==========================================
   2. 顶部导航栏重构 (毛玻璃 + 黑曜石)
   ========================================== */
.navbar {
    background: rgba(9, 9, 11, 0.85) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text-title) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-brand::after {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.navbar-dark .navbar-nav .nav-link {
    color: var(--text-body);
    font-size: 0.9rem;
    font-weight: 500;
}

.navbar-dark .navbar-nav .nav-link:hover {
    color: var(--text-title);
}

/* ==========================================
   3. 悬浮聊天按钮 & 窗口 (去蓝紫化)
   ========================================== */
#chat-fab-btn {
    position: fixed;
    bottom: 40px;
    right: 40px;
    /* 改到右侧更符合习惯，你可以自己改回 left:30px */
    width: 56px;
    height: 56px;
    background-color: var(--bg-surface) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text-title);
    z-index: 1050;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 12px !important;
    /* 方形更硬核 */
    cursor: grab;
    transition: all 0.2s;
}

#chat-fab-btn:active {
    cursor: grabbing;
}

#chat-fab-btn:hover {
    background-color: var(--text-title) !important;
    color: var(--bg-base) !important;
}

#chat-floating-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 860px;
    height: 480px;
    min-width: 300px;
    min-height: 400px;
    z-index: 1050;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.8);
    /* 纯物理阴影 */
    resize: both;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

#chat-drag-handle {
    background-color: var(--bg-base) !important;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-title) !important;
    cursor: move;
    user-select: none;
}

#chat-iframe {
    flex-grow: 1;
    width: 100%;
    background-color: var(--bg-surface);
    /* 防止 iframe 闪白 */
}

/* SweetAlert2 暗黑模式微调 */
.swal2-popup.swal2-toast {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
    background: var(--bg-surface) !important;
    border: 1px solid var(--border-strong) !important;
    color: var(--text-title) !important;
}



/* ==========================================
   4. B站风格导航栏头像下拉菜单
   ========================================== */
.b-avatar-wrap {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    margin-right: 15px;
    /* 在关于甘蔗前留一点间距 */
}

/* 透明防丢焦桥梁：防止鼠标移向下拉菜单时缝隙导致闪断 */
.b-avatar-wrap::after {
    content: '';
    position: absolute;
    top: 100%;
    left: -20px;
    right: -20px;
    height: 35px;
    background: transparent;
    z-index: 1050;
}

.b-avatar-link {
    display: block;
    position: relative;
    z-index: 1060;
}

/* 导航栏头像默认状态 */
.b-avatar-img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
    background-color: var(--bg-surface);
    /* 加入B站精髓的弹簧贝塞尔曲线动画 */
    transition: transform 0.3s cubic-bezier(0.22, 0.58, 0.12, 0.98), border-color 0.3s;
}

/* 悬浮时：头像放大1.8倍且往下掉落卡在菜单上 */
.b-avatar-wrap:hover .b-avatar-img {
    transform: translateY(18px) scale(2.5);
    border-color: var(--text-title);
}

/* 下拉菜单面板 */
.b-avatar-menu {
    position: absolute;
    top: calc(100% + 15px);
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    width: 250px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.22, 0.58, 0.12, 0.98);
    z-index: 1040;
    /* 藏在放大头像的下面 */
    padding-top: 45px;
    /* 给掉下来的头像留出空间 */
    padding-bottom: 12px;
}

/* 悬浮显示菜单 */
.b-avatar-wrap:hover .b-avatar-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.b-menu-header {
    margin-bottom: 15px;
    color: var(--text-title);
}

/* 数据统计区 */
.b-stats-container {
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 15px;
    padding: 0 10px;
}

.b-stat-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.b-stat-item:hover {
    transform: translateY(-2px);
}

.b-stat-num {
    color: var(--text-title);
    font-size: 1.1rem;
    font-weight: 700;
    transition: color 0.2s;
}

.b-stat-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-top: 4px;
    transition: color 0.2s;
}

.b-stat-item:hover .b-stat-num,
.b-stat-item:hover .b-stat-label {
    color: var(--accent-color);
    /* 悬浮时变成你的琥珀金 */
}

/* 菜单项 */
.b-menu-item {
    display: flex;
    align-items: center;
    padding: 10px 24px;
    color: var(--text-body);
    text-decoration: none !important;
    font-size: 0.95rem;
    transition: background-color 0.2s, color 0.2s;
}

.b-menu-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-title);
}

.b-menu-item i {
    font-size: 1.1rem;
    margin-right: 12px;
    color: var(--text-muted);
    transition: color 0.2s;
}

.b-menu-item:hover i {
    color: var(--text-title);
}