/* ── 页面基础 ── */
@font-face {
    font-family: "TianChengBit";
    src: url("../fonts/TianChengBit/TianChengBit-Regular.otf") format("opentype");
    font-weight: normal;
    font-style: normal;
}

body {
    height: 100vh;
    overflow: hidden;
}

.viewport-container {
    height: 100vh;
    overflow-x: hidden;
    overflow-y: hidden;
    font-family: serif;
    background: #000;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
}

/* ── 日志区（横向滚动，第一屏）── */
.log-viewport {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-type: x mandatory;
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    align-items: center;
    padding: 32px;
    box-sizing: border-box;
    position: relative;
}

/* ── 弹窗区（第二屏）── */
.modal-viewport {
    height: 100vh;
    width: 100%;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
    background: #000;
}

/* ── 索引按钮 ── */
a.index-btn {
    position: fixed;
    bottom: 32px;
    left: 32px;
    padding: 12px 15px 13px 15px;
    line-height: 32px;
    font-size: 32px;
    font-family: rubik;
    text-align: right;
    box-shadow:
        0 0 0 1px #fff,
        0 0 5px  #ffffffcc,
        0 0 10px #ffffff80,
        0 0 50px #ffffff37;
    border: 1px solid #000;
    z-index: 999;
    animation: fadeInUp 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.8s both;
    backdrop-filter: blur(2px);
}

a.index-btn:hover {
    border-radius: 28px;
    color: #000 !important;
    background: #fff;
    border: 1px solid #000;
    opacity: 1 !important;
    box-shadow:
        0 0 0 1px #fff,
        0 0 5px  #ffffffcc,
        0 0 10px #ffffff80,
        0 0 50px #ffffff9a;
}

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

/* ── 键盘提示 ── */
.kb-hint {
    position: fixed;
    bottom: 32px;
    right: 32px;
    font-size: 11px;
    color: #555;
    font-family: TianChengBit;
    z-index: 500;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.kb-hint kbd {
    opacity: 0.5;
}

/* ── 横向滚动轨道 ── */
.log-track {
    display: flex;
    align-items: center;
    height: 100%;
}

/* ── 日期分隔标记 ── */
.date-marker {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 0 28px;
    height: 220px;
    user-select: none;
}

.date-marker::before,
.date-marker::after {
    content: '';
    width: 1px;
    background: #1f1f1f;
    flex-shrink: 0;
}

.date-marker::before { height: 30px; }
.date-marker::after  { height: 30px; }

.date-marker span {
    writing-mode: vertical-rl;
    font-size: 13px;
    color: #777;
    letter-spacing: 4px;
}

/* ── 小卡片（便笺） ── */
.log-card-note {
    scroll-snap-align: center;
    flex-shrink: 0;
    width: 340px;
    min-height: 180px;
    padding: 24px 28px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 2px;
    margin-right: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.log-card-note:hover {
    border-color: #ffffff55;
    box-shadow:
        0 0 30px  #ffffff66,
        0 0 80px  #ffffff33,
        0 0 180px #ffffff14;
}

.note-img {
    width: calc(100% + 56px);
    height: 180px;
    object-fit: cover;
    margin: -24px -28px 16px;
    border-radius: 2px 2px 0 0;
}

.log-card-note time {
    font-size: 14px;
    color: #777;
    margin-bottom: 14px;
    display: block;
}

.log-card-note p {
    font-size: 17px;
    line-height: 1.7;
    color: #bbb;
    word-break: break-word;
}

/* ── 大卡片（文章） ── */
.log-card-article {
    scroll-snap-align: center;
    flex-shrink: 0;
    width: 480px;
    min-height: 380px;
    padding: 24px;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 2px;
    margin-right: 24px;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.log-card-article:hover {
    border-color: #ffffff55;
    box-shadow:
        0 0 40px  #ffffff66,
        0 0 100px #ffffff33,
        0 0 220px #ffffff14;
}

.card-img-wrap {
    width: 100%;
    height: 200px;
    background: #111;
    border-radius: 1px;
    margin-bottom: 20px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.card-img-placeholder {
    color: #2a2a2a;
    font-size: 48px;
    user-select: none;
}

.card-title {
    font-size: 20px;
    font-weight: bold;
    color: #ddd;
    font-family: "Good Old DOS", "TianChengBit", monospace;
    margin-bottom: 10px;
    line-height: 1.4;
}

.card-summary {
    font-size: 14px;
    color: #777;
    line-height: 1.7;
    flex: 1;
}

.card-time {
    font-size: 13px;
    color: #555;
    margin-top: 16px;
    text-align: right;
}

/* ── 弹窗（从底部滑入）── */
.modal-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.modal-overlay.active {
    transform: translateY(0);
}

.modal-panel {
    max-width: 680px;
    width: 90%;
    max-height: 85vh;
    background: #111;
    border: 1px solid #2a2a2a;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    padding: 40px 40px 24px;
}

.modal-scroll {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 12px;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 18px;
    font-size: 28px;
    color: #333;
    background: none;
    border: none;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.modal-close:hover {
    color: #fff;
}

.modal-img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 2px;
    margin-bottom: 24px;
    display: none;
}

.modal-img.has-img {
    display: block;
}

.modal-title {
    font-size: 26px;
    color: #eee;
    font-family: "Good Old DOS", "TianChengBit", monospace;
    margin: 0 0 8px;
    flex-shrink: 0;
}

.modal-time {
    font-size: 13px;
    color: #666;
    display: block;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1f1f1f;
    flex-shrink: 0;
}

.modal-body {
    font-size: 16px;
    color: #aaa;
    line-height: 1.9;
}

/* ── 底部红光（面板下半部分）── */
.modal-panel::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to top, rgba(255,40,79,0.55) 0%, rgba(255,40,79,0.25) 50%, rgba(255,40,79,0.06) 85%, transparent 100%);
    pointer-events: none;
    border-radius: 0 0 24px 24px;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.modal-panel.glow::after {
    opacity: 1;
}

.modal-link {
    display: block;
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: 18px;
    color: #888;
    text-decoration: none;
    padding: 14px 0 24px;
    flex-shrink: 0;
    transition: color 0.2s, text-shadow 0.3s;
}

.modal-link:hover {
    color: #fff;
    text-shadow: 0 0 16px #ff284f88, 0 0 40px #ff284f44;
}

/* ── 索引弹窗（clip-path circle 辐射动画）── */
.index-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    padding: 32px;
    color: #333;
    background-color: #ccc;
    z-index: 100;
    clip-path: circle(0% at 104px calc(100vh - 48px));
    pointer-events: none;
}

.index-overlay.active {
    clip-path: circle(150% at 104px calc(100vh - 48px));
    pointer-events: auto;
    transition: clip-path 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.index-overlay:not(.active) {
    transition: clip-path 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.index-page {
    position: absolute;
    top: 32px;
    left: 32px;
    right: 32px;
    bottom: 32px;
    display: flex;
    flex-direction: column;
}

.index-title {
    font-size: 100px;
    font-family: "Good Old DOS", "TianChengBit", monospace;
    font-weight: normal;
    margin: 0 0 32px;
    color: #222;
    letter-spacing: 8px;
}

.index-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 12px;
}

.index-date {
    font-size: 13px;
    color: #666;
    margin: 24px 0 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid #999;
}

.index-date:first-child {
    margin-top: 0;
}

.index-content {
    height: calc(100vh - 250px);
    overflow: auto;
    scrollbar-color: #aaa #0000;
    scrollbar-width: thin;
}

.index-blank {
    height: 120px;
}

.index-mask {
    position: absolute;
    bottom: 0px;
    width: 100%;
    height: 90px;
    background: linear-gradient(#ccc0, #ccc, #ccc);
}

.index-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 6px;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s;
}

.index-item:hover {
    background: rgba(0, 0, 0, 0.06);
}

.index-badge {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 2px;
    font-size: 12px;
    font-family: "Good Old DOS", "TianChengBit", monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.index-badge-article {
    background: #c8d6c8;
    color: #2a5a2a;
}

.index-badge-note {
    background: #ccc8d6;
    color: #3a3a7a;
}

.index-item-text {
    font-size: 15px;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.index-item-time {
    font-size: 12px;
    color: #777;
    flex-shrink: 0;
}

/* ── 滚动条 ── */
.log-viewport::-webkit-scrollbar {
    height: 6px;
}

.log-viewport::-webkit-scrollbar-thumb {
    background-color: #2a2a2a;
    border-radius: 3px;
}

.log-viewport::-webkit-scrollbar-track {
    background-color: #0a0a0a;
}