@font-face {
    font-family: 'BMNEA';
    src: url('../../fonts/BMNEA___.TTF') format('truetype');
}

@font-face {
    font-family: 'BMpinhole';
    src: url('../../fonts/BMpinhole.TTF') format('truetype');
}

.app-layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-main {
    display: flex;
    flex: 1;
    width: 100%;
}

.sidebar-main {
    width: 220px;
    flex-shrink: 0;
    background: rgba(210, 225, 245, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-right: 2px solid rgba(255,255,255,0.6);
    box-shadow: inset 0 0 30px rgba(255,255,255,0.4), 2px 0 12px rgba(0,0,0,0.1);
    padding: 12px 10px;
    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar-section { margin-bottom: 16px; }
.sidebar-title { font-size: 11px; font-weight: bold; color: #003399; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; border-bottom: 1px solid #ccc; padding-bottom: 2px; }
.sidebar-menu { list-style: none; padding: 0; margin: 0; }
.sidebar-menu li { margin-bottom: 2px; }
.sidebar-menu a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px; color: #2a3a50; text-decoration: none;
    font-size: 12px; border: 1px solid transparent; border-radius: 3px;
    transition: all 0.15s;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    image-rendering: pixelated; /* Maintain XP skeuomorphic feel */
}

.interaction-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 2px;
    image-rendering: auto;
}

.post-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.sidebar-menu a:hover {
    background: rgba(180, 210, 245, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-color: rgba(255,255,255,0.5);
    box-shadow: inset 0 0 8px rgba(255,255,255,0.5);
    color: #003399;
    font-weight: bold;
}
.search-box { display: flex; gap: 4px; margin-bottom: 4px; width: 100%; overflow: hidden; }
.search-box input { flex: 1; height: 24px; padding: 0 4px; border: 2px solid #808080; font-size: 11px; min-width: 0; }
.search-box button { font-size: 11px; padding: 0 4px; white-space: nowrap; flex-shrink: 0; }
.search-results { font-size: 11px; }

/* 推荐关注按钮 - 图片化 */
.rec-follow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    width: 24px;
    height: 24px;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: transform 0.1s;
}

.rec-follow-btn:hover {
    transform: scale(1.1);
}

.rec-follow-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    image-rendering: auto;
}

.rec-follow-btn:disabled {
    cursor: default;
    opacity: 1; /* 已关注状态不需要变灰，因为图片本身表达状态 */
}

@media (max-width: 768px) {
    .rec-follow-btn {
        width: 20px;
        height: 20px;
    }
    .rec-follow-btn img {
        width: 16px;
        height: 16px;
    }
}
.stay-tuned-container {
    position: relative;
    width: 100%;
    height: 28px; /* 与搜索框 input 24px + 2px*2 边框对齐 */
    border: 2px solid #808080; /* 仿照搜索框边框 */
    background: rgba(255, 255, 255, 0.3); /* 添加微弱底色 */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.stay-tuned-container img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* 强制拉伸填充，符合“拉伸缩放”要求 */
    display: block;
    opacity: 0.5; /* 降低透明度，使其不扎眼 */
    filter: saturate(0.8); /* 稍微降低饱和度以更好地融入侧边栏 */
}

.stay-tuned-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    white-space: nowrap;
    pointer-events: none;
    font-family: Tahoma, Arial, sans-serif; /* 确保不使用微软雅黑 */
}

.app-content {
    flex: 1;
    min-width: 0;
    padding: var(--space-xl);
    background: linear-gradient(135deg, #eef3f8 0%, #d9e8f5 40%, #e4e5f0 100%);
    position: relative;
    box-shadow: inset 3px 3px 8px rgba(0,0,0,0.05);
}

/* 顶部横条: 分类 + 推荐 */
.top-bar {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(180deg, #eef4f8 0%, #dde6f0 100%);
    border: 1px solid #c5d3e0;
    border-bottom: 2px solid #8899aa;
    border-radius: 0 0 8px 8px;
    padding: 4px 8px;
    margin-bottom: 10px;
}

/* 移动端专用分类过滤器 */
.category-filter-mobile {
    display: none; /* 桌面端彻底隐藏 */
}

@media (max-width: 768px) {
    .category-filter-mobile {
        display: block;
        padding: 4px 8px;
        margin-bottom: 8px;
        background: linear-gradient(180deg, #eef4f8 0%, #dde6f0 100%);
        border: 1px solid #c5d3e0;
        border-bottom: 2px solid #8899aa;
        border-radius: 4px;
    }
    .category-filter-mobile select {
        width: 100%;
        height: 24px;
        font-size: 11px;
        font-family: var(--font-family);
        background-color: #c0c0c0;
        border: 2px solid;
        border-color: #ffffff #808080 #808080 #ffffff;
        box-shadow: 1px 1px 0 #000;
    }
}

/* 推荐用户 */
.rec-strip { display: flex; align-items: center; gap: 8px; flex: 1; overflow: hidden; }
.rec-list { display: flex; gap: 10px; flex: 1; }
.rec-item { display: flex; align-items: center; gap: 5px; }
.rec-avatar { width: 24px; height: 24px; border: 1px solid #8899aa; border-radius: 2px; overflow: hidden; flex-shrink: 0; display: block; }
.rec-name { font-size: 11px; color: #223344; text-decoration: none; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-label { font-size: 10px; color: #667788; font-weight: bold; white-space: nowrap; }

/* 移动端搜索栏（桌面端隐藏） */
.mobile-search-bar {
    display: none;
}

.app-content::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.02) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.01), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.01));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.header-main {
    background: linear-gradient(180deg, #4a90d9 0%, #2b6cb0 50%, #1a4a7a 100%);
    color: white;
    padding: 0 var(--space-md);
    height: 50px;
    border-bottom: 3px solid #0d2b4a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.35);
    position: relative;
    overflow: hidden;
}

.header-domain-text, .header-stats-container {
    display: none;
}

.header-main::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

/* 桌面端导航栏分段背景逻辑 */
@media (min-width: 769px) {
    .header-main {
        background-color: rgba(220, 235, 255, 0.7); /* 微调色相与透明度，消除视觉饱和度过高感 */
        background-image: none; /* 明确清除基础样式的渐变 */
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        /* 弱化底部投影，减少暗色对透明背景的污染 */
        box-shadow: inset 0 0 30px rgba(255,255,255,0.4), 0 2px 8px rgba(0,0,0,0.15);
        border-bottom-color: rgba(255, 255, 255, 0.8);
    }

    /* 第一部分：左侧侧边栏宽度对齐区域 (220px) */
    .header-main::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        width: 220px;
        height: calc(100% + 3px); /* 延伸到覆盖底边线 */
        background: linear-gradient(180deg, #4a90d9 0%, #2b6cb0 50%, #1a4a7a 100%);
        border-right: 2px solid rgba(255,255,255,0.6); /* 对齐侧边栏右边框 */
        border-bottom: 3px solid #0d2b4a; /* 还原第一部分的蓝色底边线 */
        z-index: 0;
        box-sizing: border-box;
    }

    /* 按钮与选择框颜色调整为雾霾蓝 */
    .nav-link-skeuo, #langSelect {
        color: #5d7b9d !important;
        text-shadow: none !important; /* 移除原有深色投影以适应浅色背景 */
    }

    #langSelect {
        background: rgba(255, 255, 255, 0.5) !important;
        border-color: #5d7b9d !important;
    }

    /* 域名展示样式 - 仅限桌面端 */
    .header-domain-text {
        display: flex;
        align-items: baseline; /* 改为基线对齐，使文字和图片底部更自然 */
        position: absolute;
        left: 235px;
        font-family: 'BMNEA', sans-serif;
        font-size: 28px; /* 保持大字号 */
        color: #003399; /* 修改为经典深蓝色 */
        pointer-events: none;
        letter-spacing: 2px;
        opacity: 0.9;
    }

    .header-domain-text img {
        height: 28px; /* 图片放大至与字体等高 */
        width: auto;
        margin: 0 1px;
        filter: saturate(0.9) contrast(1.1);
        image-rendering: pixelated;
        vertical-align: middle;
        position: relative;
        top: 2px; /* 调整偏移以使等高图片与文字基线视觉平衡 */
    }

    /* 站点统计样式 - 仅限桌面端 */
    .header-stats-container {
        display: flex;
        align-items: center;
        position: absolute;
        left: 485px; /* 从 520px 调回至 485px，使竖线精准位于域名与统计信息之间 */
        color: #1a2533; /* 进一步加深颜色，增强可读性 */
        pointer-events: none;
    }

    .header-stats-separator {
        font-size: 32px;
        color: rgba(0, 51, 153, 0.2); /* 深蓝色透明，作为竖线 */
        margin-right: 12px;
        font-weight: 100;
    }

    .header-stats-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 1px;
    }

    .header-stats-line {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        white-space: nowrap;
        line-height: 1.2;
    }

    .header-stats-line img {
        width: 14px;
        height: 14px;
        object-fit: contain;
        image-rendering: pixelated;
    }

    /* 确保 Logo 和 导航链接在背景伪元素之上 */
    .header-logo, .header-nav {
        position: relative;
        z-index: 2;
    }
    
    /* 将原有的反光效果限制在左侧蓝色区域 */
    .header-main::after {
        width: 220px;
        right: auto;
        z-index: 1;
    }
}

.header-logo h1 {
    margin: 0;
    font-size: 28px;
    font-weight: normal;
    font-family: 'BMpinhole', cursive, sans-serif;
    color: #00E676; /* 亮绿色，与深蓝背景协调 */
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.nav-link-pure-img {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 4px !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: transform 0.1s;
    position: relative;
}

.nav-link-pure-img:hover {
    transform: scale(1.1);
    text-decoration: none !important;
}

.nav-link-pure-img img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    image-rendering: auto;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced gap since images have their own spacing */
    z-index: 1;
}

/* 侧边栏搜索 */
.skeuo-search-inp {
    padding: 2px 4px; background: #fff; font-size: 11px;
    border: 2px solid; border-color: #808080 #fff #fff #808080;
    box-sizing: border-box; font-family: var(--font-family); width: 100%;
}

.btn-secondary:active, .btn-secondary.active {
    background: #c0c0c0;
    box-shadow: inset 2px 2px 0px #000;
}

#dragModeBtn.active {
    background: #c0c0ff !important;
    border-color: #000080;
    box-shadow: inset 2px 2px 0px rgba(0,0,128,0.5);
}

.footer-main {
    padding: var(--space-md) var(--space-sm);
    text-align: center;
    border-top: 2px solid #c5d3e0;
    background: linear-gradient(180deg, #eef4f8 0%, #dde6f0 100%);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
}

.footer-notice, .footer-copy {
    margin: 0 0 4px 0;
    font-size: 11px;
    color: #5d7b9d; /* 雾霾蓝 */
    line-height: 1.4;
}

.footer-links {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #2a3a50;
    text-decoration: none;
    font-size: 11px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #003399;
    text-decoration: underline;
}

.footer-sep {
    color: #c5d3e0;
    font-size: 10px;
}

/* 广播站样式 (桌面端专用，全局生效) */
.broadcast-container {
    background: transparent;
    padding: 0;
    margin-top: 4px;
}

.broadcast-display {
    height: 150px;
    overflow-y: auto;
    background-color: #ffffff;
    background-image: linear-gradient(rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.75)), url('../../img/boardcast-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border: 2px solid;
    border-color: #808080 #ffffff #ffffff #808080; /* XP 经典内凹边框 */
    padding: 6px;
    font-size: 11px;
    line-height: 1.4;
    color: #000000;
    margin-bottom: 8px;
    box-sizing: border-box;
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.2);
    position: relative;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.8); /* 增加文字外发光，提升背景上的可读性 */
}

.broadcast-item {
    margin-bottom: 2px;
    word-break: break-all;
    font-size: 11px; /* 强制缩小字号 */
}

.broadcast-name {
    color: #003399;
    font-weight: bold;
    margin-right: 4px;
}

.broadcast-content {
    color: #333;
}

/* 自定义 XP 风格滚动条 */
.broadcast-display::-webkit-scrollbar {
    width: 16px;
}
.broadcast-display::-webkit-scrollbar-track {
    background: #d4d0c8;
    border: 1px solid #808080;
}
.broadcast-display::-webkit-scrollbar-thumb {
    background: #d4d0c8;
    border: 2px solid;
    border-color: #ffffff #808080 #808080 #ffffff;
}

.qip-emoji {
    display: inline-block;
    vertical-align: middle;
    object-fit: contain;
    /* Keep natural size as per user requirement */
}

/* 全局表情选择器样式 */
.emoji-picker {
    display: none;
    grid-template-columns: repeat(8, 28px); /* 使用固定像素宽度确保绝对对齐 */
    gap: 1px;
    background: #c0c0c0;
    border: 2px solid;
    border-color: #fff #808080 #808080 #fff;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.4);
    padding: 3px;
    width: fit-content; /* 宽度由列宽决定 */
    z-index: 2000;
    box-sizing: border-box;
}

.emoji-cell {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff; /* 统一使用纯白背景，消除半透明导致的不均匀感 */
    border: 1px solid #808080;
    box-sizing: border-box;
    transition: all 0.1s;
}

.emoji-cell img {
    max-width: 20px;
    max-height: 20px;
    object-fit: contain;
}

.emoji-cell:hover {
    background: #000080;
    border-color: #fff;
}

@media (max-width: 768px) {
    body {
        /* 核心修复：全局防止移动端滑动返回手势冲突 */
        overscroll-behavior-x: none;
    }
    .app-main { flex-direction: column; }
    .sidebar-main { display: none; }
    .app-content { padding: 8px; }
    .top-bar { 
        padding: 8px; 
        margin-bottom: 8px;
    }
    .rec-strip { 
        width: 100%;
        display: flex;
        flex-direction: column; /* 垂直排列标签、列表和按钮 */
        align-items: stretch;
        gap: 8px;
    }
    .rec-list {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto; /* 允许横向滑动推荐用户 */
        gap: 12px;
        padding-bottom: 4px;
        width: 100%;
    }
    .rec-label { 
        display: block; 
        font-size: 11px;
        color: #003399;
        font-weight: bold;
        margin-bottom: 2px;
    }
    #refreshRec {
        align-self: flex-end; /* 刷新按钮靠右 */
        margin-top: -4px;
    }
    .mobile-search-bar {
        display: flex; align-items: center; gap: 4px;
        padding: 4px 8px; margin-bottom: 6px;
        background: linear-gradient(180deg, #eef4f8 0%, #dde6f0 100%);
    border: 1px solid #c5d3e0;
    border-bottom: 2px solid #8899aa;
    border-radius: 0 0 8px 8px;
}
    .header-main { 
        height: auto; 
        min-height: 42px; 
        padding: 5px 10px; 
        display: flex;
        flex-wrap: wrap; 
        align-items: center;
        justify-content: space-between; /* 确保 Logo 在左，导航在右 */
    }
    .header-logo {
        flex: 0 0 auto;
    }
    .header-logo h1 { 
        font-size: 20px; 
        margin: 0;
    }
    .header-nav { 
        flex: 1;
        gap: 2px; 
        font-size: 9px; 
        flex-wrap: wrap; 
        justify-content: flex-end; /* 导航项内部始终右对齐 */
        margin-left: 10px;
    }
    .header-nav .nav-link-pure-img img { width: 24px; height: 24px; }
    .header-nav .nav-link-skeuo { font-size: 9px; padding: 2px 4px; }
    .header-nav select.nav-link-skeuo { font-size: 8px; padding: 1px 2px; max-width: 60px; }
    .nav-refresh-btn { width: 24px; height: 24px; }
    
    /* 页脚移动端适配 */
    .footer-main {
        padding: 16px 12px;
    }
    .footer-notice, .footer-copy {
        font-size: 10px;
    }
    .footer-links {
        gap: 6px;
    }
}
