/**
 * 文章列表页与文章详情页样式。
 */

/* 文章列表卡片 */

/* 文章卡片：可点击，悬停时上移并加深阴影 */
.article-card {
    cursor: pointer;
    margin-bottom: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* 文章卡片悬停效果 */
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* 文章标题 */
.article-title {
    font-size: 20px;
    margin-bottom: 6px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* 文章日期：半透明小字 */
.article-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    display: block;
    margin-bottom: 10px;
}

/* 文章摘要：略透明正文色 */
.article-excerpt {
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.6;
}

/* 标签列表：横向自动换行排列 */
.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

/* 单个标签：圆角胶囊，半透明背景 */
.article-tag {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 搜索框 */

/* 搜索框容器：相对定位，供按钮绝对定位使用 */
.search-input {
    position: relative;
    width: 40%;
    margin-bottom: 24px;
}

/* 搜索框 */
#search-input {
    width: 100%;
    padding: 10px 44px 10px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    box-sizing: border-box;
    transition: background 0.2s, border-color 0.2s;
}

/* 搜索框聚焦 */
#search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
}
/* 搜索框占位符颜色 */
#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* 搜索按钮：绝对定位到输入框右侧内部 */
#search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    padding: 4px 6px;
    cursor: pointer;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, opacity 0.2s;
}
#search-btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* 搜索按钮悬停 */
#search-btn:hover {
    opacity: 0.7;
}

/* 搜索行：搜索框与标签分类按钮横向排列 */
.search-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

/* 搜索框在搜索行内撑满剩余宽度 */
.search-row .search-input {
    flex: 1;
    margin-bottom: 0;
}

/* 标签分类按钮 */
.tag-filter-btn {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.85);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: background 0.2s, border-color 0.2s;
}

/* 标签分类按钮悬停 */
.tag-filter-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* 标签分类按钮激活态（面板打开时） */
.tag-filter-btn.active {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.5);
}

/* 标签列表面板 */
.tag-list-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin-bottom 0.35s ease;
}

/* 标签面板展开态 */
.tag-list-panel.open {
    max-height: 300px;
    opacity: 1;
    margin-bottom: 24px;
}

/* 标签面板中的标签项：可点击，带交互反馈 */
.tag-list-panel .article-tag {
    cursor: pointer;
    padding: 6px 14px;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

/* 标签面板标签悬停 */
.tag-list-panel .article-tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

/* 标签面板标签选中态 */
.tag-list-panel .article-tag.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}


/* 文章详情页 */

/* 返回按钮：透明背景，细边框 */
.back-btn {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 6px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

/* 返回按钮悬停时显示半透明背景 */
.back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* 文章底部前后篇导航行：两端对齐，顶部细分隔线 */
.article-bottom-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 前后篇按钮：限制宽度，超长标题用省略号截断 */
.article-nav-btn {
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 下一篇按钮：始终贴右，无论上一篇是否存在 */
#next-article-btn {
    margin-left: auto;
}

/* 文章内容容器 */
#article-content {
    color: #fff;
    line-height: 1.8;
}

/* 文章内标题：上下间距与阴影 */
#article-content h1, #article-content h2, #article-content h3 {
    margin: 1.2em 0 0.5em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* 文章内段落间距 */
#article-content p {
    margin-bottom: 1em;
}

/* 行内代码：暗色背景下用半透明白色区分，而非黑色叠加 */
#article-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

/* 代码块：深黑背景在暗色页面上对比清晰 */
#article-content pre {
    background: rgba(0, 0, 0, 0.55);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1em;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* 代码块内的 code 标签：重置背景与填充，限定字体以匹配 highlight.js 的 monospace 回退 */
#article-content pre code {
    background: none;
    padding: 0;
    font-size: 14px;
    line-height: 1.6;
    font-family: 'Consolas', 'Source Code Pro', 'Fira Code', 'Cascadia Code', monospace;
}

/* highlight.js 覆盖：确保高亮色不被 article-content 的白色文字继承 */
#article-content pre code.hljs {
    color: inherit;
}

/* 文章内有序/无序列表 */
#article-content ul, #article-content ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

/* 文章内图片 */
#article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    box-sizing: border-box;
}

/* 文章内链接：半透明白色，悬停时加下划线 */
#article-content a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: text-decoration 0.2s;
}
#article-content a:hover {
    text-decoration: underline;
}

/* 文章内引用块：左侧有色边框，内边距 */
#article-content blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.4);
    padding-left: 1em;
    margin: 1em 0;
}

/* 文章内表格：半透明背景与边框 */
#article-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#article-content th, #article-content td {
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px;
    text-align: left;
}
#article-content th { 
    background: rgba(255, 255, 255, 0.25);
    font-weight: bold;
    text-align: left;
}