/* 故事页面样式 */
.story-container {
    max-width: 91%;
    margin: 0 auto;
    padding: 20px;
    background-color: #f8f5e8;
    min-height: 80vh;
}

.story-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.story-card {
    text-align: center;
    border: 1px solid #d2b48c;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(139, 69, 19, 0.1);
    padding: 20px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #fffdf5 0%, #fdf8ea 100%);
}
    /* 故事卡片悬停效果 */
.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 章节描述容器 */
/* 章节描述容器 */
/* 章节描述容器 */
.chapter-description-container {
    background-color: #f8f5e6;
    border-bottom: 1px solid #e0d9c4;
    padding: 12px 0;
    position: relative;
}

.chapter-description-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.chapter-description {
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    height: 32px;
    line-height: 32px;
}

.description-text {
    display: inline-block;
    animation: marquee 25s linear infinite;
    font-size: 14px;
    color: #5a4a3a;
    font-weight: 500;
    letter-spacing: 0.5px;
    cursor: pointer;
    /* 确保动画立即开始 */
    animation-delay: 0s;
}

@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

.chapter-description:hover .description-text {
    animation-play-state: paused;
}

/* 弹窗样式 */
/* 弹窗样式 */
.chapter-description-popup {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    min-width: 600px;
    max-width: 90%;
    background-color: #fff;
    border: 1px solid #d2b48c;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.25);
    padding: 20px;
    padding-top: 40px;  /* 为关闭按钮留出空间 */
    display: none;
    z-index: 1000;
}

/* 关闭按钮 */
.popup-close-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 28px;
    height: 28px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    line-height: 1;
}

.popup-close-btn:hover {
    background-color: #d2b48c;
    color: #fff;
}

/* 弹窗三角箭头 */
.chapter-description-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #d2b48c;
}

.chapter-description-popup::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #fff;
}

.chapter-description-popup .popup-content {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
    max-height: 250px;
    overflow-y: auto;
}





/* 提示文字 */
.chapter-description::before {
    content: '';
    position: absolute;
    left: 20px;
    color: #8b7355;
    font-weight: bold;
    z-index: 2;
}

/* 弹框样式优化 */
/* 移除hover效果，改用点击 */
/* .chapter-description-container:hover .chapter-description-popup {
    display: block;
} */

.chapter-description-popup {
    position: absolute;
    top: calc(100% + 6px); /* 原来top:100%，往下挤被卡片压，改成+6px错开 */
    left: 50%;
    transform: translateX(-50%);
    min-width: 600px;
    max-width: 90%;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid #d2b48c;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.25);
    padding: 20px;
    margin-top: 0; /* 删掉margin-top:8px */
    display: none;
    z-index: 1000; /* 加大层级，防止被页面其他元素盖住 */
}


/* 弹框三角箭头 */
.chapter-description-popup::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #d2b48c;
}

.chapter-description-popup::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid #fff;
}

/* .chapter-description-container:hover .chapter-description-popup {
    display: block;
    opacity: 1;
    transform: translateX(-50%) translateY(0);
} */

.chapter-description-popup .popup-content {
    font-size: 14px;
    line-height: 1.8;
    color: #333;
    text-align: justify;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 30px;
}

/* 弹框标题 */
.chapter-description-popup .popup-title {
    font-size: 16px;
    font-weight: bold;
    color: #5a4a3a;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed #e0d9c4;
}

/* 弹框关闭按钮 */
.chapter-description-popup .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    background-color: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chapter-description-popup .close-btn:hover {
    background-color: #d2b48c;
    color: #fff;
}

/* 弹框滚动条样式 */
.chapter-description-popup ::-webkit-scrollbar {
    width: 6px;
}

.chapter-description-popup ::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.chapter-description-popup ::-webkit-scrollbar-thumb {
    background: #d2b48c;
    border-radius: 3px;
}

.chapter-description-popup ::-webkit-scrollbar-thumb:hover {
    background: #b8956e;
}









/* 左侧来源列表样式 */
.source-filter-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.source-filter-sidebar li {
    margin-bottom: 10px;
}

.source-filter-sidebar a {
    display: block;
    padding: 10px 15px;
    color: var(--text-primary);
    background-color: var(--el-color-warning-light-5);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.source-filter-sidebar a:hover {
    background-color: var(--el-color-warning-light-3);
    color: var(--primary-color);
}

.source-filter-sidebar a.active {
   background-color: #0b167b;
   color: #ffffff;
    font-weight: bold;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8B4513, #c8a960, #8B4513);
}

.story-card-image {
    object-fit: cover;
    border: 1px solid #d2b48c;
    box-shadow: 0 2px 6px rgba(139, 69, 19, 0.15);
    border-radius: 6px;
}

.story-card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #8b2323;
    line-height: 1.4;
    font-family: "LXGW WenKai", "KaiTi", "STKaiti", "楷体", Georgia, serif;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px dashed #d2b48c;
    letter-spacing: 0.08em;
}

.story-card-description {
    font-size: 14px;
    color: #5c4023;
    margin-bottom: 15px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-family: "LXGW WenKai", "KaiTi", "STKaiti", "楷体", Georgia, serif;
}

.story-card-source {
    font-size: 12px;
    color: #8a7a60;
    margin-bottom: 6px;
    font-style: italic;
}

.story-card-date {
    font-size: 12px;
    color: #8a7a60;
    text-align: right;
    font-style: italic;
}




/* 故事详情样式 */
.story-detail {
    background: linear-gradient(135deg, #fdf9ed 0%, #f5eedc 50%, #f2e8d5 100%);
    border: 3px double #c8a960;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(154, 133, 72, 0.15);
    padding: 40px;
    margin-bottom: 40px;
    position: relative;
}

/* 详情页标题区域 - 包含返回按钮 */
.story-detail-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #c8a960;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
}

.story-detail-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: #8b2323;
}

/* 返回按钮 - 古典风格 */
.story-back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: #fffdf5;
    border: 2px solid #c8a960;
    border-radius: 6px;
    color: #8b4513;
    font-family: "LXGW WenKai", "KaiTi", "STKaiti", "楷体", Georgia, serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 69, 19, 0.1);
    transition: all 0.25s ease;
}

.story-back-btn:hover {
    background: #f5eedc;
    border-color: #8b2323;
    color: #8b2323;
    box-shadow: 0 3px 10px rgba(139, 69, 19, 0.2);
}

.story-back-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.story-back-btn .back-icon {
    font-size: 18px;
    font-weight: bold;
    color: #8b2323;
    line-height: 1;
}

.story-back-btn .back-label {
    letter-spacing: 0.15em;
}

.story-detail-title {
    font-size: 28px;
    font-weight: bold;
    color: #8b2323;
    text-align: center;
    margin: 0;
    font-family: "LXGW WenKai", "KaiTi", "STKaiti", "楷体", Georgia, serif;
    letter-spacing: 0.15em;
    flex: 1;
}

.story-info {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #d2b48c;
    color: #8a7a60;
    font-size: 14px;
}

.story-info span {
    margin: 0 12px;
}

.story-image {
    text-align: center;
    margin-bottom: 30px;
}

.story-image img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(139, 69, 19, 0.2);
    border: 1px solid #d2b48c;
}

.story-content {
    font-size: 16px;
    line-height: 2;
    color: #3a2a1a;
    margin-bottom: 40px;
    font-family: "LXGW WenKai", "KaiTi", "STKaiti", "楷体", Georgia, serif;
}

.story-content p {
    margin-bottom: 20px;
    text-indent: 2em;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 20px;
}

.pagination button {
    background: linear-gradient(135deg, #8b4513, #a0522d);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    background: linear-gradient(135deg, #a0522d, #b87333);
    transform: translateY(-1px);
}

.pagination button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

#page-info {
    font-size: 14px;
    color: #5a4a3a;
}

/* 筛选器样式 */
.source-filter {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-right: 10px;
    background-color: #fff;
    cursor: pointer;
}

.source-filter:focus {
    outline: none;
    border-color: #D2B48C;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 移动端筛选容器 */
    .mobile-filter-container {
        padding: 10px 12px;
        background: linear-gradient(180deg, #f5eedc 0%, #ede0c4 100%);
        border-bottom: 1px solid #d2b48c;
        width: 100%;
    }

    /* 移动端筛选器按钮 - 古典风设计 */
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 10px 16px;
        background: #fffdf5;
        border: 2px solid #c8a960;
        border-radius: 6px;
        color: #8b4513;
        font-family: "LXGW WenKai", "KaiTi", "STKaiti", "楷体", Georgia, serif;
        font-size: 14px;
        font-weight: bold;
        letter-spacing: 0.15em;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(139, 69, 19, 0.12);
        transition: all 0.25s ease;
        position: relative;
    }

    .mobile-filter-btn::before {
        content: '';
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 3px;
        height: 60%;
        background: linear-gradient(180deg, #8b2323, #c8a960);
        border-radius: 2px;
    }

    .mobile-filter-btn:active {
        transform: scale(0.98);
        box-shadow: 0 1px 4px rgba(139, 69, 19, 0.2);
    }

    .mobile-filter-btn .filter-icon {
        font-size: 16px;
        margin-right: 8px;
        color: #8b2323;
    }

    .mobile-filter-btn .filter-text {
        flex: 1;
        text-align: left;
        padding-left: 8px;
    }

    .mobile-filter-btn .filter-arrow {
        font-size: 12px;
        color: #c8a960;
        transition: transform 0.3s ease;
    }

    body.nav-minimized .mobile-filter-btn,
    body.character-page .mobile-filter-btn {
        display: flex;
    }

    .story-container {
        padding: 8px;
    }

    .story-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .story-card {
        padding: 16px;
    }

    .story-card-title {
        font-size: 16px;
        letter-spacing: 0.05em;
    }

    .story-card-description {
        font-size: 13px;
        line-height: 1.5;
    }

    .story-detail {
        padding: 20px 16px;
    }

    .story-detail-header {
        min-height: 44px;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }

    .story-back-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .story-back-btn .back-label {
        display: none;
    }

    .story-back-btn .back-icon {
        font-size: 22px;
        margin-right: 0;
    }

    .story-detail-title {
        font-size: 20px;
        letter-spacing: 0.08em;
    }

    .story-content {
        font-size: 15px;
        line-height: 1.9;
    }

    .source-filter {
        flex: 1;
    }

    /* 移动端分页优化 */
    .pagination {
        gap: 10px;
        margin-top: 24px;
        padding: 12px 0;
    }

    .pagination button {
        padding: 8px 16px;
        font-size: 13px;
        min-width: 80px;
    }

    #page-info {
        font-size: 13px;
        white-space: nowrap;
    }

    /* 章节描述滚动条优化 */
    .chapter-description-popup {
        min-width: unset;
        width: 90%;
        max-width: 90%;
    }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .story-container {
        padding: 6px;
    }

    .story-card {
        padding: 14px;
    }

    .story-card-title {
        font-size: 15px;
    }

    .story-card-description {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }

    .story-detail {
        padding: 16px 12px;
    }

    .story-detail-header {
        min-height: 40px;
    }

    .story-back-btn {
        padding: 5px 10px;
    }

    .story-back-btn .back-icon {
        font-size: 20px;
    }

    .story-detail-title {
        font-size: 18px;
    }

    .story-content {
        font-size: 14px;
        line-height: 1.8;
    }

    .pagination {
        gap: 6px;
    }

    .pagination button {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 64px;
    }

    #page-info {
        font-size: 12px;
    }
}

/* 加载动画 */
.waiting-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.waiting-layer.active {
    opacity: 1;
    visibility: visible;
}

.waiting-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.waiting-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #D2B48C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.waiting-text {
    font-size: 14px;
    color: #333;
}