/* ========================================
   一人江湖 - 古风博客主题样式
   ======================================== */

/* ---------- 全局重置 ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

.ancient-body {
    font-family: "STSong", "SimSun", "Noto Serif SC", "KaiTi", "楷体", "Microsoft YaHei", serif;
    color: #3d3226;
    background: #f7f3eb;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    position: relative;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- 水墨背景 ---------- */
.ink-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.ink-bg canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ---------- 顶部导航 ---------- */
.ancient-header {
    position: relative;
    z-index: 100;
    background: linear-gradient(180deg, rgba(26, 20, 16, 0.96) 0%, rgba(26, 20, 16, 0.9) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid #8b6914;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.header-top {
    padding: 0 20px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #d4af37;
}

.brand-logo {
    width: 50px;
    height: 50px;
    border: 2px solid #8b6914;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 105, 20, 0.1);
}

.logo-icon {
    font-size: 26px;
}

.brand-text .site-name {
    font-size: 22px;
    letter-spacing: 4px;
    font-weight: bold;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    margin-bottom: 2px;
}

.brand-text .site-slogan {
    font-size: 12px;
    color: #8c7e6b;
    letter-spacing: 3px;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    width: 24px;
    height: 2px;
    background: #d4af37;
    border-radius: 1px;
    transition: all 0.3s;
}

/* 导航 */
.ancient-nav {
    border-top: 1px solid rgba(139, 105, 20, 0.3);
    background: rgba(26, 20, 16, 0.7);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    color: #c5b8a0;
    font-size: 14px;
    letter-spacing: 2px;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
}

.nav-item:hover,
.nav-item.active {
    color: #d4af37;
    border-bottom-color: #d4af37;
    background: rgba(139, 105, 20, 0.08);
}

.nav-icon {
    font-size: 16px;
}

/* ---------- 主内容区 ---------- */
.ancient-main {
    position: relative;
    z-index: 1;
    padding: 40px 0 60px;
}

.ancient-main.detail-page {
    padding-top: 30px;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
}

/* ---------- 面包屑 ---------- */
.breadcrumb-ancient {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 24px;
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 3px;
    font-size: 13px;
    color: #8c7e6b;
}

.breadcrumb-ancient a {
    color: #6b5e4f;
}

.breadcrumb-ancient a:hover {
    color: #8b6914;
}

.breadcrumb-ancient .sep {
    color: #c5b8a0;
    font-size: 10px;
}

.breadcrumb-ancient .current {
    color: #8b6914;
}

/* ---------- 分类标题 ---------- */
.section-title {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8ddd0;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: #8b6914;
}

.title-chinese {
    font-size: 24px;
    color: #2c2416;
    letter-spacing: 3px;
}

.title-en {
    font-size: 13px;
    color: #b5a694;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ---------- 文章列表网格 ---------- */
.article-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.article-card {
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.1);
    border-color: #c9a84c;
}

.card-link {
    display: block;
    color: inherit;
}

.card-image {
    height: 200px;
    overflow: hidden;
    background: #f0ebe0;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.article-card:hover .card-image img {
    transform: scale(1.06);
}

.card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8ddd0 0%, #dfd3c0 100%);
}

.placeholder-icon {
    font-size: 48px;
    opacity: 0.35;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    font-size: 12px;
    letter-spacing: 1px;
    border-radius: 2px;
    color: #fff;
    z-index: 2;
}

.card-badge.top {
    background: #c04040;
}

.card-badge.recommend {
    left: auto;
    right: 12px;
    background: #8b6914;
}

.card-body {
    padding: 20px 22px;
}

.card-title {
    font-size: 17px;
    font-weight: bold;
    color: #2c2416;
    line-height: 1.6;
    margin-bottom: 10px;
    letter-spacing: 1px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 14px;
    color: #8c7e6b;
    line-height: 1.7;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: #b5a694;
    padding-top: 12px;
    border-top: 1px dashed #e8ddd0;
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-icon {
    font-size: 13px;
}

/* ---------- 文章详情 ---------- */
.detail-area {
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 4px;
    padding: 30px 36px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.detail-header {
    margin-bottom: 30px;
    padding-bottom: 24px;
    border-bottom: 1px dashed #e8ddd0;
}

.detail-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c2416;
    letter-spacing: 2px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 13px;
    color: #8c7e6b;
    flex-wrap: wrap;
}

.detail-meta .meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 12px;
    background: #fdf8f0;
    border: 1px solid #d4af37;
    border-radius: 2px;
    color: #8b6914;
    font-size: 12px;
    letter-spacing: 1px;
}

.detail-meta .meta-icon {
    margin-right: 3px;
    color: #b5a694;
}

.tag-icon {
    font-size: 13px;
}

/* 文章正文 */
.detail-content.ancient-content {
    font-size: 16px;
    line-height: 2;
    color: #3d3226;
    word-break: break-word;
}

.detail-content.ancient-content p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.detail-content.ancient-content h1,
.detail-content.ancient-content h2,
.detail-content.ancient-content h3,
.detail-content.ancient-content h4,
.detail-content.ancient-content h5,
.detail-content.ancient-content h6 {
    color: #2c2416;
    margin: 28px 0 16px;
    font-weight: bold;
    letter-spacing: 1px;
}

.detail-content.ancient-content h2 {
    font-size: 22px;
    padding-left: 14px;
    border-left: 3px solid #8b6914;
}

.detail-content.ancient-content h3 {
    font-size: 19px;
}

.detail-content.ancient-content img {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    margin: 16px 0;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
}

.detail-content.ancient-content blockquote {
    margin: 20px 0;
    padding: 16px 20px;
    background: #fdfbf6;
    border-left: 4px solid #d4af37;
    color: #6b5e4f;
    font-style: italic;
    letter-spacing: 1px;
}

.detail-content.ancient-content blockquote p {
    text-indent: 0;
    margin-bottom: 0;
}

.detail-content.ancient-content ul,
.detail-content.ancient-content ol {
    margin: 16px 0;
    padding-left: 2em;
}

.detail-content.ancient-content li {
    margin-bottom: 8px;
}

.detail-content.ancient-content a {
    color: #8b6914;
    border-bottom: 1px dashed #8b6914;
}

.detail-content.ancient-content a:hover {
    color: #c04040;
    border-bottom-color: #c04040;
}

.detail-content.ancient-content code {
    padding: 2px 8px;
    background: #f7f3eb;
    border: 1px solid #e8ddd0;
    border-radius: 2px;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 14px;
    color: #8b6914;
}

.detail-content.ancient-content pre {
    margin: 16px 0;
    padding: 20px;
    background: #1a1410;
    border-radius: 4px;
    overflow-x: auto;
}

.detail-content.ancient-content pre code {
    background: none;
    border: none;
    color: #c5b8a0;
    padding: 0;
    font-size: 14px;
}

.detail-content.ancient-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.detail-content.ancient-content table th,
.detail-content.ancient-content table td {
    padding: 10px 14px;
    border: 1px solid #e8ddd0;
    text-align: left;
}

.detail-content.ancient-content table th {
    background: #fdf8f0;
    color: #2c2416;
    font-weight: bold;
}

.detail-content.ancient-content hr {
    border: none;
    border-top: 1px dashed #e8ddd0;
    margin: 30px 0;
}

/* 文章底部 */
.detail-footer {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 1px dashed #e8ddd0;
}

.detail-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tag-label {
    font-size: 13px;
    color: #6b5e4f;
    letter-spacing: 1px;
}

.tag-item {
    display: inline-block;
    padding: 4px 14px;
    font-size: 12px;
    color: #8b6914;
    background: #fdf8f0;
    border: 1px solid #e8ddd0;
    border-radius: 2px;
    letter-spacing: 1px;
}

.tag-item:hover {
    background: #8b6914;
    color: #fff;
    border-color: #8b6914;
}

/* 上一篇/下一篇 */
.detail-nav {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}

.nav-prev,
.nav-next {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: #fdfbf6;
    border: 1px solid #e8ddd0;
    border-radius: 3px;
    transition: all 0.3s;
}

.nav-prev:hover,
.nav-next:hover {
    border-color: #c9a84c;
    background: #fdf8f0;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.nav-label {
    font-size: 12px;
    color: #b5a694;
    letter-spacing: 1px;
}

.nav-title {
    font-size: 14px;
    color: #3d3226;
    font-weight: bold;
    letter-spacing: 1px;
}

.nav-prev.disabled,
.nav-next.disabled {
    opacity: 0.5;
    cursor: default;
}

.nav-prev.disabled:hover,
.nav-next.disabled:hover {
    border-color: #e8ddd0;
    background: #fdfbf6;
    box-shadow: none;
}

/* ---------- 侧边栏 ---------- */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-box {
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.sidebar-title {
    font-size: 16px;
    font-weight: bold;
    color: #2c2416;
    letter-spacing: 2px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e8ddd0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sb-icon {
    font-size: 18px;
    color: #c04040;
}

.sidebar-list {
    list-style: none;
    padding: 0;
}

.sidebar-list li {
    padding: 10px 0;
    border-bottom: 1px dashed #f0ebe0;
}

.sidebar-list li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #3d3226;
    font-size: 14px;
    line-height: 1.6;
    transition: color 0.3s;
}

.sidebar-list a:hover {
    color: #8b6914;
}

.list-dot {
    color: #d4af37;
    font-size: 18px;
    flex-shrink: 0;
}

/* 热门排行 */
.hot-list li {
    padding: 10px 0;
}

.hot-list a {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hot-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 2px;
    background: #f0ebe0;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
    color: #8c7e6b;
}

.hot-rank.rank-1,
.hot-rank.rank-2,
.hot-rank.rank-3 {
    background: #c04040;
    color: #fff;
}

.hot-rank.rank-2 {
    background: #d4772a;
}

.hot-rank.rank-3 {
    background: #d4af37;
}

.hot-title {
    flex: 1;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hot-views {
    font-size: 12px;
    color: #b5a694;
    flex-shrink: 0;
}

/* 语录盒子 */
.quote-box {
    background: linear-gradient(135deg, #fdf8f0 0%, #fdfbf6 100%);
    border-color: #d4af37;
    border-left: 3px solid #d4af37;
    text-align: center;
}

.quote-text {
    font-size: 16px;
    color: #8b6914;
    letter-spacing: 3px;
    line-height: 2;
    font-style: italic;
    margin-bottom: 12px;
}

.quote-author {
    font-size: 13px;
    color: #b5a694;
    letter-spacing: 2px;
}

/* ---------- 空状态 ---------- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
    opacity: 0.35;
}

.empty-state p {
    font-size: 16px;
    color: #b5a694;
    letter-spacing: 2px;
}

/* ---------- 分页 ---------- */
.ancient-pagination {
    margin-top: 40px;
    text-align: center;
}

.ancient-pagination .pagination {
    display: inline-flex;
    gap: 5px;
    list-style: none;
    padding: 0;
}

.ancient-pagination .pagination li {
    display: inline-block;
}

.ancient-pagination .pagination li a,
.ancient-pagination .pagination li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    color: #6b5e4f;
    background: #fff;
    border: 1px solid #e8ddd0;
    border-radius: 3px;
    transition: all 0.3s;
}

.ancient-pagination .pagination li a:hover {
    color: #fff;
    background: #8b6914;
    border-color: #8b6914;
}

.ancient-pagination .pagination li.active span {
    color: #fff;
    background: #8b6914;
    border-color: #8b6914;
}

.ancient-pagination .pagination li.disabled span {
    color: #c5b8a0;
    cursor: default;
}

/* ---------- 页脚 ---------- */
.ancient-footer {
    position: relative;
    z-index: 1;
    background: #1a1410;
    border-top: 2px solid #8b6914;
    padding-top: 40px;
    text-align: center;
}

.footer-decoration {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.deco-line {
    display: block;
    width: 80px;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(212, 175, 55, 0.4), transparent);
}

.deco-diamond {
    color: #8b6914;
    font-size: 12px;
}

.footer-links {
    padding: 0 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.links-title {
    font-size: 14px;
    color: #8c7e6b;
    letter-spacing: 3px;
    margin-bottom: 16px;
}

.links-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.links-list a {
    padding: 5px 16px;
    font-size: 13px;
    color: #6b5e4f;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.links-list a:hover {
    color: #d4af37;
    border-color: #8b6914;
}

.footer-info {
    padding: 25px 20px;
}

.footer-info p {
    color: #5a4e3e;
    font-size: 13px;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.footer-info .copyright {
    font-size: 13px;
    color: #6b5e4f;
}

.footer-info .beian a {
    color: #5a4e3e;
    font-size: 12px;
}

.footer-info .beian a:hover {
    color: #8b6914;
}

.footer-info .powered {
    font-size: 12px;
    color: #4a3e2e;
}

.footer-info .powered a {
    color: #6b5e4f;
}

.footer-info .powered a:hover {
    color: #8b6914;
}

/* ---------- 回到顶部 ---------- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 40px;
    height: 40px;
    background: rgba(139, 105, 20, 0.8);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    z-index: 999;
    color: #fff;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #8b6914;
    transform: translateY(-2px);
}

/* ---------- 入场动画 ---------- */
.fade-in-up {
    transition: opacity 0.6s ease, transform 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-area {
        padding: 24px 20px;
    }
}

@media (max-width: 768px) {
    .header-inner {
        padding: 12px 0;
    }

    .brand-text .site-name {
        font-size: 18px;
        letter-spacing: 2px;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .logo-icon {
        font-size: 22px;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .ancient-nav {
        display: none;
    }

    .ancient-nav.nav-open {
        display: block;
    }

    .nav-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }

    .nav-item {
        padding: 14px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .article-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .detail-title {
        font-size: 22px;
    }

    .detail-meta {
        gap: 12px;
        font-size: 12px;
    }

    .detail-content.ancient-content {
        font-size: 15px;
        line-height: 1.9;
    }

    .detail-content.ancient-content p {
        text-indent: 1.5em;
    }

    .detail-nav {
        flex-direction: column;
        gap: 12px;
    }

    .article-sidebar {
        grid-template-columns: 1fr;
    }

    .footer-decoration .deco-line {
        width: 40px;
    }
}

@media (max-width: 480px) {
    .ancient-main {
        padding: 20px 0 40px;
    }

    .container {
        padding: 0 12px;
    }

    .detail-area {
        padding: 20px 16px;
    }

    .detail-title {
        font-size: 20px;
        letter-spacing: 1px;
    }

    .card-image {
        height: 160px;
    }

    .card-body {
        padding: 16px;
    }

    .card-title {
        font-size: 15px;
    }

    .back-to-top {
        bottom: 20px;
        right: 16px;
        width: 36px;
        height: 36px;
    }
}
