:root {
    --primary-color: #ff3366;
    --secondary-color: #ff9933;
    --dark-bg: #0a0a1a;
    --card-bg: rgba(20, 20, 40, 0.9);
    --text-color: #ffffff;
    --text-secondary: #aaa;
    --border-color: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

body {
    background: var(--dark-bg);
    color: var(--text-color);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(100, 0, 100, 0.2) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 100, 150, 0.2) 0%, transparent 20%);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* 移动端抽屉导航打开时禁止页面滚动 */
html.no-scroll,
body.no-scroll {
    overflow: hidden;
    height: 100%;
}

/* 打开手机导航时，强制隐藏文章页的二维码弹层，避免挡住导航 */
body.menu-open .article-qr-trigger,
body.menu-open .article-qr-trigger .article-qr-popup {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部栏 */
.article-header-bar {
    background: linear-gradient(to bottom, rgba(10, 10, 26, 0.95), rgba(10, 10, 26, 0.8));
    backdrop-filter: blur(5px);
    border-bottom: 1px solid rgba(255, 0, 100, 0.3);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.mobile-menu-btn {
    display: none;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    margin-left: auto;
}

.article-tabs {
    flex: 0 0 auto;
    overflow-x: auto;
    margin-left: auto;
}

.article-tabs .nav-tabs {
    width: auto;
    min-width: 0;
    border: none;
    background: transparent;
    gap: 10px;
}

.article-tabs .nav-tab {
    border: none;
    background: transparent;
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: none;
    transition: color 0.2s;
    text-decoration: none;
}

.article-tabs .nav-tab:hover {
    background: transparent !important;
    color: #ff3366 !important;
}

.article-tabs .nav-tab.active {
    color: var(--primary-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: var(--text-color);
}

.game-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.5);
}

.game-title-container {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.game-title {
    font-size: 22px;
    font-weight: bold;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 10px rgba(255, 51, 102, 0.5);
    line-height: 1;
}

.game-subtitle {
    font-size: 12px;
    color: #ffcc00;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-buttons {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(255, 51, 102, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-btn.secondary {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255,255,255,0.15);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 51, 102, 0.6);
}

/* 面包屑 */
.breadcrumb {
    padding: 20px 0 10px;
    color: var(--text-secondary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.breadcrumb a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.breadcrumb-icon {
    color: var(--primary-color);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb .separator {
    margin: 0 8px;
}

.breadcrumb .current {
    color: var(--primary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

/* 主体布局 */
.article-main {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(220px, 0.8fr);
    gap: 24px;
    margin: 10px 0 50px;
}

/* 文章内容 */
.article-content {
    display: block !important; /* 覆盖 style.css 中的 flex 布局 */
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 32px;
    border: 1px solid var(--border-color);
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    overflow: visible; /* 确保弹出层不被裁剪 */
}

.article-header {
    margin-bottom: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible; /* 确保弹出层不被裁剪 */
}

.article-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.article-title {
    font-size: 30px;
    color: var(--text-color);
    margin: 0;
    line-height: 1.35;
    flex: 1;
    min-width: 0;
    word-break: break-word;
    overflow: hidden;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
    flex-wrap: nowrap;
    overflow-x: hidden; /* 禁止横向滚动 */
    overflow-y: visible; /* 允许垂直方向溢出，确保弹出层可见 */
}

.article-meta span {
    white-space: nowrap;
    flex-shrink: 0;
}

.article-edit-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.article-edit-link:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.article-qr-trigger {
    position: relative;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    z-index: 1001; /* 提高z-index，确保触发元素在正确的层级 */
}

.article-qr-trigger:hover {
    color: var(--primary-color);
}

.article-qr-trigger .article-qr-popup {
    position: fixed; /* 使用fixed定位，避免被父元素裁剪 */
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 9000; /* 略低于移动端导航抽屉，避免覆盖导航 */
    min-width: 180px;
    text-align: center;
    white-space: nowrap;
    transform: translateX(-50%);
}

.article-qr-trigger:hover .article-qr-popup,
.article-qr-trigger .article-qr-popup.show {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.qr-popup-label {
    color: var(--primary-color);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
    text-align: center;
}

.article-qr-popup img {
    width: 160px;
    height: 160px;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

.article-tag {
    background-color: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.article-body {
    font-size: 16px;
    line-height: 1.75;
    color: #e5e7eb;
    word-break: break-word;
    margin-top: 20px;
}

.article-body h2 {
    color: var(--primary-color);
    margin: 28px 0 14px;
    font-size: 22px;
}

.article-body h3 {
    color: var(--secondary-color);
    margin: 22px 0 12px;
    font-size: 19px;
}

.article-body p {
    margin-bottom: 16px;
}

.article-body ul,
.article-body ol {
    margin: 12px 0 16px 26px;
}

.article-body li {
    margin-bottom: 8px;
}

.article-footer {
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.article-footer .share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.article-footer .article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 18px;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.4);
}

.share-btn.wechat {
    background: linear-gradient(45deg, #07c160, #06ad56);
}

.share-btn.qq {
    background: linear-gradient(45deg, #12b7f5, #0ea5d9);
}

.share-btn.weibo {
    background: linear-gradient(45deg, #e6162d, #c91428);
}

.share-btn.link {
    background: linear-gradient(45deg, #667eea, #764ba2);
}

/* 侧边栏 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.sidebar-widget {
    background-color: var(--card-bg);
    border-radius: 15px;
    padding: 22px;
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
}

.widget-title {
    color: var(--primary-color);
    font-size: 17px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-articles {
    list-style: none;
}

.related-article {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.related-article:last-child {
    border-bottom: none;
}

.related-article a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
}

.related-article a:hover {
    color: var(--primary-color);
}

.related-article .date {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 5px;
}

.game-info {
    text-align: center;
}

.game-info .download-btn {
    width: 100%;
    margin-top: 14px;
    justify-content: center;
}

.game-info .download-qr {
    margin-top: 20px;
    border: none !important;
}

.qr-code {
    position: relative;
    margin-top: 18px;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 10px;
    text-align: center;
    overflow: hidden;
}

.qr-code img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.qr-code p {
    color: #fff;
    margin-top: 8px;
    font-weight: bold;
}

.qr-scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    box-shadow: 0 0 10px var(--primary-color);
    animation: qrScan 2s infinite linear;
    pointer-events: none;
}

@keyframes qrScan {
    0% { transform: translateY(0); opacity: 0.9; }
    50% { transform: translateY(160px); opacity: 0.6; }
    100% { transform: translateY(0); opacity: 0.9; }
}

.qr-placeholder {
    width: 160px;
    height: 160px;
    background: linear-gradient(45deg, #f0f0f0, #e0e0e0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    color: #333;
    font-weight: bold;
    margin: 0 auto;
    border-radius: 10px;
}

/* 返回顶部 */
/* 提示框样式 */
.toast-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    min-width: 280px;
    max-width: 90%;
}

.toast-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-notification.toast-success {
    border-left: 4px solid #10b981;
}

.toast-notification.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-notification.toast-success .toast-icon {
    color: #10b981;
}

.toast-notification.toast-error .toast-icon {
    color: #ef4444;
}

.toast-message {
    color: var(--text-color);
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.return-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 51, 102, 0.4);
    transition: transform 0.3s;
    z-index: 99;
}

.return-top:hover {
    transform: translateY(-4px);
}

/* 悬浮按钮（文章页覆盖，避免与返回顶部重叠） */
.right-floating-buttons {
    position: fixed;
    bottom: 96px;
    right: 26px;
    z-index: 120;
}

.return-top-floating {
    display: none; /* 默认隐藏，桌面端显示 */
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(255, 51, 102, 0.35);
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
    margin-top: 12px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
}

.return-top-floating:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(255, 51, 102, 0.45);
}

.return-top-floating.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* 隐藏移动端的 footer 分隔符“丨” */
.mobile-hidden {
    display: inline;
}

@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
    #footerReturnTop {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }
    .return-top-floating {
        display: none !important;
    }
}

@media (min-width: 769px) {
    #footerReturnTop {
        display: none;
    }
    .return-top-floating {
        display: flex;
    }
}

/* 页脚 */
footer {
    background-color: rgba(10, 10, 20, 0.95);
    padding: 34px 0;
    border-top: 1px solid rgba(255, 0, 100, 0.3);
    margin-top: 30px;
}

.footer-content {
    text-align: center;
}

.footer-game-title {
    font-size: 28px;
    margin-bottom: 12px;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-record {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 10px;
}

.footer-tips {
    color: var(--text-secondary);
    font-size: 12px;
    margin: 10px 0 6px;
    line-height: 1.6;
}

.mobile-hidden {
    display: inline;
}

@media (max-width: 768px) {
    .mobile-hidden {
        display: none;
    }
}
.footer-record a {
    color: inherit;
    text-decoration: none;
}

/* 文章页不使用右侧悬浮按钮与返回顶部的浮动定位 */
.right-floating-buttons {
    position: fixed;
    bottom: 96px;
    right: 26px;
    z-index: 98;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    pointer-events: none;
}

.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(78vw, 280px);
    height: 100vh;
    background: #11101d;
    z-index: 9999;
    box-shadow: -4px 0 15px rgba(0,0,0,0.35);
    border-left: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    pointer-events: none;
    transform: translateX(105%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.25s ease, opacity 0.25s ease, visibility 0.25s ease;
}

.mobile-menu.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    color: #fff;
    font-weight: 600;
}

.close-mobile-menu {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.mobile-menu-list {
    padding: 12px 14px 18px;
    overflow-y: auto;
    flex: 1;
}

.mobile-menu-item {
    display: block;
    padding: 10px 12px;
    color: #e5e7eb;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-item.active,
.mobile-menu-item:hover {
    background: rgba(255,51,102,0.15);
    border-color: rgba(255,51,102,0.35);
    color: #fff;
}

@media (max-width: 992px) {
    .article-main {
        display: block;           /* 移动端取消 grid 布局，避免标题区域被压缩 */
        grid-template-columns: 1fr;
    }
    /* 移动端文章内容与侧边栏之间增加间距 */
    .article-content {
        margin-bottom: 18px;
    }
    .article-content {
        padding: 26px;
    }
    .article-tabs {
        display: none;
    }
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    .nav-buttons {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 12px;
    }
    .nav-buttons {
        width: 100%;
        justify-content: center;
    }
    .article-content {
        padding: 22px;
    }
    .article-title {
        font-size: 24px;
        word-break: break-word;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2; /* 最多显示两行 */
        -webkit-box-orient: vertical;
        text-overflow: ellipsis;
    }
    .article-title-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    .article-meta {
        gap: 8px;
        font-size: 11px;
        overflow-x: hidden; /* 移动端也禁止横向滚动 */
        flex-wrap: wrap;
        max-width: 100%;
    }
    
    .article-meta span {
        font-size: 11px;
        flex-shrink: 1; /* 允许缩小以适应容器 */
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .article-meta .article-qr-trigger {
        flex-shrink: 0; /* 二维码图标不缩小 */
    }
    .article-footer {
        gap: 12px;
    }
    .article-footer .share-buttons {
        gap: 8px;
    }
    .article-footer .share-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    .article-footer .article-meta {
        font-size: 11px;
        gap: 12px;
        flex-direction: column;
        align-items: flex-start;
    }
    .toast-notification {
        top: 10px;
        min-width: 240px;
        padding: 12px 20px;
    }
    .toast-message {
        font-size: 13px;
    }
    .download-qr {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    .article-content {
        padding: 18px;
    }
    .article-title {
        font-size: 20px;
    }
    .article-meta {
        gap: 6px;
        font-size: 10px;
        overflow-x: hidden; /* 小屏幕也禁止横向滚动 */
    }
    .article-meta span {
        font-size: 10px;
    }
    .article-footer .share-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    .article-footer .article-meta {
        font-size: 10px;
        gap: 8px;
    }
    .toast-notification {
        top: 10px;
        min-width: 200px;
        padding: 10px 16px;
    }
    .toast-icon {
        font-size: 20px;
    }
    .toast-message {
        font-size: 12px;
    }
    .nav-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
    .sidebar-widget {
        padding: 18px;
    }
    .related-article .date {
        font-size: 11px;
    }
    .return-top {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }
}
