/* 全局颜色主题变量 */
:root {
    --primary-color: rgba(162, 165, 177, 0);
    --secondary-color: #B4D700;
    --secondary-color-tar: rgba(217, 234, 135, 0.58);
    --accent-color: #F6F6F6;
    --background-color: #FFFFFF;
    --background-color-body: rgba(250, 246, 242, 0.7);
    /*--card-background: #FFFFFF;*/
    --card-background: #faf9f8;
    --text-primary: #1D1C22;
    --text-primary-max: #18181b;
    --text-secondary: #5a5b61;
    --border-color: #dfdcdc;
    --hover-color: rgba(29, 28, 34, 0.05);
    --hover-color-y: #E67E22;
    --shadow-color: rgba(0, 0, 0, 0.03);
    --shadow-colo-index-list: rgb(200, 200, 200);


    /*--primary-color: rgba(162, 165, 177, 0);*/
    /*--secondary-color: #B4D700;*/
    /*--secondary-color-tar: rgba(217, 234, 135, 0.58);*/
    /*--accent-color: #F6F6F6;*/
    /*--background-color: rgba(255, 249, 240, 0.24);*/
    /*!*--background-color: #FFFFF;*!*/
    /*!* 暖白卡片背景（狐狸皮毛质感） *!*/
    /*--card-background: #F5F1EAF;*/

    /*!*--card-background: #FFFFFF;*!*/
    /*--text-primary: #1D1C22;*/
    /*--text-primary-max: #18181b;*/
    /*--text-secondary: #5a5b61;*/
    /*--border-color: #dfdcdc;*/
    /*--hover-color: rgba(29, 28, 34, 0.05);*/
    /*--hover-color-y: #E67E22;*/
    /*--shadow-color: rgba(0, 0, 0, 0.03);*/


}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 2;
    color: var(--text-primary);
    background-color: var(--background-color-body);
    /* 全站背景图片 - 右下角固定，保持原比例 */
    background-image: url('../image/fox4main.png');
    background-position: right bottom;
    background-repeat: no-repeat;
    background-size: 40%;
    background-attachment: scroll;
    /* 为固定页头预留空间 */
    padding-top: 80px;
}

a {
    text-decoration: none;
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

a:hover {
    color: var(--hover-color-y);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 懒加载图片样式 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

img.lazy-loaded {
    opacity: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航样式 */
.site-header {
    background: var(--card-background);
    box-shadow: 0 2px 10px var(--shadow-color);
    border-bottom: 2px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.navbar-brand .logo {
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    /*gap: 10px;*/
}

.navbar-brand .logo:hover {
    color: var(--secondary-color);
}

.logo-image-left,
.logo-image-right {
    height: 2rem;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-image-left {
    align-self: center;
}

.logo-image-right {
    align-self: center;
}

.navbar-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.navbar-menu a {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.3rem;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-menu a:hover,
.navbar-menu a.active {
    color: var(--secondary-color);
}

.navbar-menu a.active::before,
.navbar-menu a.active::after {
    content: '{';
    position: absolute;
    left: -5px;
    color: var(--secondary-color);
    font-weight: 700;
}

.navbar-menu a.active::after {
    content: '}';
    left: auto;
    right: -5px;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.toggle-icon {
    font-size: 1.4rem;
    /*margin: 0 2px;*/
}

/* 搜索按钮样式 */
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.search-toggle:hover {
    transform: scale(1.1);
}

.search-icon {
    width: 35px;
    height: 35px;
    object-fit: contain;
}

/* 搜索框弹出层样式 */
.search-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
    animation: fadeIn 0.3s ease;
}

.search-overlay.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.search-container {
    background: var(--card-background);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 700px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: bold;
}

.search-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

.search-close:hover {
    color: var(--text-primary);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
    background: var(--background-color);
    color: var(--text-primary);
}

.search-input:focus {
    border-color: var(--secondary-color);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 20px;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: var(--background-color);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 3px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

.search-result-item {
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    background: var(--background-color);
}

.search-result-item:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 10px var(--shadow-color);
    transform: translateX(5px);
}

.search-result-title {
    font-size: 1.2rem;
    color: var(--secondary-color);
    margin-bottom: 8px;
    font-weight: 600;
}

.search-result-title a {
    color: inherit;
    text-decoration: none;
}

.search-result-title a:hover {
    color: var(--hover-color-y);
}

.search-result-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.search-result-preview {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-no-result {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.search-loading {
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
}


/* 侧边栏样式 */
.sidebar {
    max-width: 400px;
    flex-shrink: 0;
    background: var(--card-background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 5px 20px var(--shadow-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sidebar-widget {
    display: flex;
    flex-direction: column;
}

.widget-title {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
}

#audioPlayer {
    width: 100%;
    margin-top: 10px;
}

.douyin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.douyin-link img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.douyin-link span {
    color: var(--secondary-color);
    font-weight: 500;
    font-size: 1.1rem;
}

.running-time {
    font-size: 1.2rem;
    line-height: 1.8;
    text-align: center;
}

.motto {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    font-style: normal;
    text-align: center;
}

.motto-container {
    display: flex;
    flex-direction: column;
    /*gap: 10px;*/
    width: 100%;
}

.motto-img-left,
.motto-img-right {
    height: 60px;
    width: 95px;
    object-fit: contain;
    flex-shrink: 0;
}

.motto-img-left {
    align-self: flex-start;
}

.motto-img-right {
    align-self: flex-end;
}

.motto-container .motto {
    margin: 0;
    text-align: center;
}


/* 代码块样式 */
.code-block {
    background: #f4f4f4;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 15px;
    margin: 20px 0;
    overflow-x: auto;
    position: relative;
}

.code-block pre {
    margin: 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary-max);
}

.code-block code {
    font-family: inherit;
    color: inherit;
    background: none;
    padding: 0;
}

.code-block .comment {
    color: #999;
    font-style: italic;
}

.code-block .string {
    color: #d14;
}

.code-block .keyword {
    color: #333;
    font-weight: bold;
}

/* 行内代码 */
code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--text-primary-max);
}

/* 底部样式 */
.site-footer {
    background: var(--primary-color);
    color: var(--text-primary-max);
    padding: 30px 0;
    margin-top: 50px;
}

.footer-content {
    text-align: center;
}

.footer-content p {
    margin-bottom: 10px;
}

.footer-slogan {
    font-style: italic;
    color: var(--text-primary-max);
    font-size: 0.9rem;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 200px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--secondary-color);
    color: white;
    border-radius: 4px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: background 0.3s ease, transform 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
}

.back-to-top.show {
    display: flex;
}

/* 点击飘出emoji效果 */
.click-emoji {
    position: absolute;
    pointer-events: none;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 3px #fff;
    animation: floatUp 1.2s ease-out forwards;
    z-index: 9999;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-120px) scale(1.5);
        opacity: 0;
    }
}

/* 通用组件样式 - 从 common.css 合并 */

/* 卡片样式 */
.card {
    background: var(--card-background);
    border-radius: 8px;
    box-shadow: 0 2px 10px var(--shadow-color);
    padding: 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px var(--shadow-color);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--hover-color);
    color: white;
}

/* 文章列表项 */
.article-item {
    padding: 5px;
    display: flex;
    gap: 30px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);

}

.article-item:last-child {
    border-bottom: none;
}

.article-item img {
    width: 300px;
    height: auto;
    object-fit: cover;
    border-radius: 5px;
}

.article-info {
    flex: 1;
}

.article-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.article-title a {
    color: var(--secondary-color);
    transition: color 0.3s ease;
}

.article-title a:hover {
    color: var(--hover-color-y) !important;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.article-preview {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination a {
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-primary);
}

.pagination a.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

.pagination a:hover:not(.active) {
    background-color: var(--hover-color);
}

/* 响应式适配 - 从 common.css 合并====================================================== */

@media (min-width: 1024px) {
    .sidebar {
        position: sticky;
        top: 120px;
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        align-self: flex-start;
    }

    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: var(--background-color);
        border-radius: 3px;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background: var(--secondary-color);
        border-radius: 3px;
    }

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: var(--primary-color);
    }

    .logo-text {
        padding-left: 5px;
    }

    .sidebar {
        width: 100%;
        /*margin-top: 30px;*/
    }
}

@media (max-width: 768px) {
    /* 移动端适配搜索项 */

    .search-overlay {
        padding-top: 60px;
    }

    .search-container {
        width: 95%;
        padding: 20px;
    }

    .search-title {
        font-size: 1.2rem;
    }

    .search-input {
        font-size: 1rem;
        padding: 12px 15px;
    }

    .search-result-title {
        font-size: 1.1rem;
    }

    /* 移动端菜单中的搜索按钮样式 */
    .navbar-menu.active .search-toggle {
        width: 100%;
        padding: 12px;
        background: var(--hover-color);
        border-radius: 5px;
        margin-top: 5px;
    }

    .navbar-menu.active .search-toggle:hover {
        background: var(--secondary-color);
    }

    .navbar-menu.active .search-icon {
        width: 30px;
        height: 30px;
    }


    /*===============================*/
    .pagination a {
        padding: 4px 8px;
    }

    /*返回页头按钮*/
    .back-to-top {
        bottom: 100px;
        width: 40px;
        height: 40px;
    }

    body {
        /* 全站背景图片 - 右下角固定，保持原比例 */
        background-image: url('../image/fox4main.png');
        background-size: 100%;
    }

    .site-footer {
        margin-top: 10px;
    }

    .navbar-brand .logo {
        font-size: 1.5rem;
    }

    .logo-image-left,
    .logo-image-right {
        height: 1.5rem;
    }

    .container {
        padding: 0 15px;
    }

    .article-preview {
        color: var(--text-secondary);
        line-height: 1.4;
    }

    .article-meta {
        font-size: 0.9rem;
        color: var(--text-secondary);
        margin-bottom: 0;
    }

    .article-title {
        font-size: 1.5rem;
        margin-bottom: 0;
        color: var(--text-primary);
    }

    .article-item {
        display: flex;
        gap: 1px;
        margin-bottom: 5px;
        margin-top: 5px;
        padding-bottom: 5px;
        flex-direction: column;
        /*    添加外边框阴影*/
        box-shadow: 0 2px 10px var(--shadow-colo-index-list);
    }

    .article-item img {
        width: 100%;
        max-height: 200px;
    }

    .article-title {
        font-size: 1.2rem;
    }

    .navbar-toggle {
        display: block;
    }

    .navbar-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card-background);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 5px 10px var(--shadow-color);
        gap: 10px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transform: translateY(-10px);
        transition: max-height 0.4s ease, opacity 0.3s ease, transform 0.3s ease;
        visibility: hidden;
    }

    .navbar-menu.active {
        max-height: 500px;
        opacity: 1;
        transform: translateY(0);
        visibility: visible;
    }

    .navbar-menu li {
        text-align: center;
    }
}

/* ==================== 秋日落叶背景效果 ==================== */
.leaf {
    position: fixed;
    pointer-events: none;
    z-index: -1;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(-100px) rotate(0deg) translateX(0);
        opacity: 0;
    }
    10% { opacity: var(--alpha); }
    90% { opacity: var(--alpha); }
    100% {
        transform: translateY(calc(100vh + 100px)) rotate(var(--rotation)) translateX(var(--drift));
        opacity: 0;
    }
}
