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

html {
    font-size: 16px; /* 设置根字体大小 */
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    height: 100%;
    font-size: 1rem; /* 使用相对单位 */
}

a {
	/* text-decoration: none; */
	color: inherit;
}

h2 {
    text-align: center;
}

.container {
    max-width: 40rem; /* 800px / 16px = 50rem */
    margin: 0 auto;
    padding: 1.25rem; /* 20px / 16px = 1.25rem */
    background-color: white;
    box-shadow: 0 0 0.625rem rgba(0, 0, 0, 0.1); /* 10px / 16px = 0.625rem */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 主按钮样式 */
.main-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    margin-bottom: 0.875rem;
    padding-bottom: 1.25rem;
    border-bottom: 0.0625rem solid #eee;
    justify-content: center;
}

.main-btn {
    width: 8.8rem;
    padding: 0.5rem 1.25rem;
    border: none;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    font-size: 1rem;
}

.main-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-0.125rem); /* 2px / 16px = 0.125rem */
}

.main-btn.active {
    background-color: #407a05; /* 绿色替代原来的红色 #dc3545 */
    color: white;
}

/* 内容区域布局 */
.content-wrapper {
    position: relative;
    flex: 1;
}

.main-content {
    display: none;
}

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

.content-area {
    display: flex;
    gap: 1.25rem; /* 20px / 16px = 1.25rem */
    /* min-height: 18.75rem;  300px / 16px = 18.75rem  */
}

/* 子按钮样式 */
.sub-buttons {
    flex: 0 0 9.375rem; /* 150px / 16px = 9.375rem */
    display: flex;
    flex-direction: column;
    gap: 0.625rem; /* 10px / 16px = 0.625rem */
}

.sub-btn {
    padding: 0.5rem 0.9375rem; /* 10px / 16px = 0.625rem, 15px / 16px = 0.9375rem */
    background-color: #f8f8f8;
    border: none;
    border-radius: 0.25rem; /* 4px / 16px = 0.25rem */
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 1rem;
}

.sub-btn:hover {
    background-color: #e8e8e8;
}

.sub-btn.active {
    background-color: #407a05; /* 绿色替代原来的红色 #dc3545 */
    color: white;
}

/* 内容容器样式 */
.content-container {
    flex: 1;
    /* padding: 0.25rem; */
    /* background-color: #fafafa; */
    border-radius: 0.25rem; /* 4px / 16px = 0.25rem */
    position: relative;
    overflow: hidden;
}

.content-item {
    display: none;
    animation: fadeIn 0.5s ease;
}

.content-item > div {
    padding: 1rem;
    background-color: #e9e9ed;
}

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

.content-item h2 {
    color: #222;
    font-size: 1.2rem; /* 24px / 16px = 1.5rem */
}

.content-item p {
    color: #666;
    font-size: 0.8rem;
}

/* 首页内容样式 */
#content1 .content-container {
    flex: none;
    width: 100%;
}

#content1 .content-container h2 {
    margin-bottom: 0.9375rem; /* 15px / 16px = 0.9375rem */
    color: #222;
    font-size: 1.5rem; /* 24px / 16px = 1.5rem */
}

#content1 .content-container p {
    margin-bottom: 0.625rem; /* 10px / 16px = 0.625rem */
    color: #666;
}

#content-item > * {
    background-color: #fafafa;
}

.content-container-scon {
	margin-top: 10px;
}

/* Footer样式 */
.page-footer {
    margin-top: 10px;
    padding-top: 1.25rem; /* 20px / 16px = 1.25rem */
    border-top: 0.0625rem solid #eee; /* 1px / 16px = 0.0625rem */
    text-align: center;
    color: #666;
    background-color: #f8f9fa;
    padding: 0.9375rem; /* 15px / 16px = 0.9375rem */
    font-size: 0.875rem; /* 14px / 16px = 0.875rem */
}

.page-footer p {
    margin: 0;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(0.625rem); } /* 10px / 16px = 0.625rem */
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* 响应式设计 */
@media (max-width: 600px) {
    html {
        font-size: 14px; /* 在小屏幕上减小根字体大小 */
    }
    
    .container {
        padding: 0.9375rem; /* 15px / 16px = 0.9375rem */
    }
    
    .content-area {
        flex-direction: column;
    }
    
    .sub-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        flex: none;
    }
    
    .sub-btn {
        flex: 1 1 auto;
        min-width: 5rem; /* 80px / 16px = 5rem */
    }
    
    .content-container {
        padding: 0.9375rem; /* 15px / 16px = 0.9375rem */
    }
    
    .main-btn {
        width: 6.25rem; /* 100px / 16px = 6.25rem */
    }
}

/* 针对更大屏幕的优化 */
@media (min-width: 768px) {
    html {
        font-size: 18px; /* 在大屏幕上增大根字体大小 */
    }
    
    .container {
        max-width: 40rem; /* 800px / 18px = 44.44rem，保持最大宽度不超过800px */
    }
}