/* 最近浏览作品样式 */

.recently-viewed-section {
    margin: 2rem 0 3rem;
}

.recently-viewed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e6dfcf;
}

.recently-viewed-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d2a26;
    margin: 0;
}

.recently-viewed-clear {
    background: none;
    border: 1px solid #8a5a2b;
    color: #8a5a2b;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.recently-viewed-clear:hover {
    background: #8a5a2b;
    color: white;
}

.recently-viewed-container {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(100px, 1fr);
    gap: 2.2rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 1rem 0rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #8a5a2b transparent;
    cursor: grab;
}

.recently-viewed-container::-webkit-scrollbar {
    height: 8px;
}

.recently-viewed-container::-webkit-scrollbar-track {
    background: #f8f5ef;
    border-radius: 4px;
}

.recently-viewed-container::-webkit-scrollbar-thumb {
    background: #8a5a2b;
    border-radius: 4px;
}

.recently-viewed-container::-webkit-scrollbar-thumb:hover {
    background: #6b4621;
}

.recently-viewed-container.active {
    cursor: grabbing;
}

.recently-viewed-item {
    min-width: 100px;
    max-width: 200px;
    background: #f8f5ef;
    border: 1px solid #d4c8b0;
    border-radius: 6px;
    padding: 0.8rem 0.4rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 200px;
    /* writing-mode: vertical-rl; */
    text-orientation: mixed;
    box-shadow: 0 2px 6px rgba(138, 90, 43, 0.08);
    background-image: linear-gradient(to bottom, #f8f5ef, #f1e9dc);
    margin: 0.8rem;
}

.recently-viewed-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(138, 90, 43, 0.15);
    border-color: #8a5a2b;
}

.recently-viewed-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #8a5a2b, #b38b5d);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.recently-viewed-item:hover::before {
    opacity: 1;
}

.recently-viewed-work-title {
    font-family: "SimSun", "宋体", serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d2a26;
    margin: 0;
    line-height: 1.8;
    writing-mode: vertical-lr;
    text-orientation: mixed;
    text-align: left;
    max-height: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    height: auto;
    align-self: flex-start;
    margin-top: 0.8rem;
    margin-left: 0.8rem;
}

.recently-viewed-work-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.recently-viewed-work-title a:hover {
    color: #8a5a2b;
}

.recently-viewed-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: space-between;
    align-items: stretch;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.recently-viewed-meta {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    margin-top: auto;
    font-size: 0.75rem;
    color: #8a5a2b;
    line-height: 1.4;
    text-align: right;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    align-self: flex-end;
    margin-bottom: 0.8rem;
    margin-right: 0.8rem;
}

.recently-viewed-dynasty {
    font-size: 0.65rem;
    color: #921f1f;
    font-weight: 400;
    margin-bottom: 0.3rem;
}

.recently-viewed-author {
    font-size: 0.65rem;
    color: #666;
    font-weight: 400;
}

.recently-viewed-author-dynasty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #8a5a2b;
    font-weight: 500;
}

.recently-viewed-author-dynasty::before {
    content: '👤';
    font-size: 0.8rem;
}

.recently-viewed-remove {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    background: rgba(255, 255, 255, 0.8);
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 0.7rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.recently-viewed-remove:hover {
    color: #d32f2f;
    background: rgba(211, 47, 47, 0.1);
}

.recently-viewed-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #666;
}

.recently-viewed-empty::before {
    content: '📚';
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 导航按钮 */
.recently-viewed-nav {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.recently-viewed-nav-btn {
    background: #8a5a2b;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.recently-viewed-nav-btn:hover:not(:disabled) {
    background: #6b4621;
    transform: scale(1.1);
}

.recently-viewed-nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

/* 删除动画效果 */
.recently-viewed-item.removing {
    animation: fadeOutSlide 0.3s ease forwards;
    pointer-events: none;
}

@keyframes fadeOutSlide {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-20px) scale(0.95);
    }
    100% {
        opacity: 0;
        transform: translateX(-40px) scale(0.9);
        height: 0;
        margin: 0;
        padding: 0;
    }
}

/* 自定义确认对话框样式 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    z-index: 10001;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.confirm-content {
    padding: 2rem;
}

.confirm-message {
    font-size: 1.1rem;
    color: #2d2a26;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-cancel {
    background: #f8f5ef;
    color: #8a5a2b;
    border: 1px solid #d4c8b0;
}

.confirm-cancel:hover {
    background: #f1e9dc;
    border-color: #8a5a2b;
}

.confirm-ok {
    background: #8a5a2b;
    color: white;
}

.confirm-ok:hover {
    background: #6b4621;
    transform: translateY(-1px);
}

/* 右下角提示样式 */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

.toast-content {
    background: #8a5a2b;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(138, 90, 43, 0.3);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-message {
    display: block;
}

/* 自定义确认对话框样式 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    z-index: 10001;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.confirm-content {
    padding: 2rem;
}

.confirm-message {
    font-size: 1.1rem;
    color: #2d2a26;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-cancel {
    background: #f8f5ef;
    color: #8a5a2b;
    border: 1px solid #d4c8b0;
}

.confirm-cancel:hover {
    background: #f1e9dc;
    border-color: #8a5a2b;
}

.confirm-ok {
    background: #8a5a2b;
    color: white;
}

.confirm-ok:hover {
    background: #6b4621;
    transform: translateY(-1px);
}

/* 右下角提示样式 */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

.toast-content {
    background: #8a5a2b;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(138, 90, 43, 0.3);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-message {
    display: block;
}

/* 删除动画效果 */
.recently-viewed-item.removing {
    animation: fadeOutSlide 0.3s ease forwards;
    pointer-events: none;
}

@keyframes fadeOutSlide {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    50% {
        opacity: 0.5;
        transform: translateX(-20px) scale(0.95);
    }
    100% {
        opacity: 0;
        transform: translateX(-40px) scale(0.9);
        height: 0;
        margin: 0;
        padding: 0;
    }
}

/* 自定义确认对话框样式 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    z-index: 10001;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.confirm-content {
    padding: 2rem;
}

.confirm-message {
    font-size: 1.1rem;
    color: #2d2a26;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-cancel {
    background: #f8f5ef;
    color: #8a5a2b;
    border: 1px solid #d4c8b0;
}

.confirm-cancel:hover {
    background: #f1e9dc;
    border-color: #8a5a2b;
}

.confirm-ok {
    background: #8a5a2b;
    color: white;
}

.confirm-ok:hover {
    background: #6b4621;
    transform: translateY(-1px);
}

/* 右下角提示样式 */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

.toast-content {
    background: #8a5a2b;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(138, 90, 43, 0.3);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-message {
    display: block;
}

/* 自定义确认对话框样式 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-dialog {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    z-index: 10001;
    overflow: hidden;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.confirm-content {
    padding: 2rem;
}

.confirm-message {
    font-size: 1.1rem;
    color: #2d2a26;
    text-align: center;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.confirm-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.confirm-btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 100px;
}

.confirm-cancel {
    background: #f8f5ef;
    color: #8a5a2b;
    border: 1px solid #d4c8b0;
}

.confirm-cancel:hover {
    background: #f1e9dc;
    border-color: #8a5a2b;
}

.confirm-ok {
    background: #8a5a2b;
    color: white;
}

.confirm-ok:hover {
    background: #6b4621;
    transform: translateY(-1px);
}

/* 右下角提示样式 */
.toast-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 300px;
}

.toast-content {
    background: #8a5a2b;
    color: white;
    padding: 12px 16px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(138, 90, 43, 0.3);
    font-size: 0.9rem;
    line-height: 1.4;
}

.toast-message {
    display: block;
}

/* 响应式设计 */
