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

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

/* ✅ 修复：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;
}

/* 内容区块样式 */
.content-block {
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

/* 保留 language 类名以兼容现有代码 */
.language {
    margin-bottom: 20px;
    background: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

/* 链接按钮样式已移除，改为使用内联样式 */

/* 标签页切换样式 */
.tab-buttons {
    display: flex;
    gap: 0;
    margin-bottom: 0;
}

.tab-button {
    flex: 1;
    padding: 10px 0;
    cursor: pointer;
    background: #f0f0f0;
    border: 1px solid #e1e1e1;
    border-bottom: none;
    border-left: none;
    font-size: 16px;
    font-weight: 500;
    color: #666;
    transition: all 0.3s ease;
    user-select: none;
    text-align: center;
    position: relative;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.tab-text-cn {
    font-size: 16px;
    font-weight: 500;
}

.tab-text-en {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.7;
}

.tab-button:first-child {
    border-radius: 8px 0 0 0;
    border-left: 1px solid #e1e1e1;
}

.tab-button:last-child {
    border-radius: 0 8px 0 0;
}

.tab-button:hover {
    background: #e0e0e0;
    color: #333;
}

.tab-button:active {
    transform: scale(0.98);
}

/* 选中状态的标签按钮 */
#tab1:checked ~ .tab-buttons label[for="tab1"],
#tab2:checked ~ .tab-buttons label[for="tab2"],
#tab3:checked ~ .tab-buttons label[for="tab3"],
#tab4:checked ~ .tab-buttons label[for="tab4"] {
    background: white;
    color: #333;
    border-bottom: none;
    border-top-color: #d1d1d1;
    border-left-color: #d1d1d1;
    border-right-color: #d1d1d1;
}

/* 选中状态的标签中文文本 */
#tab1:checked ~ .tab-buttons label[for="tab1"] .tab-text-cn,
#tab2:checked ~ .tab-buttons label[for="tab2"] .tab-text-cn,
#tab3:checked ~ .tab-buttons label[for="tab3"] .tab-text-cn,
#tab4:checked ~ .tab-buttons label[for="tab4"] .tab-text-cn {
    font-weight: 700;
}

/* 选中状态的标签英文文本 */
#tab1:checked ~ .tab-buttons label[for="tab1"] .tab-text-en,
#tab2:checked ~ .tab-buttons label[for="tab2"] .tab-text-en,
#tab3:checked ~ .tab-buttons label[for="tab3"] .tab-text-en,
#tab4:checked ~ .tab-buttons label[for="tab4"] .tab-text-en {
    opacity: 0.8;
}

/* 标签页面板容器 */
.tab-content {
    position: relative;
    min-height: 400px;
    padding: 20px;
}

/* 默认隐藏所有标签页 */
.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

/* 容器内的底部语言块 */
.container > .language {
    padding: 20px;
}

/* 显示对应的标签页 */
#tab1:checked ~ .tab-content #panel1,
#tab2:checked ~ .tab-content #panel2,
#tab3:checked ~ .tab-content #panel3,
#tab4:checked ~ .tab-content #panel4 {
    display: block;
}

/* 淡入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 副标题样式 */
.subtitle {
    font-size: 0.6em;
    font-weight: 400;
    opacity: 0.8;
}

/* 灰色提示文字样式 */
.hint-text {
    color: #888;
    font-size: 0.95em;
}
