/* 页面布局样式 - 已修复版本 */

/* 主容器 */
.container {
    max-width: 800px;
    margin: 20px auto;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2; /* 确保在星空之上 */
}

/* ✅ 修复：Body 样式改为自适应高度 */
.body {
    z-index: 1;
    min-height: 100vh; /* 改为 min-height，允许内容撑开 */
    position: relative;
    /* 删除了 height: 100vh 和 overflow-y: auto */
}

/* 标题样式 */
/* ✅ 修复：删除无效的选择器 */
hr {
    border: none;
    border-bottom: 2px solid #e1e1e1;
    margin: 20px 0;
}

h1 {
    color: #333;
    padding: 30px 0;
    text-align: center;
}

h2 {
    color: #333;
    margin-top: 30px;
}

/* 段落样式 */
p {
    line-height: 1.6;
    color: #666;
}

/* 列表样式 */
ul {
    list-style-type: none;
    padding: 0;
}

ul li {
    background: #e9e9e9;
    margin-bottom: 8px;
    padding: 10px;
    border-radius: 4px;
}

ul li:hover {
    background: #d0d0d0;
}

/* 语言区块样式 */
.language {
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

/* ✅ 修复：链接按钮样式添加perspective支持 */
a {
    position: relative;
    display: inline-block;
    padding: 1.2em 2em;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    user-select: none;
    color: white;
    perspective: 1000px; /* 支持3D效果 */
}

a::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(135deg, #6e8efb, #a777e3);
    border-radius: 4px;
    transition:
        box-shadow 0.5s ease,
        transform 0.2s ease;
    will-change: transform;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transform: translateY(var(--ty, 0)) rotateX(var(--rx, 0))
        rotateY(var(--ry, 0)) translateZ(var(--tz, -12px));
}

a:hover::before {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

a::after {
    position: relative;
    display: inline-block;
    content: attr(data-title);
    transition: transform 0.2s ease;
    font-weight: bold;
    letter-spacing: 0.01em;
    will-change: transform;
    transform: translateY(var(--ty, 0)) rotateX(var(--rx, 0))
        rotateY(var(--ry, 0));
}

/* ✅ 添加：空链接的最小尺寸，确保可点击 */
a:empty::after {
    min-width: 100px;
    min-height: 20px;
}
