



/* ---------------------------------------------
   基本页面样式（全局）
   说明：将常用的字体、颜色、行高等放在 body，便于全局一致性。
---------------------------------------------- */
body {
    background-color: #f5f5f0;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
    color: #212020;
    line-height: 1.4;
    margin: 0;
    padding: 0 8px;
}

 .side-menu { width: 150px; right: -260px; }
    .site-title { font-size: 1rem; }
}


.link {
    text-decoration:none;/*文本不显示下划线*/
    text-decoration:underline;/*鼠标悬停时显示下划线*/
}

h1 , p {
    margin: 0;
}

img {
    max-width: 100%
    height: auto
}

.articlelink {
    text-decoration: none;
    color: inherit;
    display: block;
}







/* ---------------------------------------------
   顶部工具条（Top bar）
   说明：使用 flex 布局实现左右两端对齐（标题 + 汉堡按钮）
---------------------------------------------- */
.top-bar {
    position: relative;
    background-color: #a3ccf7;
    border-bottom: 1px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 20px;
    padding-right: 20px;
}

.site-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    background: linear-gradient(135deg, #233355, #6193e2);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.site-title small {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.75rem;
    font-weight: 400;
    color: #6c7a8e;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    transition: background 0.2s;
}
.hamburger:hover { background-color: #eef3fc; }
.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background-color: #2c3e66;
    border-radius: 3px;
    transition: transform 0.2s;
}

/* ========== ADDED: 登录头像/按钮样式 ========== */
.right-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.user-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(2px);
    border-radius: 40px;
    width: 38px;
    height: 38px;
    text-decoration: none;
    transition: all 0.2s ease;
}
.user-icon-btn:hover {
    background: rgba(255, 255, 255, 0.85);
    transform: scale(1.02);
}
.user-icon-img {
    width: 22px;
    height: 22px;
    display: block;
    object-fit: contain;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.3);
    padding: 4px 12px 4px 8px;
    border-radius: 40px;
    text-decoration: none;
    transition: background 0.2s;
}

/* 已登录状态：头像 + 用户名（垂直排列，无背景） */
.user-info {
    display: flex;
    flex-direction: column;      /* 头像在上，文字在下 */
    align-items: center;         /* 水平居中 */
    gap: 6px;                    /* 头像和用户名间距 */
    text-decoration: none;       /* 去掉下划线 */
    /* 去掉背景、padding、圆角 */
    background: none;
    padding: 0;
    border-radius: 0;
    transition: opacity 0.2s;
}
.user-info:hover {
    opacity: 0.8;                /* 可选悬停变淡 */
    background: none;            /* 确保没有背景变化 */
}

/* 头像圆形 */
.user-avatar-img {
    width: 40px;                 /* 可以调大一点，更明显 */
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    /* 可选：加一个极细的边框或阴影，让圆形更突出 */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 用户名样式 */
.user-name {
    font-size: 0.75rem;          /* 稍小一点，精致 */
    font-weight: 500;
    color: #2c3e66;
    text-align: center;
    background: none;            /* 确保无背景 */
    padding: 0;
    margin: 0;
    line-height: 1.2;
}

.logout-link {
    background: rgba(255,255,255,0.3);
    border-radius: 40px;
    padding: 6px 10px;
    text-decoration: none;
    color: #5a3e2e;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.logout-link:hover {
    background: rgba(255,255,255,0.8);
}
/* ========== END ADDED ========== */

/* ---------------------------------------------
   侧边菜单与遮罩（overlay）
---------------------------------------------- */
.menu-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.28);
    backdrop-filter: blur(2px);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    z-index: 998;
}
.menu-overlay.active { visibility: visible; opacity: 1; }

.side-menu {
    position: fixed;
    top: 0;
    right: -350px;
    width: 320px;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -6px 0 20px rgba(0,0,0,0.06);
    z-index: 999;
    transition: right 0.28s cubic-bezier(.2,.9,.4,1.1);
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 18px;
    border-left: 1px solid #e9eef6;
}
.side-menu.open { right: 0; }

.menu-header { display:flex; justify-content:space-between; align-items:center; padding-bottom:8px; border-bottom:1px solid #eef2f8; }
.close-menu { background:none; border:none; font-size:26px; cursor:pointer; color:#7f8c9a; }

.menu-list { list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:12px; }
.menu-list a { text-decoration:none; color:#24324a; font-size:1rem; display:flex; gap:10px; align-items:center; padding:6px 8px; border-radius:8px; }
.menu-list a:hover { background:#c1d2dd; color:#000000; }
.menu-icon { width:28px; text-align:center; }

/* ---------------------------------------------
   主体内容卡片样式（示例）
---------------------------------------------- */
.content-placeholder { max-width:900px; margin:28px auto; padding:0 12px; }
.card { background:#fff; border-radius:16px; padding:18px; margin-bottom:18px; box-shadow:0 2px 6px rgba(0,0,0,0.04); border:1px solid #eef3f8; }
.card h3 { margin:0 0 8px 0; color:#1f2a44; }
.card p { margin:0; color:#4a5568; }
.card img {
  max-width: 100%;      /* 图片宽度不超过父容器 */
  height: auto;         /* 高度自动等比缩放 */
  display: block;       /* 去掉图片下方的空白间隙 */
  object-fit: contain;  /* 保证完整显示（不裁剪），如果比例不一致会有留白 */
}

footer { text-align:center; padding:26px 12px; font-size:0.85rem; color:#9aaebf; border-top:1px solid #e9eef6; margin-top:36px; }





/* =============================================
   手机端专属优化（屏幕宽度 ≤ 768px）
   ============================================= */
@media (max-width: 768px) {
    /* 1. 全局调整 */
    body {
        padding: 0 6px;
        font-size: 14px;
    }




    /* 2. 顶部栏优化 */
    .top-bar {
        padding: 8px 12px;
        margin-left: -10px;
        margin-right: -10px;
    }
    .site-title {
        font-size: 1.1rem;   /* 比原来的1rem稍大，但比桌面小 */
        background: linear-gradient(135deg, #233355, #6193e2);
        -webkit-background-clip: text;
        background-clip: text;
    }
    .site-title small {
        font-size: 0.65rem;
        margin-left: 4px;
    }
    
    /* 3. 右侧用户组：已登录时头像缩小，用户名隐藏（节省空间）或显示一行 */
    .right-group {
        gap: 6px;
    }
    /* 未登录：登录按钮稍缩小 */
    .user-icon-btn {
        width: 34px;
        height: 34px;
    }
    .user-icon-img {
        width: 18px;
        height: 18px;
    }
    /* 已登录：头像缩小，用户名仅在宽屏显示（可选隐藏） */
    .user-info {
        flex-direction: row;   /* 改回水平排列，更省垂直空间 */
        gap: 6px;
        background: rgba(255,255,255,0.2);
        padding: 2px 8px 2px 4px;
        border-radius: 30px;
    }
    .user-avatar-img {
        width: 28px;
        height: 28px;
    }
    .user-name {
        font-size: 0.7rem;
        /* 如果用户名太长，可以限制最大宽度并加省略号 */
        max-width: 70px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 4. 汉堡按钮触摸区域加大 */
    .hamburger {
        width: 40px;
        height: 40px;
        gap: 5px;
    }
    .hamburger span {
        width: 22px;
        height: 2.5px;
    }
    
    /* 5. 侧边菜单：更合适的宽度，触摸友好 */
    .side-menu {
        width: 160px;          /* 260px 能容纳中文菜单，又不会太宽 */
        right: -280px;
        padding: 16px;
        gap: 14px;
    }
    .side-menu.open {
        right: 0;
    }
    .menu-header span {
        font-size: 1.1rem;
    }
    .close-menu {
        font-size: 30px;
        padding: 0 6px;
    }
    .menu-list a {
        font-size: 1rem;
        padding: 10px 8px;     /* 增加触摸高度 */
    }
    .menu-icon {
        width: 32px;
        font-size: 1.2rem;
    }
    
    /* 6. 主体内容卡片 */
    .content-placeholder {
        margin: 16px auto;
        padding: 0 4px;
    }
    .card {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 14px;
    }
    .card h3 {
        font-size: 1.2rem;
        margin-bottom: 6px;
    }
    .card p {
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* 7. 底部页脚 */
    footer {
        padding: 20px 12px;
        font-size: 0.75rem;
        margin-top: 24px;
    }
    
    /* 8. 其他实用调整 */
    input, button, a {
        touch-action: manipulation;  /* 优化触摸响应 */
    }
}