:root {
    --primary-color: #946342;
    --secondary-color: #f4f4f9;
    --accent-color: #4a90e2;
    --text-color: #2c2c2c;
    --text-light-color: #7d7d7d;
    --border-radius: 10px;
    --box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: #000;
}

ul {
    list-style: none;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(120deg, #9b5f30d3, #4a90e2);
    background-size: 400% 400%;
    animation: gradientBackground 10s ease infinite;
    margin: 0;
}

@keyframes gradientBackground {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

header {
    background-color: var(--primary-color);
    color: #fff;
    padding: .1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

header .logo {
    font-size: 1.8rem;
    font-weight: bold;
}

.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 1.8rem;
    font-weight: bold;
    display: block;
}

header ul {
    list-style: none;
    gap: 1.5rem;
    margin: 0;
}

header .menu_dropdown li {
    border-bottom: 1px solid #ffffff;
}

header ul li a {
    color: #fff;
    text-decoration: none;
    font-size: 1rem;
    transition: color 0.3s ease;
    width: 100%;
    display: block;
}

header .menu_dropdown li a {
    padding: 10px;
}

header ul li a:hover {
    color: var(--accent-color);
}

header .menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #fff;
    background: none;
    border: none;
}

header ul.menu_toggle {
    display: flex;
    background-color: var(--primary-color);
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

header ul.menu_toggle li {
    margin: 0.5rem 0;
}

header ul.menu_toggle li a {
    font-size: 1rem;
}

header .menu_dropdown {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

header .menu_dropdown.show {
    display: flex;
    opacity: 1;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.post-list div {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-list div:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.post-list h2 a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

post-list h2 a:hover {
    color: var(--accent-color);
}

.post-list p {
    color: var(--text-light-color);
    margin-top: 0.5rem;
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: var(--primary-color);
    color: #fff;
    margin-top: 2rem;
}

.comments {
    margin-top: 2rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.comments h2 {
    margin-bottom: 1rem;
}

.comments textarea {
    width: 100%;
    height: 120px;
    margin-bottom: 1rem;
    padding: 0.8rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
    resize: none;
}

.comments button {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

.comments button:hover {
    background-color: var(--accent-color);
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination button {
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.pagination button:hover {
    background-color: var(--accent-color);
}

.pagination button.active {
    background-color: var(--accent-color);
    font-weight: bold;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.category-item {
    padding: 1.5rem;
    background: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.category-item h2 a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 1.5rem;
    transition: color 0.3s ease;
}

.category-item h2 a:hover {
    color: var(--accent-color);
}

.category-item p {
    color: var(--text-light-color);
    margin-top: 0.5rem;
}

#search-section {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    gap: 1rem;
}

#search-input {
    padding: 0.8rem;
    width: 300px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

#search-button {
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

#search-button:hover {
    background-color: var(--accent-color);
}

#article-content {
    margin-top: 2rem;
    background: #fff;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

#article-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

#article-date {
    color: var(--text-light-color);
    margin-bottom: 1rem;
}

#article-body {
    line-height: 1.8;
    color: var(--text-color);
}

.content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    header {
        flex-wrap: wrap;
    }

    header .menu_toggle {
        display: none !important;
    }

    header .menu-toggle {
        display: block;
    }

    header .menu_dropdown {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 0;
        width: 30%;
        background-color: var(--primary-color);
        padding: 1rem;
        border-radius: 0;
        box-shadow: var(--box-shadow);
        z-index: 1000;
    }

    main {
        padding: 1rem;
    }

    .post-list div {
        padding: 1rem;
    }

    .comments textarea {
        height: 100px;
    }
    
     /* 修复Recommend部分 */
    .reco {
        height: auto;
        min-height: 150px;
        padding: 10px 0;
        margin-bottom: 1rem;
    }
    
    .reco > div {
        width: 95% !important;
        padding: 8px !important;
        height: auto !important;
    }
    
    .reco h2 {
        font-size: 1.2rem;
        margin-bottom: 5px;
    }
    
    .reco h3 {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .reco h3 a {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .reco p {
        font-size: 0.85rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-top: 5px;
    }
    
    /* 修复文章列表部分 */
    .post-list div {
        padding: 1rem 0.8rem;
        margin-bottom: 1rem;
        height: auto;
        min-height: unset;
    }
    
    .post-list h2 a {
        font-size: 1.2rem;
        line-height: 1.3;
    }
    
    .post-list p {
        font-size: 0.9rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* 调整主内容区域 */
    main {
        padding: 1rem 0.5rem;
    }
}

.ads300InnerBox {
    width: calc(100% - 20px);
    height: 290px;
    position: relative;
    border: 4px solid #a3a2a2;
    box-sizing: border-box;
    margin: 0 auto;
    border-radius: 10px;
    color: #000;
    display: none;
}

.ads300InnerBox::before {
    content: 'ADVERTISEMENT';
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 10px);
    height: 100%;
    font-size: 10px;
    background-color: #f1f1f1;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 0 5px;
}

.adsBox {
    width: 300px;
    height: 250px;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
}

.adsInnerBox {
    width: calc(100% - 10px);
    height: 82px;
    box-sizing: border-box;
    position: relative;
    border: 4px solid #a3a2a2;
}

.adsInnerBox::before {
    content: 'ADVERTISEMENT';
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 10px);
    height: 100%;
    font-size: 10px;
    background-color: #f1f1f1;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 0 5px;
}

.ads320Box {
    width: 320px;
    height: 50px;
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
}

.ad-wrap {
    width: 100%;
    position: relative;
    max-height: 280px;
}

.e06zh {
    position: absolute;
    width: 336px;
    height: 280px;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

/* 新增：Footer 按钮样式（优先移动端） */
.footer-buttons {
    display: flex;
    flex-wrap: wrap; /* 移动端自动换行 */
    justify-content: center; /* 水平居中 */
    gap: 0.8rem; /* 按钮之间的间距 */
    margin-top: 1.2rem; /* 与版权信息的间距 */
    padding: 0 1rem; /* 左右留白，避免移动端贴边 */
}

.footer-btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    color: var(--light-text); /* 白色文字，匹配 footer 白色文字 */
    border: 1px solid rgba(255, 255, 255, 0.3); /* 浅色边框，提升辨识度 */
    border-radius: 4px; /* 圆角，匹配网站现有按钮风格 */
    text-decoration: none; /* 清除链接下划线 */
    font-size: 0.9rem; /* 字体大小，移动端友好 */
    transition: all 0.3s; /* hover 过渡效果 */
}

/* 按钮 hover 效果（增强交互） */
.footer-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--light-text);
}

/* 移动端特殊适配（可选，若需更紧凑） */
@media (max-width: 480px) {
    .footer-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        flex: 1; /* 小屏幕下按钮平均占满宽度（可选，根据需求调整） */
        text-align: center; /* 文字居中 */
    }
}