/* CSS 变量定义，方便全局修改 */
:root {
    /* 基础主题与调色板 */
    --theme-color: #008D57;
    --link-color: #4192ff; /* 通用蓝色 */

    /* 背景与容器 */
    --background-color: #f8f9fa;
    --container-bg: #ffffff;
    --border-color: #e1e4e8;

    /* 文本层级：统一为 333 / 666 / 999 / CCC */
    --text-primary: #333333;   /* 主体文字 */
    --text-secondary: #666666; /* 次级文字 */
    --text-tertiary: #999999;  /* 辅助说明 */
    --text-quaternary: #CCCCCC;/* 弱化提示 */

    /* 其他 */
    --shadow: 0 6px 18px rgba(140, 149, 159, 0.12);
    --subtle-hover-bg: rgba(0, 0, 0, 0.03);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* 移除所有点击反馈效果 */
*, *::before, *::after {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 简约链接样式与强调文本颜色 */
a {
    color: var(--link-color);
    text-decoration: none;
    cursor: pointer;
    transition: color .15s ease, text-decoration-color .15s ease;
}

a:hover,
a:focus-visible {
    text-decoration: underline;
}

a:active {
    opacity: .9;
}

strong {
    color: var(--theme-color);
}

/* 移除按钮和链接的点击反馈 */
button, a {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

button:focus, a:focus {
    outline: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    background-color: var(--background-color);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: stretch;
    min-height: 100vh;
    overflow: hidden;
    font-size: 16px;
}

#app-container {
    width: 100%;
    max-width: 460px;
    background-color: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px; /* 增大圆角，更柔和 */
    box-shadow: var(--shadow); /* 使用更细腻的阴影 */
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

header {
    flex-shrink: 0;
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background-color: var(--background-color);
}

header h1 {
    font-size: 17px; /* 减小标题字号 */
    font-weight: 600;
}

#menu-btn {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 14px;
    border-radius: 8px;
}

#menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--text-primary);
    margin: 5px 0;
    transition: transform .3s ease;
}

#drawer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 75%;
    max-width: 255px; /* 缩小侧边栏宽度 */
    height: 100%;
    background-color: var(--container-bg);
    border-right: 1px solid var(--border-color);
    box-shadow: 2px 0 15px rgba(140, 149, 159, 0.1);
    transition: left .3s ease-in-out;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

#drawer.open {
    left: 0;
}

#drawer-header {
    display: flex;
    justify-content: space-between; /* 使标题和按钮两端对齐 */
    align-items: center; /* 垂直居中 */
    padding: 10px 10px 10px 20px; /* 调整内边距 */
    border-bottom: 1px solid var(--border-color);
    height: 60px; /* 保持与主头部一致的高度 */
    flex-shrink: 0;
}

.drawer-title {
    font-size: 17px; /* 保持与主标题一致 */
    font-weight: 600;
    color: var(--text-primary);
}

#close-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: var(--text-secondary);
    border-radius: 8px;
}

#drawer-nav {
    flex-grow: 1;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#drawer-nav::-webkit-scrollbar {
    display: none;
}

#drawer-nav ul {
    list-style: none;
}

#drawer-nav a {
    display: block;
    padding: 18px 20px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    border-left: 3px solid transparent;
}

#drawer-nav a.active {
    font-weight: 600;
    color: var(--theme-color);
    border-left-color: var(--theme-color);
}

#content-area {
    flex-grow: 1;
    padding: 0;
    overflow-y: auto;
    height: calc(100vh - 60px);
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#content-area::-webkit-scrollbar {
    display: none;
}

#content-area h2 {
    font-size: 22px; /* 减小内容区标题字号 */
    font-weight: 700;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: 0.5px; /* 增加呼吸感 */
}

#content-area .img-full-width {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 20px 0;
}

#content-area .img-full-width-no-margin {
    width: 100%;
    height: auto;
    margin: 0;
}

#content-area .text-card {
    background-color: var(--background-color);
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    margin: 12px 0;
}

.page-content {
    padding: 30px 24px;
}

#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(60, 68, 77, 0.4); /* 调整遮罩颜色 */
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease-in-out;
    z-index: 999;
}

#overlay.visible {
    opacity: 1;
    visibility: visible;
}

/* 移动端优化 */
@media (max-width: 768px) {
    #app-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    #content-area {
        padding: 0;
    }
}


/* 绿色加粗大标题 */
p.p0 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.7;
    margin-bottom: 10px;
    color: var(--theme-color);
}

/* 一级、正文 */
p.p1 {
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 6px;
    color: var(--text-primary);
}

/* 二级 */
p.p2 {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

/* 三级 */
p.p3 {
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 6px;
    color: var(--text-tertiary);
}