:root {
    --primary-color: {{ .Site.Params.lightColor }};
    --text-color: #020617;
    --text-secondary: #52525b;
    --bg-primary: #f3f4f6;
    --bg-primary-top: #f3f4f6E6;
    --cards-white: #fafafa;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: {{ .Site.Params.darkColor }};
        --text-color: #f4f4f5;
        --text-secondary: #d4d4d8;
        --bg-primary: #18181b;
        --bg-primary-top: #18181bE6;
        --cards-white: #262626;
        --shadow-color: rgba(248, 250, 252, 0.15);
    }
}

[data-theme="dark"] {
    --primary-color: {{ .Site.Params.darkColor }};
    --text-color: #f4f4f5;
    --text-secondary: #d4d4d8;
    --bg-primary: #18181b;
    --bg-primary-top: #18181bE6;
    --cards-white: #262626;
    --shadow-color: rgba(248, 250, 252, 0.15);
}

body {
    margin: 0;
    padding-top: 70px;
    background-color: var(--bg-primary);
    color: var(--text-color);
    font-family: Palatino, Palatino Linotype, Palatino LT STD, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

a {
    color: var(--text-color);
    text-decoration: none;
}

.grid {
    margin: 0 auto;
    padding: 20px 0 20px 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s, visibility 0.5s;
}

.grid.show {
    opacity: 1;
    visibility: visible;
}

.grid a:visited {
    color: var(--text-secondary);
}

/* 网格项样式 */
.grid-item {
    width: 255px;
    margin: 8px 0 8px 0;
    background: var(--cards-white);
    color: var(--text-color);
    border-radius: 16px;
    overflow: hidden;
    transition: box-shadow 0.3s ease-in-out;
}

.grid-item:hover {
    box-shadow: 0px 0px 18px var(--shadow-color);
}

/* 网格项头部样式 */
.grid-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 13px 4px;
}

.grid-item-img {
    max-width: 255px;
    background: var(--cards-white);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.grid-item-img.loaded {
    opacity: 1;
}

.grid-item-title {
    font-size: 1.25em;
    margin: 0;
    flex: 1;
}

.grid-item-color-mark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* 网格项描述样式 */
.grid-item-description {
    padding: 4px 13px 10px 13px;
    font-size: 0.875em;
}

.grid-item-description p {
    margin: 0;
}

/* 网格项中部样式 */
.grid-item-middle {
    padding: 4px 14px 4px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grid-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.grid-item-tag {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 3px;
    padding: 2px 5px;
    font-size: 0.75em;
}

.grid-item-date {
    color: var(--text-secondary);
    font-size: 0.75em;
}

/* 网格项链接样式 */
.grid-item-links {
    padding: 0 13px 10px;
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.grid-item-links a {
    color: var(--text-color);
    text-decoration: none;
    padding: 5px;
    font-size: 0.75em;
}

.grid-item-links a:hover {
    text-decoration: underline;
}

/* 顶部栏样式 */
.top-bar {
    margin: 0 auto;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    box-sizing: border-box;
    background: var(--bg-primary-top);
    color: var(--text-color);
    padding: 10px 0;
    z-index: 1000;
}

.top-bar-inner {
    margin: 0 auto;
    display: flex;
    width: 90%;
    justify-content: space-between;
}

.top-bar-logo {
    height: 40px;
    width: 40px;
    vertical-align: middle;
    margin-right: 10px;
}

.top-bar-title {
    font-size: 1.5em;
    margin: 0 100px 0 5px;
    display: flex;
    align-items: center;
    white-space: nowrap;
    font-family: Times New Roman, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

.top-bar-nav {
    display: flex;
    align-items: center;
    /* width: 100%; */
    gap: 10px;
    /* 确保各元素间距均匀 */
    flex-wrap: nowrap;
}

.top-bar-nav a {
    padding: 0 10px;
}

/* 选中状态样式 */
.is-checked {
    background: var(--primary-color);
    color: var(--cards-white);
}

/* 菜单容器样式 */
.menu-container {
    position: relative;
    display: inline-block;
    padding: 10px;
    margin: 5px 0;
    flex-shrink: 0;
    /* 不允许收缩 */
    cursor: pointer;
}

.exlink:hover {
    text-decoration: underline
}

.theme-toggle {
    background-color: transparent;
    font-size: 1em;
    border: none;
    cursor: pointer;
}

.hot-tags-container {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex-shrink: 1;
    margin-left: auto;
    min-width: 0;
}

/* 导航按钮样式 */
.nav-button {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--cards-white);
    box-shadow: 0px 3px 6px var(--shadow-color);
    border-radius: 4px;
    padding: 10px;
    z-index: 1001;
    width: max-content;
}

.nav-button.active {
    display: block;
}

.nav-button .filter-btn {
    display: block;
    margin-bottom: 5px;
}

.nav-button .filter-btn:last-child {
    margin-bottom: 0;
}

/* 过滤按钮样式 */
button.filter-btn {
    border: none;
    border-radius: 4px;
    cursor: pointer;
    outline: none;
    transition: background-color 0.3s, color 0.3s;
    font-family: Palatino, Palatino Linotype, Palatino LT STD, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}

button.filter-btn:hover {
    background-color: var(--text-secondary);
    color: var(--cards-white);
}

button.filter-btn.is-checked {
    background-color: var(--primary-color);
    color: var(--cards-white);
}

.menu-toggle-btn {
    background: var(--bg-primary-top);
    color: var(--text-secondary);
}


/* 提高hot优先级 */
.hot-tag {
    padding: 0 10px;
    border-radius: 4px;
    color: var(--text-color);
    background-color: transparent;
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 1em;
}

.hot-tag:hover {
    background-color: var(--cards-white);
}



/* 重置过滤按钮样式 */
#reset-filters {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--cards-white);
    border: none;
    cursor: pointer;
    font-size: 24px;
    line-height: 50px;
    text-align: center;
    box-shadow: 0 4px 8px var(--shadow-color);
    transition: bottom 0.3s ease-in-out;
    z-index: 1000;
    display: none;
}


#reset-filters.show {
    bottom: 30px;
    display: block;
}

/* 重置过滤按钮抖动动画 */
@keyframes shake {

    0%,
    100% {
        transform: translateX(-50%);
    }

    12.5%,
    37.5%,
    62.5%,
    87.5% {
        transform: translateX(calc(-50% - 3px));
    }

    25%,
    50%,
    75% {
        transform: translateX(calc(-50% + 3px));
    }
}

#reset-filters.shake {
    animation: shake 0.8s ease-in-out both;
}

/* 适配移动端顶栏 */
@media screen and (max-width: 768px) {
    body {
        padding-top: 120px;
    }

    .menu-container {
        display: flex;
        align-items: center;
        margin: 0;
        position: relative;
    }

    .top-bar-inner {
        flex-direction: column;
        align-items: center;
    }

    .top-bar-title {
        margin: 0;
    }

    .top-bar-nav {
        margin: 0;
        display: flex;
        justify-content: left;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .menu-toggle {
        margin-right: 0;
    }

    .site-footer {
        bottom: 15px;
    }

    .categories {
        display: none;
    }

    .hot-tags-container {
        display: none;
    }
}

/* 文章 */
.post {
    max-width: 800px;
    padding: 20px;
    line-height: 1.4;
    margin-left: auto;
    margin-right: auto;
}

.post a:hover {
    text-decoration: underline;
}

.single-head {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-footer {
    padding: 20px;
    text-align: center;
    line-height: 1.5;
}

/* 头像问候 */

.greeting-widget {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: var(--cards-white);
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: bottom 0.3s ease-out;
    z-index: 1000;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message {
    color: var(--text-color);
}

.greeting-widget.show {
    bottom: 20px;
}

/* 美化相册封面 */

#cover {
    position: relative;
    display: inline-block;
    cursor: zoom-in;
}

.cover-line {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 96px;
    height: 4px;
    border-radius: 4px;
    background-color: var(--bg-primary-top);
}

.cover-img {
    position: relative;
    display: inline-block;
}

.cover-img {
    transition: transform 1s ease; 
}

#cover:hover .cover-img {
    transform: scale(1.03);
}