/* ============================================================
   Bagua-Core HUD Style System — Mint Glass Edition
   ============================================================ */

/* --- 1. 全局背景 (已交由 style.css 接管鼠尾草绿主题) --- */

/* ============================================================
   Liquid Glass x Sage Green - Fluid Background
   ============================================================ */

/* 动画定义 */
@keyframes morph {
    0%, 100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-30px); }
}

/* 流动光斑背景节点 */
body::before {
    content: "";
    position: fixed;
    top: 5%; left: 10%;
    width: 400px; height: 400px;
    background: rgba(16, 185, 129, 0.25); /* 亮薄荷绿 */
    filter: blur(80px);
    z-index: -2;
    pointer-events: none;
    animation: morph 8s ease-in-out infinite, float 6s ease-in-out infinite;
}
body::after {
    content: "";
    position: fixed;
    bottom: 10%; right: 10%;
    width: 500px; height: 500px;
    background: rgba(56, 189, 248, 0.20); /* 天蓝色 */
    filter: blur(90px);
    z-index: -2;
    pointer-events: none;
    animation: morph 10s ease-in-out infinite, float 8s ease-in-out infinite;
    animation-delay: 2s;
}

.hud-bg-extra-1 {
    position: fixed;
    top: 40%; right: 5%;
    width: 350px; height: 350px;
    background: rgba(244, 114, 182, 0.15); /* 柔和粉 */
    filter: blur(80px);
    z-index: -2;
    pointer-events: none;
    animation: morph 9s ease-in-out infinite, float 7s ease-in-out infinite;
    animation-delay: 1s;
}
.hud-bg-extra-2 {
    position: fixed;
    bottom: 20%; left: 5%;
    width: 300px; height: 300px;
    background: rgba(167, 139, 250, 0.15); /* 柔和紫 */
    filter: blur(70px);
    z-index: -2;
    pointer-events: none;
    animation: morph 11s ease-in-out infinite, float 9s ease-in-out infinite;
    animation-delay: 3s;
}

/* 装饰层：全部穿透点击 */
/* (旧版扫描线已被移除) */

/* --- 2. 透明化覆盖容器 --- */
.main-content, .content-inner, #content, .page-container {
    background: transparent !important;
}

/* --- 3. 毛玻璃面板 --- */
.hud-container, .card, .module-card, .glass-panel, .sidebar-nav, .news-item-glass {
    position: relative;
    background: var(--bg-card) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: var(--border-radius, 24px) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.hud-container::before, .hud-container::after {
    display: none !important;
}
.news-item-glass:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

/* --- 4. 文字颜色 --- */
body, h1, h2, h3, h4, .font-weight-bold {
    color: var(--text-primary) !important;
    letter-spacing: -0.01em;
}
body, h1, h2, h3, h4, a, .sidebar-menu a {
    color: var(--text-primary) !important;
}
.text-muted, .text-secondary {
    color: var(--text-secondary) !important;
}

/* --- 5. 强调色 --- */
.btn-primary, .search-type li.active:after, .header-mini {
    background-color: var(--accent-mint) !important;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3) !important;
}

/* --- 6. 技术标注风格 --- */
.tech-label {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-mint);
    letter-spacing: 1px;
    opacity: 0.75;
}
.tech-id {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-secondary);
    margin-right: 4px;
}

/* --- 7. 顶部导航 --- */
.bagua-top-nav {
    background: var(--bg-card) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: var(--glass-shadow) !important;
    border-radius: var(--border-radius, 30px) !important;
    z-index: 9999 !important;
    position: sticky;
    top: 20px;
}

/* PC 端三段式网格 */
@media (min-width: 769px) {
    .bagua-top-nav {
        margin-top: 20px !important;
    }
    .bagua-top-nav > div {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        align-items: center !important;
        gap: 10px !important;
    }
    .nav-brand {
        justify-self: start !important;
        max-width: 250px !important;
        overflow: hidden;
        font-weight: 600;
        color: var(--text-primary);
    }
    .nav-links-wrapper {
        justify-self: center !important;
        position: static !important;
        transform: none !important;
        display: flex !important;
        gap: 8px !important;
        z-index: 100 !important;
    }
    .nav-status {
        justify-self: end !important;
        text-align: right !important;
    }
}

/* --- 8. Tab 项目 --- */
.bagua-tab-item {
    cursor: pointer;
    padding: 7px 16px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    transition: all 0.25s ease;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
}
.bagua-tab-item:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
    color: var(--text-mint);
}
.bagua-tab-item.active {
    background: var(--accent-mint) !important;
    color: #fff !important;
    border-color: var(--accent-mint) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.30);
}
.bagua-tab-item.active .tech-id {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* --- 9. 侧边栏 --- */
.sidebar-nav {
    border-radius: 0 16px 16px 0 !important;
    margin-right: 20px;
}
.header-navbar {
    background: rgba(255, 255, 255, 0.5) !important;
    backdrop-filter: blur(15px) !important;
    border-bottom: 1px solid var(--glass-border) !important;
}

/* --- 10. 提示词卡片 --- */
.prompt-card-pro {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}
.prompt-card-pro:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}
.card-tag {
    display: inline-block;
    background: rgba(16, 185, 129, 0.10);
    color: var(--accent-mint);
    padding: 2px 8px;
    font-size: 10px;
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.20);
}
.badge-mint-soft {
    background: rgba(16, 185, 129, 0.12);
    color: var(--text-mint);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
}
.text-mint { color: var(--text-mint) !important; }

/* --- 11. 资源卡片 --- */
.res-card-pro {
    background: var(--bg-card) !important;
    backdrop-filter: blur(30px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: var(--border-radius, 24px) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    box-shadow: var(--glass-shadow) !important;
}
.res-card-pro:hover {
    background: rgba(255, 255, 255, 0.4) !important;
    border-color: rgba(255, 255, 255, 0.8) !important;
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}
.res-title {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}
.res-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 32px;
}

/* --- 12. 布局基础重置 (已由 Bootstrap 托管) --- */
/* --- 12. 布局基础重置 (大一统 16px 规范) --- */
html, body, .page-container, .main-content, .bagua-main-full {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

#bagua-app {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

@media (min-width: 769px) {
    #bagua-app {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* --- 13. 页脚 --- */
.bagua-footer-nodes,
.bagua-footer-nodes ul {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
    background: none !important;
}
.bagua-footer-nodes li {
    all: unset !important;
    display: flex !important;
    align-items: center !important;
    margin: 4px 0 !important;
}
.bagua-footer-nodes li + li::before {
    content: "•" !important;
    color: var(--text-secondary);
    font-size: 10px;
    margin: 0 4px !important;
    opacity: 0.4;
}
.bagua-footer-nodes a {
    all: unset !important;
    color: var(--text-secondary) !important;
    cursor: pointer !important;
    padding: 0 10px !important;
    font-size: 13px !important;
    transition: color 0.3s ease;
    display: flex !important;
    align-items: center !important;
}
.bagua-footer-nodes a:hover {
    color: var(--accent-mint) !important;
}
.bagua-footer-nodes i,
.bagua-footer-nodes .iconfont,
.bagua-footer-nodes .fa {
    display: none !important;
}
.footer-terminal-line {
    border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    font-size: 11px !important;
    line-height: 2 !important;
    opacity: 0.85 !important;
}
.footer-terminal-line a {
    color: inherit !important;
    text-decoration: none !important;
    margin: 0 5px;
}
.footer-terminal-line img {
    height: 14px !important;
    width: auto !important;
    vertical-align: middle;
    margin-right: 4px;
}

/* --- 14. 动画 --- */
@keyframes bagua-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.80; }
}

/* ============================================================
   移动端适配
   ============================================================ */
@media (max-width: 768px) {
    .glass-panel,
    .bagua-top-nav {
        border-radius: 16px !important;
        border: 1px solid var(--glass-border) !important;
    }
    .bagua-top-nav {
        margin-bottom: 16px !important;
        top: 10px;
    }
    .bagua-top-nav > div {
        /* Padding removed to allow template px-4 classes to work */
    }
    .nav-links-wrapper {
        padding: 4px 0 !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        display: flex !important;
        flex-direction: row !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
        mask-image: linear-gradient(to right, black 85%, transparent 100%);
    }
    .bagua-tab-item {
        padding: 6px 12px !important;
        font-size: 11px !important;
        margin-right: 6px !important;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.45) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: 8px !important;
    }
    .bagua-tab-item.active {
        animation: bagua-pulse 2s infinite;
    }
    .glass-panel {
        padding: 12px !important;
    }
    .res-card-pro {
        padding: 6px !important;
    }
    .res-icon img {
        width: 22px !important;
        height: 22px !important;
    }
    .res-title {
        font-size: 10px !important;
    }
    .tech-label.x-small {
        font-size: 8px !important;
    }
    .nav-status, .tech-label.small {
        display: none !important;
    }
    .main-footer {
        padding: 30px 20px !important;
        margin: 20px 1rem 80px 1rem !important; /* 统一 16px */
        text-align: center !important;
    }
    .bagua-footer-nodes a {
        padding: 5px 8px !important;
        font-size: 11px !important;
    }
    .main-footer .text-md-right {
        text-align: center !important;
        margin-top: 20px;
    }
    .footer-terminal-line {
        padding-top: 20px !important;
        margin-top: 20px !important;
    }
}

/* --- 控制条与搜索 (Control Bar & Search) --- */
.search-box-pro {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.tech-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 12px;
    padding: 14px 25px;
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: all 0.3s;
    text-align: center;
}

.tech-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-mint);
    box-shadow: 0 10px 40px rgba(16, 185, 129, 0.15);
}

.letter-spacing-2 {
    letter-spacing: 0.15em;
}

.border-white-05 {
    border-color: rgba(255, 255, 255, 0.05) !important;
}


.search-box-pro .search-icon {
    display: none; /* 居中模式下隐藏左侧图标，保持纯净 */
}

/* --- 分类面板 & 过滤舱 --- */
.category-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.category-panel:hover {
    border-color: rgba(0, 255, 213, 0.2);
    transform: translateY(-2px);
}

.panel-label {
    padding-right: 20px;
    border-right: 1px solid rgba(255,255,255,0.05);
    margin-right: 10px;
}

.cat-pill {
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-decoration: none !important;
    transition: all 0.3s ease;
    white-space: nowrap;
    letter-spacing: 0.5px;
}

.cat-pill:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.cat-pill.active {
    color: var(--accent-mint) !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.1);
}

/* --- 视图与排序工具栏优化 --- */
.grid-tools-wrap {
    border-left: 1px solid var(--glass-border);
    padding-left: 1.5rem;
}

@media (max-width: 768px) {
    .grid-tools-wrap {
        border-left: none;
        padding-left: 0;
        margin-top: 1rem;
        width: 100%;
        justify-content: space-between;
    }
}

.view-switcher {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 3px;
    backdrop-filter: blur(10px);
}

.view-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
}

.view-btn:hover {
    color: var(--accent-mint);
    background: rgba(255,255,255,0.05);
}

.view-btn.active {
    background: var(--accent-mint);
    color: #fff !important; /* 修正为纯白色，提升高级感 */
    box-shadow: 0 4px 12px var(--accent-glow);
}

/* --- 移动端分类栏横向滑动优化 --- */
@media (max-width: 768px) {
    .category-panel {
        padding: 1rem !important;
    }
    
    .category-panel > .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .category-panel .panel-label {
        margin-bottom: 1rem;
        margin-right: 0;
    }

    .category-panel .d-flex.flex-wrap {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 8px; /* 留出滚动条空间 */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox 隐藏滚动条 */
    }

    .category-panel .d-flex.flex-wrap::-webkit-scrollbar {
        display: none; /* Chrome/Safari 隐藏滚动条 */
    }

    .cat-pill {
        white-space: nowrap; /* 防止文字折行 */
        flex-shrink: 0;
    }
}

.sort-selector {
    position: relative;
}

.tech-select-minimal {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 7px 32px 7px 15px;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.tech-select-minimal:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-mint-2);
}

.tech-select-minimal option {
    background: #1a2a24;
    color: var(--text-primary);
}

/* --- 列表视图模式 (List View Layout) --- */
.tech-grid-container.list-view {
    display: block !important;
}

.tech-grid-container.list-view .grid-item {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    margin-bottom: 1rem;
}

.tech-grid-container.list-view .glass-card-pro {
    display: flex;
    align-items: center;
    padding: 1.25rem 2rem;
    height: auto;
    min-height: 80px;
}

.tech-grid-container.list-view .card-header-mini {
    flex: 0 0 240px;
    margin-bottom: 0 !important;
    margin-right: 2rem;
}

.tech-grid-container.list-view .res-desc {
    margin-bottom: 0 !important;
    -webkit-line-clamp: 1; /* 列表模式只显示一行摘要 */
    height: auto;
    flex-grow: 1;
}

.tech-grid-container.list-view .card-footer-tech {
    margin-top: 0 !important;
    flex: 0 0 150px;
    justify-content: flex-end !important;
}

/* --- 导航药丸标签 (PC 中部) --- */
.nav-container-pro {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 2rem;
}

.nav-pill-pro {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 10px 24px;
    border-radius: 100px;
    color: var(--text-secondary);
    text-decoration: none !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(8px);
}

.nav-pill-pro .pill-number {
    font-family: 'JetBrains Mono', monospace;
    opacity: 0.4;
    font-size: 0.75rem;
    background: rgba(255,255,255,0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.nav-pill-pro:hover, .nav-pill-pro.active {
    background: rgba(52, 211, 153, 0.1);
    border-color: var(--accent-mint);
    color: var(--accent-mint);
    box-shadow: 0 0 30px rgba(52, 211, 153, 0.15);
    transform: translateY(-2px);
}

/* --- 移动端 Header 下拉极致优化 --- */
.nav-links-wrapper {
    display: flex;
}

.mobile-nav-spinner {
    display: none;
}

@media (max-width: 768px) {
    .nav-links-wrapper {
        display: none !important; /* 物理强制消失，解决您看到的“横向滑动”残留 */
    }
    .mobile-nav-spinner {
        display: block !important; /* 物理强制显示 */
        flex: 1;
        margin-left: 0.5rem;
    }
    .nav-brand {
        min-width: auto !important; /* 释放空间 */
        font-size: 0.8rem;
    }
    .nav-status {
        display: none !important;
    }
}

.mobile-nav-spinner .tech-select-minimal {
    height: 34px;
    padding: 0 25px 0 10px;
    font-size: 11px;
    border-radius: 6px;
    background-color: rgba(255,255,255,0.03);
    width: 100%;
}

/* 简介文字强制 3 行截断 */
.res-desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 4.8em; /* 1.6 line-height * 3 */
    line-height: 1.6;
    margin-bottom: 1rem;
    word-break: break-all; /* 兼容中英文 */
}

.icon-wrap-sm {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 6px;
}


/* --- 高级内容卡片 (Glass Card Pro) - 强化版 --- */
.glass-card-pro {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.glass-card-pro:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-mint);
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}


.icon-wrap {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.icon-wrap img {
    width: 30px;
    height: 30px;
    border-radius: 6px;
}

/* --- 底部分页器 (Pagination Footer) --- */
.pag-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: pointer;
}

.pag-btn:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--accent-mint);
    color: var(--accent-mint);
}

.pag-btn:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.pag-info {
    font-size: 14px;
    letter-spacing: 2px;
}

.pag-info .curr {
    font-size: 18px;
    font-weight: 800;
}


/* ============================================================
   Single Resource Detail Page (HUD style)
   ============================================================ */

/* Head card */
.hud-head-card {
    border: 1px solid rgba(16, 185, 129, 0.18);
}
.hud-head-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-mint), transparent);
    opacity: 0.5;
    pointer-events: none;
}

/* Icon frame */
.hud-icon-frame {
    width: 120px;
    height: 120px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    box-shadow: inset 0 0 30px rgba(16, 185, 129, 0.05);
    position: relative;
}
.hud-icon-frame::after {
    content: "";
    position: absolute;
    top: -1px; right: -1px;
    width: 12px; height: 12px;
    border-top: 1px solid var(--accent-mint);
    border-right: 1px solid var(--accent-mint);
    opacity: 0.7;
}
.hud-icon-frame::before {
    content: "";
    position: absolute;
    bottom: -1px; left: -1px;
    width: 12px; height: 12px;
    border-bottom: 1px solid var(--accent-mint);
    border-left: 1px solid var(--accent-mint);
    opacity: 0.7;
}
.hud-icon-img {
    width: 84px;
    height: 84px;
    object-fit: contain;
    border-radius: 12px;
}
.hud-icon-fallback {
    width: 84px;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    opacity: 0.4;
}

/* Stats row */
.hud-detail-stats {
    border-top: 1px dashed rgba(255,255,255,0.08);
    padding-top: 12px;
}
.hud-stat-item {
    min-width: 56px;
}
.hud-stat-num {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-mint);
    letter-spacing: 1px;
    margin-top: 2px;
}

/* Title + desc */
.hud-detail-title {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: var(--text-primary);
}
.hud-detail-desc {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

/* Category chips */
.hud-cat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.hud-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-mint);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 999px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.hud-chip:hover {
    background: rgba(16, 185, 129, 0.18);
    color: var(--accent-mint);
    text-decoration: none;
}

/* Tag pills */
.hud-tag-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.hud-tag-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.hud-tag-pill:hover {
    color: var(--text-mint);
    border-color: rgba(16, 185, 129, 0.3);
    text-decoration: none;
}

/* Buttons — glass + mint outline, consistent with the HUD aesthetic */
.hud-btn-primary,
.hud-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 11px 22px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 10px;
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.hud-btn-primary {
    color: var(--accent-mint);
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.45);
    box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.05),
                0 0 0 rgba(16, 185, 129, 0);
}
.hud-btn-primary:hover {
    color: var(--accent-mint-2);
    background: rgba(16, 185, 129, 0.16);
    border-color: var(--accent-mint);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.18),
                inset 0 0 12px rgba(16, 185, 129, 0.08);
}
.hud-btn-primary .hud-btn-arrow {
    font-size: 14px;
    transition: transform 0.25s ease;
    opacity: 0.85;
}
.hud-btn-primary:hover .hud-btn-arrow {
    transform: translateX(3px);
    opacity: 1;
}

.hud-btn-outline {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
}
.hud-btn-outline:hover {
    color: var(--text-mint);
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.30);
    text-decoration: none;
}

/* Section header (related, etc.) */
.hud-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
}
.hud-section-bar {
    width: 4px;
    height: 22px;
    background: var(--accent-mint);
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
}
.hud-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--text-primary);
}

/* Rich content (post body) */
.hud-rich-content {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 15px;
}
.hud-rich-content h1,
.hud-rich-content h2,
.hud-rich-content h3,
.hud-rich-content h4 {
    position: relative;
    padding-left: 14px;
    margin: 1.6em 0 0.8em;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}
.hud-rich-content h1 { font-size: 1.5rem; }
.hud-rich-content h2 { font-size: 1.25rem; }
.hud-rich-content h3 { font-size: 1.1rem; }
.hud-rich-content h4 { font-size: 1rem; }
.hud-rich-content h1::before,
.hud-rich-content h2::before,
.hud-rich-content h3::before,
.hud-rich-content h4::before {
    content: "";
    position: absolute;
    left: 0; top: 0.25em;
    width: 3px;
    height: 0.9em;
    background: var(--accent-mint);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
.hud-rich-content p { margin-bottom: 1em; }
.hud-rich-content ul,
.hud-rich-content ol {
    padding-left: 1.4em;
    margin-bottom: 1em;
}
.hud-rich-content ul li { list-style: none; position: relative; }
.hud-rich-content ul li::before {
    content: "▸";
    position: absolute;
    left: -1.2em;
    color: var(--accent-mint);
    opacity: 0.7;
}
.hud-rich-content a {
    color: var(--text-mint);
    text-decoration: none;
    border-bottom: 1px dashed rgba(16, 185, 129, 0.4);
    transition: all 0.2s ease;
}
.hud-rich-content a:hover {
    color: var(--accent-mint);
    opacity: 1;
    border-bottom-color: var(--accent-mint);
}
.hud-rich-content table { width: 100%; margin-bottom: 1.5rem; border-collapse: collapse; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--glass-border); font-size: 0.9rem; }
.hud-rich-content th, .hud-rich-content td { padding: 12px 15px; border: 1px solid var(--glass-border); text-align: left; }
.hud-rich-content th { background: rgba(0, 243, 255, 0.05); color: var(--accent-cyan); text-transform: uppercase; font-size: 0.75rem; letter-spacing: 1px; font-weight: 600; }
.hud-rich-content tr:nth-child(even) { background: rgba(255, 255, 255, 0.01); }
.hud-rich-content tr:hover { background: rgba(0, 243, 255, 0.02); }
.hud-rich-content blockquote {
    margin: 1.2em 0;
    padding: 14px 20px;
    background: rgba(16, 185, 129, 0.05);
    border-left: 3px solid var(--accent-mint);
    border-radius: 6px;
    color: var(--text-secondary);
}
.hud-rich-content code {
    padding: 2px 6px;
    font-family: var(--font-mono);
    font-size: 0.92em;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    color: var(--text-mint);
}
.hud-rich-content pre {
    padding: 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow-x: auto;
}
.hud-rich-content pre code {
    background: transparent;
    padding: 0;
    color: var(--text-primary);
}
.hud-rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 0.8em 0;
}

/* Ad slot placeholder */
.hud-ad-slot {
    min-height: 1px;
}
.hud-ad-slot:empty { display: none; }

/* Mobile tweaks */
@media (max-width: 767px) {
    .hud-detail-title { font-size: 1.5rem; }
    .hud-icon-frame { width: 100px; height: 100px; }
    .hud-icon-img,
    .hud-icon-fallback { width: 70px; height: 70px; }
    .hud-btn-primary,
    .hud-btn-outline { padding: 10px 18px; font-size: 12px; }
}


/* --- FINAL MOBILE ALIGNMENT OVERRIDE (FORCE 12px) --- */
@media (max-width: 768px) {
    #bagua-app {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .main-footer {
        margin-left: 12px !important;
        margin-right: 12px !important;
    }
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    .bagua-top-nav {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* Mini Code Blocks for Sidebar */
.hud-code-mini {
    background: rgba(0, 0, 0, 0.3) !important;
    padding: 8px !important;
    border: 1px solid rgba(0, 243, 255, 0.2) !important;
    margin-bottom: 10px !important;
    border-radius: 4px !important;
}
.hud-code-mini code {
    font-size: 11px !important;
    color: var(--accent-cyan) !important;
}
