/* ==================== 自定义字体 ==================== */
@font-face {
    font-family: 'UranusPixel';
    src: url('../drawable/uranus_pixel_11px.ttf') format('truetype');
}

/* ==================== 全局重置样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ==================== 页面基础样式 ==================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0a0a0a url('../drawable/bg.png') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    color: #e0e0e0;
}

/* ==================== 开场动画 ==================== */
/* 核心动画 */
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* 所有子元素依次出现 */
.container > * {
    opacity: 0;
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* 浮动导航栏不受开场动画影响 */
.container > header.floating-header {
    opacity: 1;
    animation: none;
}

/* 用 nth-child 控制延迟 */
.container > *:nth-child(1) { animation-delay: 0.05s; }
.container > *:nth-child(2) { animation-delay: 0.15s; }
.container > *:nth-child(3) { animation-delay: 0.25s; }
.container > *:nth-child(4) { animation-delay: 0.35s; }
.container > *:nth-child(5) { animation-delay: 0.45s; }
.container > *:nth-child(6) { animation-delay: 0.55s; }
.container > *:nth-child(7) { animation-delay: 0.65s; }
.container > *:nth-child(8) { animation-delay: 0.75s; }

/* ==================== 容器样式 ==================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 60px;
    position: relative;
}

/* ==================== 头部浮动岛导航栏 ==================== */
/* 固定在顶部的浮动导航栏容器，不含毛玻璃效果 */
header.floating-header {
    position: fixed;
    top: 30px;
    left: 50px;
    right: 20px;
    z-index: 1000;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: none;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
}

/* 浮动导航栏激活时，容器顶部留出补偿空间 */
.floating-nav-active {
    padding-top: 90px;
}

/* 浮动导航栏中导航链接单独毛玻璃胶囊 */
header.floating-header .nav-links {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: hsla(0, 0%, 100%, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 15px 25px;
}

/* ==================== 头部导航 ==================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
}

.logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    font-family: 'UranusPixel', 'Segoe UI', sans-serif;
}

.nav-links {
    display: flex;
    gap: 40px;
}

.nav-links a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #ffffff;
}

/* ==================== 占位区域 ==================== */
/* 占位元素 */
.spacer {
    height: 10vh;
}

/* ==================== 文档布局 ==================== */
.doc-layout {
    display: flex;
    gap: 40px;
}

/* ==================== 左侧目录 ==================== */
.doc-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 40px;
    height: fit-content;
}

.sidebar-title {
    font-size: 16px;
    font-weight: 600;
    color: #8b8b8b;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.toc-list {
    list-style: none;
    padding: 0;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 6px 10px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.toc-list a:hover {
    color: #ffffff;
    background: rgba(74, 222, 128, 0.1);
}

.toc-list a.active {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.15);
}

.toc-level-2 {
    padding-left: 20px;
}

.toc-level-3 {
    padding-left: 40px;
}

/* ==================== 右侧正文 ==================== */
.doc-content {
    flex: 1;
    min-width: 0;
}

.doc-title {
    font-size: 42px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 30px;
    font-family: 'UranusPixel', 'Segoe UI', sans-serif;
}

.doc-subtitle {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 40px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.3);
    position: relative;
}

.doc-subtitle::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 60px;
    height: 3px;
    background: linear-gradient(to right, #4ade80, #22c55e);
    border-radius: 2px;
}

.doc-subtitle-2 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 30px 0 15px;
}

.doc-subtitle-3 {
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    margin: 20px 0 10px;
}

.doc-text {
    color: #b0b0b0;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.doc-text strong {
    color: #ffffff;
}

/* ==================== 代码块 ==================== */
.doc-code {
    background: rgba(20, 20, 20, 0.8);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 20px 0;
    overflow-x: auto;
}

.doc-code code {
    color: #4ade80;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* ==================== 列表样式 ==================== */
.doc-list {
    margin: 15px 0 15px 30px;
    color: #b0b0b0;
    font-size: 15px;
    line-height: 1.8;
}

.doc-list li {
    margin-bottom: 8px;
}

.doc-list strong {
    color: #ffffff;
}

/* ==================== 表格样式 ==================== */
.doc-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(20, 20, 20, 0.5);
    border-radius: 12px;
    overflow: hidden;
}

.doc-table th,
.doc-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-table th {
    background: rgba(74, 222, 128, 0.1);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.doc-table td {
    color: #b0b0b0;
    font-size: 14px;
}

.doc-table tr:last-child td {
    border-bottom: none;
}

/* ==================== 链接样式 ==================== */
.doc-content a {
    color: #4ade80;
    text-decoration: none;
    transition: color 0.3s ease;
}

.doc-content a:hover {
    color: #22c55e;
    text-decoration: underline;
}

/* ==================== 高亮标签 ==================== */
.doc-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 8px;
}

.doc-badge-new {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.doc-badge-info {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

/* ==================== Markdown解析样式 ==================== */
.md-h1 {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.3);
    font-family: 'UranusPixel', 'Segoe UI', sans-serif;
}

.md-h2 {
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.md-h3 {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 20px 0 12px;
}

.md-p {
    color: #b0b0b0;
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 15px;
}

.md-p strong {
    color: #ffffff;
}

.md-ul {
    list-style: disc;
    margin: 15px 0 15px 30px;
    color: #b0b0b0;
    font-size: 15px;
    line-height: 1.8;
}

.md-ol {
    list-style: decimal;
    margin: 15px 0 15px 30px;
    color: #b0b0b0;
    font-size: 15px;
    line-height: 1.8;
}

.md-ul li,
.md-ol li {
    margin-bottom: 8px;
}

.md-ul li strong,
.md-ol li strong {
    color: #ffffff;
}

.md-code {
    background: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
}

.md-pre {
    background: rgba(20, 20, 20, 0.8);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin: 20px 0;
    overflow-x: auto;
}

.md-code-block {
    color: #4ade80;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.md-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: rgba(20, 20, 20, 0.5);
    border-radius: 12px;
    overflow: hidden;
}

.md-table th,
.md-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.md-table th {
    background: rgba(74, 222, 128, 0.1);
    color: #ffffff;
    font-weight: 600;
    font-size: 14px;
}

.md-table td {
    color: #b0b0b0;
    font-size: 14px;
}

.md-table tr:last-child td {
    border-bottom: none;
}

.md-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 10px 0;
}

.md-hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 30px 0;
}

#docContent a {
    color: #4ade80;
    text-decoration: none;
    transition: color 0.3s ease;
}

#docContent a:hover {
    color: #22c55e;
    text-decoration: underline;
}

#docContent div[align="center"] {
    text-align: center;
    margin: 20px 0;
}

/* ==================== 分页器样式 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.pagination-btn {
    padding: 12px 30px;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.3);
    color: #4ade80;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: rgba(74, 222, 128, 0.2);
    border-color: #4ade80;
    transform: translateY(-2px);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-info {
    color: #8b8b8b;
    font-size: 15px;
    min-width: 60px;
    text-align: center;
}

/* ==================== 页脚样式 ==================== */
/* 全屏分界线 */
.divider-wrapper {
    margin: 40px 0;
    position: relative;
    overflow: visible;
}

.divider-wrapper hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
}

/* 分界线以下全部毛玻璃效果 */
.footer-container  {
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-bottom: -50vw;
    width: 100vw;
    max-width: 100vw;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding:0px 50px;
    box-sizing: border-box;
}

/* 页脚内容区域 */
.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px;
}

/* 页脚布局 - 三列 */
.footer-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
}

/* 页脚左侧 - Logo区域 */
.footer-left {
    flex: 0.5;
    min-width: 200px;
}

/* 页脚Logo文字 */
.footer-logo {
    font-size: 50px;
    font-weight: 700;
    font-family: 'UranusPixel', 'Segoe UI', sans-serif;
    color: #ffffff;
    margin-bottom: 8px;
}

/* 页脚Logo中的.top */
.footer-logo .domain {
    color: #4ade80;
}

/* 页脚副标题 */
.footer-slogan {
    color: #8b8b8b;
    font-size: 14px;
}

/* 页脚中间 - 导航链接 */
.footer-center {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 60px;
}

/* 页脚导航列 */
.footer-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 页脚导航链接 */
.footer-column a {
    color: #b0b0b0;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 页脚导航链接悬停效果 */
.footer-column a:hover {
    color: #ffffff;
}

/* 页脚图标 */
.footer-icon {
    width: 18px;
    height: 18px;
}

/* 底端细线 */
.footer-line {
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ==================== 语言切换样式 ==================== */
.lang-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lang-icon {
    width: 20px;
    height: 20px;
}

/* ==================== GitHub链接样式 ==================== */
.github-link {
    display: flex;
    align-items: center;
    gap: 6px;
}

.github-icon {
    width: 20px;
    height: 20px;
}

/* ==================== 响应式适配 (平板) ==================== */
@media (max-width: 1024px) {
    .doc-layout {
        flex-direction: column;
    }

    .doc-sidebar {
        width: 100%;
        position: static;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding-bottom: 30px;
        margin-bottom: 20px;
    }

    .toc-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }

    .toc-list li {
        margin-bottom: 0;
    }

    .toc-list a {
        padding: 8px 16px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .toc-level-2,
    .toc-level-3 {
        padding-left: 0;
    }

    .doc-title {
        font-size: 36px;
    }
}

/* 移动端返回按钮（默认隐藏，移动端显示） */
.back-btn {
        display: none;                /* 默认隐藏 */
}

/* ==================== 响应式适配 (手机) ==================== */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    header {
        margin-bottom: 20px;
    }

    .nav-links {
        display: none;
    }

    /* 移动端恢复header原始样式，不固定不毛玻璃 */
    header.floating-header {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        z-index: auto;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: none;
        border: none;
        border-radius: 0;
        padding: 20px 0;
        margin-bottom: 20px;
    }

    /* 移动端恢复nav-links原始样式，无胶囊 */
    header.floating-header .nav-links {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: none;
        border: none;
        border-radius: 0;
        padding: 0;
        display: none;
    }

    /* 移动端取消容器顶部补偿 */
    .floating-nav-active {
        padding-top: 0;
    }

    .doc-title {
        font-size: 32px;
    }

    .doc-subtitle {
        font-size: 20px;
    }

    .doc-subtitle-2 {
        font-size: 18px;
    }

    .toc-list {
        flex-direction: column;
    }

    .doc-table {
        font-size: 12px;
    }

    .doc-table th,
    .doc-table td {
        padding: 10px;
    }

    /* 显示返回按钮 */
    .back-btn {
        display: flex;            /* Flex布局 */
        align-items: center;      /* 垂直居中 */
        position: absolute;       /* 绝对定位 */
        right: 50px;              /* 右侧50px */
        top: 50px;                /* 顶部50px */
        z-index: 100;             /* 层级最高 */
    }

    .back-btn svg {
        width: 24px;              /* 图标宽度24px */
        height: 24px;             /* 图标高度24px */
        color: #b0b0b0;           /* 灰色图标 */
        transition: color 0.3s ease;  /* 颜色过渡动画 */
    }

    .back-btn:hover svg {
        color: #ffffff;           /* 悬停时变白色 */
    }

    /* 页脚移动端响应式 */
    .footer-row {
        flex-direction: column;   /* 垂直排列 */
        gap: 20px;               /* 间距缩小 */
    }

    .footer-center {
        flex-direction: column;   /* 垂直排列 */
        gap: 20px;               /* 间距缩小 */
        align-items: flex-start;  /* 左对齐 */
    }

    .footer-logo {
        font-size: 32px;          /* Logo字体缩小 */
    }

    .footer-content {
        padding: 0 20px;         /* 内边距缩小 */
    }

    .footer-container {
        padding: 0px 20px;       /* 容器内边距缩小 */
    }
}