/* Minecraft 风格资源详情页样式 */
body {
    padding-top: 60px;
    font-family: 'VT323', monospace;
    color: #FFF;
}

.detail-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
    z-index: 10;
}

/* 布局 */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 300px; /* 左侧列固定占用剩余空间 */
    gap: 2rem;
    max-width: 1350px;
    margin: 0 auto;
    width: 100%;
    align-items: start;
}

@media (max-width: 900px) {
    .detail-grid {
        grid-template-columns: 1fr; /* Stack on smaller screens */
    }
}

.detail-main {
    background: rgba(30, 30, 30, 0.95);
    border: 3px solid #555;
    border-top-color: #666;
    border-left-color: #666;
    border-bottom-color: #333;
    border-right-color: #333;
    padding: 0;
    min-height: 600px;
    box-shadow: 0 4px 0 rgba(0,0,0,0.5);
    min-width: 0;
    width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    overflow: hidden;
}

/* 图片灯箱样式 */
.lightbox {
    display: none;
    position: fixed; /* Fixed to viewport */
    z-index: 9999; /* Ensure top layer */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Disable scrolling on container, let flex handle it */
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.lightbox.active {
    display: flex;
}

.lightbox-content {
    /* Removed redundant styles */
    max-width: 90%;
    max-height: 90vh;
}

#lightboxImage {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border: 2px solid #FFF;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    border-radius: 4px;
}

/* 增加图片悬停反馈 */
.detail-content img {
    max-width: 100%;
    height: auto;
    border: 2px solid #333;
    margin: 1rem 0;
    display: block;
    cursor: zoom-in; /* Show pointer/zoom icon */
    transition: transform 0.2s, box-shadow 0.2s;
}

.detail-content img:hover {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
    transform: scale(1.01);
}

.detail-content pre {
    overflow-x: auto; /* Allow scrolling for code blocks */
    max-width: 100%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 内容区域文本换行 */
.detail-content {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    padding: 2rem;
}

.detail-content p,
.detail-content div,
.detail-content span,
.detail-content li,
.detail-content td,
.detail-content th {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.detail-content::before {
    content: "详细介绍";
    display: block;
    font-size: 1.5rem;
    color: #AAA;
    margin: -2rem -2rem 1.5rem -2rem;
    padding: 0.8rem 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid #444;
    font-weight: 400;
    text-shadow: 1px 1px 0 #000;
    letter-spacing: 1px;
}

.detail-sidebar {
    position: sticky;
    top: 80px;
}

.sidebar-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* 资源头部 - 与内容区融为一体 */
.detail-header {
    background: linear-gradient(180deg, rgba(60, 60, 60, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
    border-bottom: 3px solid #333;
    padding: 1.5rem 2rem;
    margin-bottom: 0;
    position: relative;
}

/* 标题区域 */
.resource-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.resource-title-group {
    flex: 1;
    min-width: 0;
}

.resource-title {
    font-size: 2.4rem;
    font-weight: 400;
    color: #FFFF55;
    line-height: 1.2;
    margin: 0;
    text-shadow: 2px 2px 0 #000;
}

/* 元信息区域 */
.resource-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.resource-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.4);
    padding: 0.4rem 0.8rem;
    color: #CCC;
    font-size: 1.2rem;
}

.resource-meta-item:hover {
    background: rgba(0, 0, 0, 0.5);
}

.resource-author-meta .icon-svg {
    width: 1.1rem;
    height: 1.1rem;
}

.resource-level-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 1px 6px;
    border: 1px solid currentColor;
    background: rgba(255, 255, 255, 0.04);
    font-size: 1rem;
    line-height: 1;
}

.resource-tier-bronze { color: #c78a52; }
.resource-tier-silver { color: #b8c2cc; }
.resource-tier-gold { color: #e0c060; }
.resource-tier-emerald { color: #63d68b; }
.resource-tier-diamond { color: #80d8e8; }

.resource-like-btn {
    min-width: 52px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 10px;
    border: 2px solid #222;
    border-top-color: #777;
    border-left-color: #777;
    background: #4a4a4a;
    color: #ddd;
    font-family: 'VT323', monospace;
    font-size: 1.15rem;
    cursor: pointer;
}

.resource-like-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.resource-like-btn:hover,
.resource-like-btn:focus-visible {
    background: #606060;
    color: #fff;
    outline: 2px solid #ffff55;
    outline-offset: 2px;
}

.resource-like-btn.active {
    border-color: #7a2929;
    background: #6b3030;
    color: #ffb0a8;
}

.resource-like-btn:disabled {
    cursor: wait;
    opacity: 0.6;
}

.back-btn {
    padding: 0.5rem 1rem;
    background-color: #555;
    border: 2px solid #000;
    border-top-color: #777;
    border-left-color: #777;
    border-bottom-color: #333;
    border-right-color: #333;
    color: #FFF;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-shadow: 1px 1px 0 #000;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: none;
    flex-shrink: 0;
}

.back-btn:hover {
    background-color: #777;
    color: #FFFF55;
    border-color: #FFF;
}

.back-btn:active {
    background-color: #333;
    border-top-color: #222;
    border-left-color: #222;
    border-bottom-color: #AAA;
    border-right-color: #AAA;
    transform: translateY(2px);
}


.resource-meta-label {
    color: #AAA;
}

.resource-meta-value {
    color: #FFF;
}

.resource-plugin {
    color: #55FF55; /* Green */
    font-weight: 400;
    text-shadow: 1px 1px 0 #000;
}

/* 权限状态样式优化 */
.access-message {
    font-size: 1.2rem;
    padding: 0.5rem 1rem;
    background: rgba(0,0,0,0.6);
    border: 2px solid #555;
    color: #FFAA00;
    text-shadow: 1px 1px 0 #000;
    display: inline-block;
    box-shadow: 2px 2px 0 #000;
}

.access-message.success {
    color: #55FF55;
    border-color: #00AA00;
}

.access-message.error {
    color: #FF5555;
    border-color: #AA0000;
}

/* 侧边栏面板样式优化 */
.info-panel {
    background: rgba(30, 30, 30, 0.9); /* 深色背景，不透明 */
    border: 2px solid #888; /* 亮色边框 */
    overflow: hidden;
    box-shadow: 0 6px 0 rgba(0,0,0,0.6);
    margin-bottom: 1.5rem;
}

.panel-header {
    padding: 1rem;
    background: #444; /* 明显的标题栏背景 */
    border-bottom: 2px solid #888;
}

.panel-title {
    font-size: 1.4rem;
    font-weight: 400;
    margin: 0;
    color: #FFF;
    text-shadow: 2px 2px 0 #000;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.panel-body {
    padding: 1.5rem;
    background: rgba(20, 20, 20, 0.95);
}

/* 版本信息 */
.version-info-panel .current-version-info {
    text-align: center;
}

.version-badge {
    margin-bottom: 1rem;
}

.version-label {
    display: block;
    color: #AAA;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.version-number {
    font-size: 2.5rem;
    color: #FFAA00; /* Gold */
    font-weight: 400;
    text-shadow: 2px 2px 0 #000;
}

.version-status {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    background: #00AA00;
    color: #FFF;
    border: 2px solid #55FF55;
    font-size: 1rem;
}

/* 下载统计 */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    border-bottom: 1px dashed #555;
    padding-bottom: 0.5rem;
}

.stat-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.stat-label {
    color: #AAA;
}

.stat-value {
    font-size: 1.2rem;
    color: #FFF;
    font-weight: 400;
}

/* 更新公告 */
.update-content {
    font-size: 1rem;
    color: #CCC;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
}

/* 侧边栏按钮 */
.sidebar-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background-color: #7F7F7F;
    border: 2px solid #000;
    border-top-color: #FFF;
    border-left-color: #FFF;
    border-bottom-color: #555;
    border-right-color: #555;
    color: #FFF;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    text-shadow: 2px 2px 0px #3f3f3f;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-btn:hover {
    background-color: #8FA0CC;
    color: #ffffa0;
}

.sidebar-btn:active {
    background-color: #555;
    border-top-color: #555;
    border-left-color: #555;
    border-bottom-color: #FFF;
    border-right-color: #FFF;
    transform: translateY(2px);
}

.sidebar-btn:last-child {
    margin-bottom: 0;
}

/* 管理员快速编辑按钮 */
.admin-edit-btn {
    display: none; /* 默认隐藏，由 JS 验证权限后显示 */
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background-color: #FF5555; /* Red */
    border: 2px solid #000;
    border-top-color: #FFAA00;
    border-left-color: #FFAA00;
    border-bottom-color: #AA0000;
    border-right-color: #AA0000;
    color: #FFF;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.4rem;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
    z-index: 100;
    text-shadow: 1px 1px 0 #000;
}

.admin-edit-btn:hover {
    background-color: #FFAAAA;
}

/* 快速编辑模态框 */
.quick-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.quick-edit-content {
    background: #C6C6C6; /* MC GUI Grey */
    border: 2px solid #000;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 0 4px #555;
    color: #000; /* Text in GUI is black usually */
}

.quick-edit-header {
    padding: 1rem;
    border-bottom: 2px solid #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #C6C6C6;
}

.quick-edit-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #404040;
    text-shadow: none;
}

.quick-edit-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #404040;
    line-height: 1;
}

.quick-edit-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
    background: #C6C6C6;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #404040;
    font-size: 1.2rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #808080;
    border-right-color: #FFF;
    border-bottom-color: #FFF;
    background: #000;
    color: #FFF;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    border-radius: 0;
}

.form-input:focus {
    border-color: #A0A0A0;
    outline: none;
}

.char-count {
    text-align: right;
    font-size: 0.9rem;
    color: #555;
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 1rem;
}

.quick-edit-footer {
    padding: 1rem;
    border-top: 2px solid #555;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: #C6C6C6;
}

.btn-save {
    padding: 0.5rem 1.5rem;
    background-color: #7F7F7F;
    border: 2px solid #000;
    border-top-color: #FFF;
    border-left-color: #FFF;
    border-bottom-color: #555;
    border-right-color: #555;
    color: #FFF;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
}

.btn-cancel {
    padding: 0.5rem 1.5rem;
    background: none;
    border: none;
    color: #404040;
    cursor: pointer;
    font-family: 'VT323', monospace;
    font-size: 1.2rem;
    text-decoration: underline;
}

/* Fix TinyMCE menu z-index issue in modal */
.tox-tinymce-aux {
    z-index: 2100 !important;
}

/* 授权码显示弹窗样式优化 */
#licenseCodeModal .quick-edit-content {
    background: #C6C6C6;
    border: 2px solid #000;
    box-shadow: 0 0 0 4px #555;
    color: #000;
}

#licenseCodeModal .quick-edit-header {
    background: #C6C6C6;
    border-bottom: 2px solid #555;
    padding: 1rem;
}

#licenseCodeModal .quick-edit-header h3 {
    color: #404040;
    text-shadow: none;
    font-size: 1.5rem;
}

#licenseCodeModal .quick-edit-body {
    background: #C6C6C6;
    padding: 1.5rem;
}

#licenseCodeModal .license-display-box {
    background: #000;
    border: 2px solid #FFF;
    border-radius: 0;
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

#licenseCodeDisplay {
    font-family: 'VT323', monospace;
    font-size: 2rem;
    font-weight: 400;
    color: #55FFFF; /* Aqua */
    word-break: break-all;
    line-height: 1.2;
    text-shadow: 2px 2px 0 #000;
    flex: 1;
    text-align: left;
}

#copyLicenseBtn {
    position: static;
    background-color: #7F7F7F; /* Stone Grey */
    border-top-color: #DDD;
    border-left-color: #DDD;
    border-bottom-color: #555;
    border-right-color: #555;
    color: #FFF;
    text-shadow: 2px 2px 0 #3f3f3f;
    border-width: 2px;
    border-style: solid;
    border-color: #000; /* Base border */
    /* Re-apply specific borders above */
    padding: 0.5rem 1rem;
    border-radius: 0;
    font-size: 1.2rem;
    cursor: pointer;
    font-family: 'VT323', monospace;
    box-shadow: 2px 2px 0 #000;
    white-space: nowrap;
    flex-shrink: 0;
}

#copyLicenseBtn:hover {
    background-color: #8FA0CC; /* MC Hover Blue */
    color: #FFFFA0;
    text-shadow: 2px 2px 0 #3a3a2a;
    border-color: #FFF;
    transform: translateY(-2px);
}

#licenseCodeModal .success-text {
    font-size: 1.4rem;
    color: #00AA00; /* Green */
    margin-bottom: 1rem;
    text-shadow: none;
    font-weight: bold;
}

/* Sidebar Update Notice Styles */
.update-header {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    border-bottom: 1px dashed #555;
    padding-bottom: 0.5rem;
}

.update-version {
    font-size: 1.4rem;
    color: #FFAA00; /* Gold */
    text-shadow: 1px 1px 0 #000;
}

.update-date {
    color: #AAA;
    font-size: 1.1rem; /* Increased size */
}

.update-body {
    color: #CCC;
    line-height: 1.5;
    font-size: 1.1rem;
}

#licenseCodeModal .tip-text {
    font-size: 1.1rem;
    color: #555;
    line-height: 1.5;
    text-shadow: none;
}

/* ==================== Tab切换栏样式 ==================== */
.detail-tabs {
    display: flex;
    gap: 0;
    background: rgba(40, 40, 40, 0.95);
    border-bottom: 3px solid #333;
    padding: 0;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #AAA;
    font-family: 'VT323', monospace;
    font-size: 1.3rem;
    cursor: pointer;
    transition: none;
    margin-bottom: -3px;
    text-shadow: 1px 1px 0 #000;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFF;
}

.tab-btn.active {
    background: rgba(85, 255, 85, 0.1);
    color: #55FF55;
    border-bottom-color: #55FF55;
}

.tab-btn svg {
    opacity: 0.7;
}

.tab-btn.active svg {
    opacity: 1;
}

/* Tab内容区域 */
.tab-content-wrapper {
    position: relative;
    width: 1018px;
}

.tab-content {
    display: none;
    width: 1018px;
    box-sizing: border-box;
}

.tab-content.active {
    display: block;
}

/* 移除详细介绍Tab的伪元素标题（因为已有Tab标签） */
.detail-content.tab-content::before {
    display: none;
}

/* ==================== Wiki文档样式（左侧悬浮大纲） ==================== */
.wiki-content {
    padding: 1.5rem;
    min-height: 500px;
    box-sizing: border-box;
    position: relative;
}

/* 左侧悬浮大纲导航 - 固定在内容区域左侧 */
.wiki-outline-floating {
    position: fixed;
    /* 计算位置：(视口宽度 - 容器最大宽度) / 2 - 大纲宽度 - 间距 */
    /* 容器最大宽度1400px，大纲宽度220px，间距2rem(32px) */
    left: calc((100vw - 1400px) / 2 - 220px - 32px);
    top: 50%;
    transform: translateY(-50%);
    width: 220px;
    max-height: 60vh;
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #444;
    display: flex;
    flex-direction: column;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* 当视口宽度不足以显示左侧大纲时，调整位置 */
@media (max-width: 1700px) {
    .wiki-outline-floating {
        /* 视口较小时，固定在左侧边缘 */
        left: 20px;
    }
}

/* 小窗口时转为可折叠的顶部导航 */
@media (max-width: 1200px) {
    .wiki-outline-floating {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        width: 100%;
        max-height: none;
        margin-bottom: 1rem;
        border-radius: 0;
    }

    .wiki-outline-floating.collapsed .wiki-outline-nav {
        display: none;
    }

    .wiki-outline-floating .wiki-outline-toggle {
        display: flex;
    }

    .wiki-outline-nav {
        max-height: 300px;
        overflow-y: auto;
    }
}

/* 大屏幕时隐藏折叠按钮 */
@media (min-width: 1201px) {
    .wiki-outline-floating .wiki-outline-toggle {
        display: none;
    }
}

/* 目录折叠按钮样式 */
.wiki-outline-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid #333;
    color: #AAA;
    font-size: 1.1rem;
    cursor: pointer;
    user-select: none;
}

.wiki-outline-toggle:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #FFF;
}

.wiki-outline-toggle-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: #55FF55;
    margin-right: 0.5rem;
}

.wiki-outline-toggle-text {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wiki-outline-toggle-arrow {
    width: 1rem;
    height: 1rem;
    transition: transform 0.2s ease;
}

.wiki-outline-floating.collapsed .wiki-outline-toggle-arrow {
    transform: rotate(-90deg);
}

.wiki-outline-header {
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #AAA;
    font-size: 1.1rem;
}

.wiki-outline-icon {
    width: 1.2rem;
    height: 1.2rem;
    color: #55FF55;
}

.wiki-outline-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.wiki-outline-empty {
    padding: 1rem;
    color: #666;
    text-align: center;
    font-size: 1rem;
}

.wiki-outline-item {
    display: block;
    padding: 0.5rem 1rem;
    color: #AAA;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    border-left: 2px solid transparent;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wiki-outline-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFF;
}

.wiki-outline-item.active {
    background: rgba(85, 255, 85, 0.1);
    color: #55FF55;
    border-left-color: #55FF55;
}

/* 大纲层级缩进 */
.wiki-outline-item[data-level="1"] {
    padding-left: 1rem;
    font-size: 1.1rem;
    color: #FFFF55;
}

.wiki-outline-item[data-level="2"] {
    padding-left: 1.5rem;
    font-size: 1rem;
}

.wiki-outline-item[data-level="3"] {
    padding-left: 2rem;
    font-size: 0.95rem;
    color: #888;
}

/* 文档主内容区 */
.wiki-document {
    width: 100%;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid #444;
}

.wiki-document-content {
    flex: 1;
    padding: 1.5rem 2rem;
    overflow-y: auto;
    line-height: 1.8;
}

.wiki-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: #666;
    text-align: center;
}

.wiki-placeholder-icon {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.wiki-placeholder p {
    font-size: 1.2rem;
    margin: 0;
}

/* Wiki文档内容样式 */
.wiki-document-content h1,
.wiki-document-content h2,
.wiki-document-content h3 {
    color: #FFFF55;
    text-shadow: 2px 2px 0 #000;
    margin-top: 2rem;
    margin-bottom: 1rem;
    scroll-margin-top: 1rem;
}

.wiki-document-content h1 {
    font-size: 2rem;
    border-bottom: 2px solid #444;
    padding-bottom: 0.5rem;
}

.wiki-document-content h2 {
    font-size: 1.6rem;
    border-bottom: 1px solid #333;
    padding-bottom: 0.3rem;
}

.wiki-document-content h3 {
    font-size: 1.3rem;
}

.wiki-document-content p {
    line-height: 1.8;
    margin-bottom: 1rem;
    color: #CCC;
}

.wiki-document-content code {
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.4rem;
    border: 1px solid #444;
    color: #55FFFF;
    font-family: 'VT323', monospace;
}

.wiki-document-content pre {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #444;
    padding: 1rem;
    overflow-x: auto;
    margin: 1rem 0;
}

.wiki-document-content pre code {
    background: none;
    border: none;
    padding: 0;
}

.wiki-document-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

.wiki-document-content th,
.wiki-document-content td {
    padding: 0.6rem 0.8rem;
    border: 2px solid #444;
    text-align: left;
}

.wiki-document-content th {
    background: rgba(0, 0, 0, 0.4);
    color: #FFAA00;
}

.wiki-document-content td {
    background: rgba(0, 0, 0, 0.2);
}

.wiki-document-content ul,
.wiki-document-content ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    color: #CCC;
}

.wiki-document-content li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
    padding: 0.1rem 0;
}

.wiki-document-content blockquote {
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    border-left: 3px solid #55FF55;
    background: rgba(85, 255, 85, 0.05);
    color: #AAA;
}

.wiki-document-content img {
    max-width: 100%;
    height: auto;
    border: 2px solid #444;
    margin: 1rem 0;
}

.wiki-document-content a {
    color: #55FFFF;
    text-decoration: none;
}

.wiki-document-content a:hover {
    color: #AAFFFF;
    text-decoration: underline;
}

/* Wiki折叠块样式 */
.wiki-details {
    margin: 1rem 0;
    border: 2px solid #444;
    background: rgba(0, 0, 0, 0.3);
}

.wiki-details-summary {
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    color: #FFAA00;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    user-select: none;
    border-bottom: 2px solid transparent;
}

.wiki-details-summary::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 6px solid #FFAA00;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    transition: transform 0.2s ease;
}

.wiki-details[open] .wiki-details-summary::before {
    transform: rotate(90deg);
}

.wiki-details-summary:hover {
    background: rgba(0, 0, 0, 0.5);
    color: #FFCC00;
}

.wiki-details[open] .wiki-details-summary {
    border-bottom-color: #333;
}

.wiki-details-content {
    padding: 1rem;
}

.wiki-details-content > *:first-child {
    margin-top: 0;
}

.wiki-details-content > *:last-child {
    margin-bottom: 0;
}

/* Wiki文档标题样式 */
.wiki-doc-title {
    font-size: 2.2rem;
    color: #FFFF55;
    text-shadow: 2px 2px 0 #000;
    margin: 0 0 1.5rem 0;
    padding-bottom: 1rem;
    border-bottom: 3px solid #444;
}

/* Wiki无内容提示 */
.wiki-no-content {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.wiki-no-content-icon {
    width: 5rem;
    height: 5rem;
    margin-bottom: 1rem;
    opacity: 0.4;
}

.wiki-no-content p {
    font-size: 1.3rem;
    margin: 0;
}

/* ==================== 版本历史样式 ==================== */
.versions-content {
    padding: 2rem;
    min-height: 500px;
    box-sizing: border-box;
}

.versions-container {
    padding: 0;
    width: 100%;
}

.versions-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #444;
}

.versions-title {
    font-size: 1.8rem;
    color: #FFFF55;
    margin: 0;
    text-shadow: 2px 2px 0 #000;
}

.versions-loading {
    text-align: center;
    padding: 2rem;
    color: #AAA;
    font-size: 1.2rem;
}

.versions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.version-item {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid #444;
    padding: 1rem 1.5rem;
}

.version-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.version-item-number {
    font-size: 1.4rem;
    color: #FFAA00;
    text-shadow: 1px 1px 0 #000;
}

.version-item-date {
    color: #888;
    font-size: 1.1rem;
}

.version-item-changes {
    color: #CCC;
    font-size: 1.1rem;
    line-height: 1.5;
}

.version-item-tag {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: #00AA00;
    color: #FFF;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.version-item-tag.latest {
    background: #55FF55;
    color: #000;
}

@media (max-width: 768px) {
    .wiki-document-content {
        padding: 1rem;
    }

    .detail-tabs {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1;
        justify-content: center;
        min-width: 100px;
    }
}

/* 访问控制按钮样式优化 - 统一原石风格 */
#accessActions button {
    padding: 0.6rem 1.2rem;
    font-size: 1.3rem;
    font-family: 'VT323', monospace;
    cursor: pointer;
    background-color: #7F7F7F; /* Stone Grey */
    border: 2px solid #000;
    border-top-color: #DDD;
    border-left-color: #DDD;
    border-bottom-color: #555;
    border-right-color: #555;
    color: #FFF;
    border-radius: 0;
    text-shadow: 2px 2px 0 #3f3f3f;
    transition: none; /* MC buttons are instant */
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
}

#accessActions button:hover {
    background-color: #8FA0CC; /* MC Hover Blue */
    color: #FFFFA0;
    text-shadow: 2px 2px 0 #3a3a2a;
    border-color: #FFF;
    transform: translateY(-2px); /* Optional lift effect */
}

#accessActions button:active {
    background-color: #555;
    border-top-color: #555;
    border-left-color: #555;
    border-bottom-color: #FFF;
    border-right-color: #FFF;
    color: #CCC;
    transform: translateY(2px);
}


/* 资源访问控制容器 */
.resource-access-control {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    vertical-align: middle;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.4rem 0.8rem;
    margin-left: auto;
}

/* 访问状态提示文本优化 */
#resourceAccessControl .access-message {
    font-size: 1.2rem;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    box-shadow: none;
    color: #FFAA00;
    text-shadow: 1px 1px 0 #000;
    display: block;
}

/* ==================== 多页Wiki目录样式 ==================== */

/* 文档目录标题 */
.wiki-directory-title {
    padding: 0.8rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid #333;
    color: #55FF55;
    font-size: 1.2rem;
    text-shadow: 1px 1px 0 #000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.wiki-directory-title::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2355FF55'%3E%3Cpath d='M3 13h2v-2H3v2zm0 4h2v-2H3v2zm0-8h2V7H3v2zm4 4h14v-2H7v2zm0 4h14v-2H7v2zM7 7v2h14V7H7z'/%3E%3C/svg%3E");
    background-size: contain;
}

/* 目录项 */
.wiki-dir-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: #AAA;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
    font-size: 1.05rem;
    gap: 0.5rem;
}

.wiki-dir-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFF;
}

.wiki-dir-item.active {
    background: rgba(85, 255, 85, 0.1);
    color: #55FF55;
    border-left-color: #55FF55;
}

/* 目录项图标 */
.wiki-dir-icon {
    font-size: 1rem;
    min-width: 1.2rem;
    text-align: center;
}

/* 目录项标题 */
.wiki-dir-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 目录层级缩进 */
.wiki-dir-item[data-level="0"] {
    padding-left: 1rem;
}

.wiki-dir-item[data-level="1"] {
    padding-left: 1.8rem;
    font-size: 1rem;
}

.wiki-dir-item[data-level="2"] {
    padding-left: 2.6rem;
    font-size: 0.95rem;
    color: #888;
}

.wiki-dir-item[data-level="3"] {
    padding-left: 3.4rem;
    font-size: 0.9rem;
    color: #777;
}

/* 子目录容器 */
.wiki-dir-children {
    border-left: 1px solid #333;
    margin-left: 1rem;
}

/* 首页标记 */
.wiki-dir-item[data-home="true"]::after {
    content: '';
    display: inline-block;
    width: 0.8rem;
    height: 0.8rem;
    margin-left: 0.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23FFAA00'%3E%3Cpath d='M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z'/%3E%3C/svg%3E");
    background-size: contain;
    opacity: 0.8;
}

/* Wiki页面标题样式 */
.wiki-page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #444;
}

.wiki-page-title {
    font-size: 2rem;
    color: #FFFF55;
    text-shadow: 2px 2px 0 #000;
    margin: 0;
}

/* Wiki加载状态 */
.wiki-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    color: #AAA;
}

.wiki-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #333;
    border-top-color: #55FF55;
    border-radius: 50%;
    animation: wiki-spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes wiki-spin {
    to {
        transform: rotate(360deg);
    }
}

.wiki-loading p {
    font-size: 1.2rem;
    margin: 0;
}
