/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    margin: 0;
    background-color: #0d1117; /* GitHub深色背景 */
    color: #c9d1d9; /* GitHub深色文本颜色 */
    line-height: 1.5;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* 顶部导航栏 */
.navbar {
    background-color: #161b22; /* GitHub深色导航栏背景 */
    padding: 16px 0;
    border-bottom: 1px solid #21262d;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.navbar-brand .logo {
    color: #c9d1d9;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.navbar-brand .logo svg {
    fill: #c9d1d9;
    margin-right: 8px;
}

.navbar-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

.navbar-nav li {
    margin-right: 32px;
}

.navbar-nav a {
    color: #c9d1d9;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
}

.navbar-nav a:hover {
    color: #58a6ff; /* GitHub链接悬停颜色 */
}

.navbar-search input {
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px; /* 全圆角 */
    padding: 8px 12px;
    color: #c9d1d9;
    width: 250px; /* 恢复宽度 */
    font-size: 14px;
    outline: none;
}

.navbar-search input::placeholder {
    color: #8b949e;
}

.navbar-actions a {
    color: #c9d1d9;
    text-decoration: none;
    margin-left: 16px;
    font-weight: 600;
    font-size: 14px;
}

.navbar-actions .avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
}

/* 主要内容区域 */
.content {
    padding: 32px 0;
}

.content h1 {
    color: #58a6ff;
    margin-bottom: 16px;
}

.card {
    background-color: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 24px;
}

.card h2 {
    color: #c9d1d9;
    margin-top: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #21262d;
    padding-bottom: 8px;
}

.card ul {
    list-style: none;
    padding: 0;
}

.card li {
    margin-bottom: 8px;
}

/* 代码块样式 */
.code-block {
    position: relative;
    background-color: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    margin-bottom: 16px;
    padding: 12px;
    overflow-x: auto;
}

.code-block pre {
    margin: 0;
    padding-right: 40px; /* 为复制按钮留出空间 */
}

.code-block code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 12px;
    color: #c9d1d9;
}

.code-block .copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: #21262d;
    color: #c9d1d9;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s ease;
}

.code-block .copy-button:hover {
    background-color: #30363d;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navbar .container {
        flex-wrap: wrap;
        justify-content: center;
    }

    .navbar-brand,
    .navbar-nav,
    .navbar-search,
    .navbar-actions {
        width: 100%;
        text-align: center;
        margin-bottom: 10px;
    }

    .navbar-nav ul {
        justify-content: center;
    }

    .navbar-nav li {
        margin: 0 8px;
    }

    .navbar-search input {
        width: 100%;
    }
}


/* 留言气泡样式 */
#messages-content ul {
    list-style: none;
    padding: 0;
}

#messages-content li {
    background-color: #21262d; /* 气泡背景色 */
    border-radius: 10px; /* 圆角 */
    padding: 10px 15px;
    margin-bottom: 10px;
    max-width: 80%; /* 限制气泡宽度 */
    word-wrap: break-word; /* 自动换行 */
    position: relative;
}

#messages-content li strong {
    color: #58a6ff; /* 用户名颜色 */
    margin-right: 5px;
}


/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #161b22;
}

::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444c56;
}

/* GitHub 头像样式 */
.github-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%; /* 使图片变为圆形 */
    vertical-align: middle; /* 垂直居中对齐 */
    margin-right: 8px; /* 与用户名之间留出一些间距 */
    border: 1px solid #30363d; /* 添加一个细边框 */
}

/* 图库布局样式 */
.gallery-grid {
    display: block; /* Masonry will handle the layout */
    position: relative; /* Required for Masonry items to be positioned absolutely */
    margin: 0 auto; /* Center the grid */
    padding: 0; /* Remove padding if any */
}

.gallery-item {
    width: calc(25% - 10px); /* Adjust based on desired columns and gutter */
    margin-bottom: 10px; /* Gutter for Masonry */
    background-color: #161b22;
    border: 1px solid #21262d;
    border-radius: 6px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: auto; /* 确保高度自适应 */
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
}

.gallery-item img {
    max-width: 100%;
    height: auto; /* Allow height to adjust based on aspect ratio */
    border-radius: 4px;
    margin-bottom: 8px;
}

.gallery-folder-info {
    font-size: 0.8em;
    color: #8b949e;
    margin: auto;
}

@media (max-width: 768px) {
    .gallery-item {
        width: calc(33.33% - 10px); /* Two columns on smaller screens */
    }
}
