/* ================================
   组件样式
   ================================ */

/* 文章列表项 */
.post-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 1.2rem 0;
    border-bottom: 2px dotted var(--border-wood);
    transition: all 0.3s ease;
}

.post-item:hover {
    transform: translateX(4px);
}

.post-title {
    font-size: 1.4rem;
    font-weight: 700;
    cursor: pointer;
    flex: 1;
    margin-left: 0.5rem;
    line-height: 1.2;
    transition: color 0.2s;
}

.post-title:hover {
    color: var(--accent);
}

.post-date {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    min-width: 85px;
}

.post-category {
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: 1px solid currentColor;
    padding-bottom: 1px;
    min-width: 20px;
    text-align: right;
    cursor: pointer;
    transition: color 0.2s;
}

.post-category:hover {
    color: var(--accent);
}

/* 复古卡片 */
.card-vintage {
    background: transparent;
    border: 2px solid var(--border-ink);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 2px 4px rgba(46, 36, 31, 0.08),
        0 4px 8px rgba(46, 36, 31, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.card-vintage::before,
.card-vintage::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-ink);
    opacity: 0.6;
}

.card-vintage::before {
    top: 4px;
    left: 4px;
    border-right: none;
    border-bottom: none;
}

.card-vintage::after {
    bottom: 4px;
    right: 4px;
    border-left: none;
    border-top: none;
}

.card-vintage:hover {
    transform: translateY(-4px);
    box-shadow:
        0 2px 4px rgba(46, 36, 31, 0.12),
        0 4px 8px rgba(46, 36, 31, 0.08),
        0 8px 16px rgba(171, 59, 58, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* 复古风格按钮 - 下划线链接样式 */
.btn-link-vintage {
    font-weight: 700;
    border-bottom: 2px solid var(--border-ink);
    padding-bottom: 0.25rem;
    transition: color 0.2s;
}

.btn-link-vintage:hover {
    color: var(--accent);
}

/* 归档列表项样式 */
.archive-item-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text);
    transition: color 0.2s;
}

.group:hover .archive-item-text {
    color: var(--accent);
}

/* 区块标题样式 */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 2px solid var(--border-ink);
    margin-bottom: 1rem;
    padding-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .section-title {
        font-size: 1.125rem;
    }
}

/* 搜索框 */
.search-container {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid rgba(46, 36, 31, 0.4);
}

.search-box-flex {
    display: flex;
    gap: 15px;
}

.search-input-wrapper,
.search-btn-wrapper {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid var(--text);
    box-shadow: 6px 6px 0 0 rgba(46, 36, 31, 0.3);
    backdrop-filter: blur(4px);
}

.search-input {
    background: transparent;
    padding: 0.8rem 1rem;
    width: 100%;
    outline: none;
    font-weight: bold;
    color: var(--text);
}

.search-input::placeholder {
    color: rgba(46, 36, 31, 0.5);
}

.search-btn-wrapper {
    width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* 按钮 */
.btn-black {
    background: var(--text);
    color: var(--paper);
    padding: 0.8rem 2rem;
    font-weight: bold;
    transition: all 0.2s;
    border: 1px solid var(--text);
    cursor: pointer;
}

.btn-black:hover {
    background: var(--text);
    color: var(--paper);
    transform: translateY(-2px);
}

/* 分页 */
.pagination {
    display: flex;
    gap: 8px;
    margin-top: 3rem;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-wrap: wrap;
}

.page-btn {
    padding: 5px 12px;
    border: 2px solid var(--text);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
    min-width: 40px;
    text-align: center;
    font-size: 14px;
    backdrop-filter: blur(4px);
}

.page-btn:hover:not(.disabled) {
    background: rgba(46, 36, 31, 0.1);
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--text);
    color: var(--paper);
}

.page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 5px 8px;
    min-width: 30px;
    text-align: center;
    font-weight: bold;
    color: rgba(46, 36, 31, 0.5);
}

/* 弹窗遮罩 */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(46, 36, 31, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.copy-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #000;
    color: #fff;
    padding: 8px 16px;
    font-size: 12px;
    z-index: 10001;
}

/* 动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes inkReveal {
    from {
        opacity: 0;
        filter: blur(4px);
    }

    to {
        opacity: 1;
        filter: blur(0);
    }
}

.fade-in {
    animation: fadeInUp 0.4s ease-out forwards;
    backface-visibility: hidden;
}

/* 文章详情标题淡入 */
.title-char {
    display: inline-block;
    opacity: 0;
    animation: inkReveal 0.4s ease-out forwards;
    will-change: opacity, filter;
}

/* 书架 */
.book-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.book-info>div {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-row {
    display: grid;
    grid-template-columns: 1fr 70px 80px 140px 40px;
    align-items: center;
    gap: 1.2rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-wood);
}

/* 表头特殊样式 */
.book-header {
    border-bottom: 2px solid var(--border-ink) !important;
}

/* 加载提示 */
.data-loading {
    text-align: center;
    padding: 2rem;
    font-style: italic;
    opacity: 0.7;
}

/* 备案 */
.footer-beian {
    text-align: center;
}

.footer-beian a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-beian a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* 隐藏滚动条 */
.overflow-x-auto::-webkit-scrollbar {
    display: none;
}

/* 横向滚动容器 - 通用类 */
.horizontal-scroll {
    scrollbar-width: none;
    cursor: grab;
}

.horizontal-scroll:active {
    cursor: grabbing;
}

/* 横向滚动容器 */
.mini-apps-scroll {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.mini-apps-scroll::-webkit-scrollbar {
    display: none;
}

.mini-apps-scroll:active {
    cursor: grabbing;
}

.mini-app-link {
    flex-shrink: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .mini-app-link {
        font-size: 1.25rem;
    }
}

.mini-app-link::before {
    content: '/ ';
    opacity: 0.4;
}

.mini-app-link:hover {
    color: var(--accent);
}

.date-selector-scroll {
    display: flex;
    gap: 0.8rem;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
}

.date-selector-scroll::-webkit-scrollbar {
    display: none;
}

.date-selector-scroll:active {
    cursor: grabbing;
}

.date-selector-btn {
    flex-shrink: 0;
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--text);
    padding: 0.25rem 0.5rem;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
    background: transparent;
}

.date-selector-btn:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.date-selector-btn.active {
    color: var(--paper);
    background: var(--text);
    border-bottom-color: var(--text);
}

@media (min-width: 1024px) {
    .date-selector-btn {
        font-size: 1.125rem;
    }
}

/* ================================
   图片查看器
   ================================ */

.image-viewer-overlay {
    touch-action: none;
    background-color: rgba(46, 36, 31, 0.85);
    backdrop-filter: blur(8px);
}
