/* Moment Page — Doodle Studio Style */
/* 公共样式（CSS变量/页面基础/header涂鸦化/动画/reveal/skeleton/toast）已提取至 common.css */

/* moment 专属：浮层层叠 */
body.page-moment .image-viewer { position: fixed; z-index: 9999; }
body.page-moment .share-panel,
body.page-moment .wechat-share-modal,
body.page-moment .poster-modal { position: fixed; z-index: 1100; }

/* moment 专属动画 */
@keyframes pop-in {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* ====== 通用 main ====== */
.page-moment .main {
    max-width: 48rem;
    margin: 0 auto;
    padding: 0 16px;
}

/* ====== 骨架屏子类（基础 .skeleton 已提取至 common.css） ====== */
.skeleton-inline { display: inline-block; height: 14px; width: 100px; }
.skeleton-avatar { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-author { height: 16px; width: 100px; margin-bottom: 6px; }
.skeleton-meta-line { height: 12px; width: 160px; }
.skeleton-line { height: 14px; margin-bottom: 12px; }
.skeleton-line-short { width: 60%; }
.skeleton-image-block { height: 240px; margin-top: 20px; border-radius: 16px; }

/* ====== 札记卡片 ====== */
.skeleton-entry, .entry-loaded {
    background: #fff;
    border: 3px solid var(--ink);
    border-radius: 28px;
    box-shadow: var(--shadow-hard-lg);
    overflow: hidden;
    margin: 96px 0 48px;
    position: relative;
}
.entry-loaded { animation: pop-in 0.5s cubic-bezier(0.16, 1, 0.3, 1); }

/* 档案条 */
.entry-archive-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
}
.archive-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--yellow);
    color: var(--ink);
    padding: 3px 10px;
    border-radius: 999px;
    border: 1.5px solid var(--ink);
    box-shadow: var(--shadow-hard-sm);
    text-transform: uppercase;
}
.archive-mark svg { width: 12px; height: 12px; }
.archive-divider {
    width: 2px;
    height: 12px;
    background: var(--ink);
    opacity: 0.3;
}
.archive-text { color: #6b7280; }
.archive-spacer { flex: 1; }
.archive-italic {
    color: var(--blue);
    font-style: italic;
    font-weight: 700;
}

/* 作者卡片 */
.entry-placard {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 2px dashed var(--ink);
}
.placard-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-hard-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--green);
}
.placard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.placard-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--font-doodle);
    font-weight: 900;
    font-size: 20px;
    color: var(--ink);
}
.placard-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-doodle);
    font-weight: 700;
    font-size: 14px;
    color: var(--ink);
    flex-wrap: wrap;
}
.placard-author { font-weight: 900; }
.dot { color: #d1d5db; }

/* 正文区 */
.entry-body { padding: 32px 24px; }
.entry-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 24px;
}
.entry-rule::after {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
}
.rule-label {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #fff;
    background: var(--pink);
    padding: 3px 10px;
    border-radius: 999px;
    border: 1.5px solid var(--ink);
    box-shadow: var(--shadow-hard-sm);
}
.entry-rule-end { margin-top: 32px; margin-bottom: 0; }
.entry-rule-end::before {
    content: '';
    flex: 1;
    height: 2px;
    background: var(--ink);
    border-radius: 1px;
}
.entry-rule-end::after { display: none; }
.entry-rule-end .rule-label { background: var(--blue); }

.entry-content { font-family: var(--font-doodle); }
.entry-text {
    font-family: var(--font-doodle);
    font-weight: 600;
    font-size: 17px;
    line-height: 1.85;
    color: var(--ink);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 24px;
}

/* 图片 */
.entry-image-single {
    margin: 24px 0;
    position: relative;
}
.entry-image-single img {
    width: 100%;
    border: 3px solid var(--ink);
    border-radius: 20px;
    box-shadow: var(--shadow-hard);
    cursor: pointer;
    transition: transform 0.2s ease;
    display: block;
}
.entry-image-single img:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.entry-image-single figcaption,
.entry-image-grid figcaption {
    margin-top: 8px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #888;
    text-align: center;
}
.entry-image-grid {
    display: grid;
    gap: 12px;
    margin: 24px 0;
}
.entry-image-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.entry-image-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.entry-image-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
.entry-image-grid figure { margin: 0; }
.entry-image-grid img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-hard-sm);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
}
.entry-image-grid img:hover { transform: translate(-2px, -2px) rotate(-2deg); box-shadow: var(--shadow-hard); }

/* 链接卡 */
.entry-reference {
    display: block;
    margin: 24px 0;
    padding: 18px 20px;
    background: var(--green);
    border: 2px solid var(--ink);
    border-radius: 18px;
    box-shadow: var(--shadow-hard);
    text-decoration: none;
    color: var(--ink);
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.entry-reference:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard-lg); }
.ref-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--ink);
    margin-bottom: 8px;
}
.ref-label svg { width: 14px; height: 14px; }
.ref-title {
    font-family: var(--font-doodle);
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 4px;
    word-break: break-word;
}
.ref-url {
    font-family: var(--font-mono);
    font-size: 12px;
    color: #4b5563;
}
.ref-arrow {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
}
.ref-arrow svg { width: 18px; height: 18px; }

/* 文章卡 */
.entry-essay {
    margin: 24px 0;
    padding: 20px;
    background: var(--yellow);
    border: 2px solid var(--ink);
    border-radius: 18px;
    box-shadow: var(--shadow-hard);
}
.essay-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--ink);
    margin-bottom: 10px;
}
.essay-label svg { width: 14px; height: 14px; }
.essay-title {
    font-family: var(--font-doodle);
    font-weight: 900;
    font-size: 18px;
    margin: 0 0 8px;
    color: var(--ink);
}
.essay-excerpt {
    font-family: var(--font-doodle);
    font-weight: 600;
    font-size: 14px;
    line-height: 1.6;
    color: #4b5563;
    margin: 0;
}

/* 底部 */
.entry-footer {
    padding: 24px;
    border-top: 2px dashed var(--ink);
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
}
.entry-tags-row { flex: 1; min-width: 200px; }
.footer-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: #888;
    margin-bottom: 8px;
}
.entry-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.entry-tag {
    display: inline-block;
    padding: 4px 12px;
    background: #fff;
    border: 1.5px solid var(--ink);
    border-radius: 999px;
    font-family: var(--font-doodle);
    font-weight: 700;
    font-size: 12px;
    color: var(--ink);
    box-shadow: var(--shadow-hard-sm);
}
.entry-tag:nth-child(3n+1) { background: var(--yellow); }
.entry-tag:nth-child(3n+2) { background: var(--green); }
.entry-tag:nth-child(3n+3) { background: var(--pink); color: #fff; }
.entry-tag-none { background: #f3f4f6; color: #9ca3af; }

/* 点赞按钮 */
.entry-like {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: var(--shadow-hard-sm);
    font-family: var(--font-doodle);
    font-weight: 800;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.entry-like:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard); }
.entry-like svg { width: 18px; height: 18px; color: var(--pink); transition: color 0.2s ease; }
.entry-like.liked { background: var(--pink); color: #fff; }
.entry-like.liked svg { color: #fff; }
.like-count { font-family: var(--font-mono); font-weight: 700; }

/* 相邻导航 */
.entry-nav {
    padding: 24px;
    border-top: 2px solid var(--ink);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.nav-loading {
    text-align: center;
    font-family: var(--font-doodle);
    font-weight: 700;
    color: #888;
    padding: 20px;
}
.nav-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.nav-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-hard-sm);
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.nav-card:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow-hard); }
.nav-back {
    background: var(--blue);
    color: #fff;
}
.nav-back:hover { box-shadow: var(--shadow-hard-lg); }
.nav-empty { opacity: 0.5; pointer-events: none; }
.nav-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.15em;
    opacity: 0.8;
}
.nav-label svg { width: 12px; height: 12px; }
.nav-title {
    font-family: var(--font-doodle);
    font-weight: 800;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}
.nav-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #888;
}
.nav-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px;
    text-align: center;
}
.nav-back .nav-title { font-size: 15px; }

/* ====== 图片查看器 doodle 化 ====== */
.image-viewer {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.image-viewer.active {
    opacity: 1;
    pointer-events: auto;
}
.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.92);
}
.image-viewer-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    overflow: hidden;
}
.image-viewer-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border: 3px solid #fff;
    border-radius: 16px;
    box-shadow: 0 0 0 3px var(--ink), 8px 8px 0 0 var(--yellow);
    cursor: grab;
    transition: box-shadow 0.2s ease;
}
.image-viewer-img:active { cursor: grabbing; }

/* 查看器按钮 doodle 化 */
.image-viewer-close,
.image-viewer-nav {
    position: absolute;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: 50%;
    box-shadow: var(--shadow-hard-sm);
    cursor: pointer;
    color: var(--ink);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.image-viewer-close { top: 24px; right: 24px; background: var(--pink); color: #fff; }
.image-viewer-close:hover { transform: rotate(90deg) scale(1.05); box-shadow: var(--shadow-hard); }
.image-viewer-prev { left: 24px; top: 50%; transform: translateY(-50%); background: var(--yellow); }
.image-viewer-prev:hover { transform: translateY(-50%) translateX(-3px); box-shadow: var(--shadow-hard); }
.image-viewer-next { right: 24px; top: 50%; transform: translateY(-50%); background: var(--green); }
.image-viewer-next:hover { transform: translateY(-50%) translateX(3px); box-shadow: var(--shadow-hard); }
.image-viewer-close svg,
.image-viewer-nav svg { width: 22px; height: 22px; }
.image-viewer-nav.hidden { display: none; }

/* 计数器和标题 */
.image-viewer-counter {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--blue);
    color: #fff;
    padding: 6px 18px;
    border-radius: 999px;
    border: 2px solid var(--ink);
    box-shadow: var(--shadow-hard-sm);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 13px;
}
.image-viewer-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    color: var(--ink);
    padding: 4px 14px;
    border-radius: 999px;
    border: 1.5px solid var(--ink);
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.1em;
}

/* 角落装饰 */
.image-viewer-frame-tl,
.image-viewer-frame-tr,
.image-viewer-frame-bl,
.image-viewer-frame-br {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 3px solid var(--yellow);
    pointer-events: none;
}
.image-viewer-frame-tl { top: 16px; left: 16px; border-right: none; border-bottom: none; border-radius: 12px 0 0 0; }
.image-viewer-frame-tr { top: 16px; right: 16px; border-left: none; border-bottom: none; border-radius: 0 12px 0 0; }
.image-viewer-frame-bl { bottom: 16px; left: 16px; border-right: none; border-top: none; border-radius: 0 0 0 12px; }
.image-viewer-frame-br { bottom: 16px; right: 16px; border-left: none; border-top: none; border-radius: 0 0 12px 0; }

/* ====== Toast 变体（基础 .toast 已提取至 common.css） ====== */
.toast.success { background: var(--green); color: var(--ink); box-shadow: 4px 4px 0 0 var(--ink); }
.toast.error { background: var(--pink); color: #fff; box-shadow: 4px 4px 0 0 var(--ink); }

/* ====== 分享按钮 ====== */
.entry-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.entry-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #fff;
    border: 2px solid var(--ink);
    border-radius: 999px;
    box-shadow: var(--shadow-hard-sm);
    font-family: var(--font-doodle);
    font-weight: 800;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.entry-share:hover { transform: translate(-1px, -1px); box-shadow: var(--shadow-hard); background: var(--blue); color: #fff; }
.entry-share svg { width: 18px; height: 18px; }

/* ====== 分享面板 ====== */
@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.share-panel {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.share-panel.active { display: flex; }
.share-panel-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.share-panel-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 4px solid var(--ink);
    border-radius: 28px;
    padding: 28px 24px;
    box-shadow: var(--shadow-hard-lg);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.share-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--ink);
}
.share-panel-header h3 {
    font-family: var(--font-doodle);
    font-size: 20px;
    font-weight: 900;
    color: var(--ink);
    margin: 0;
    letter-spacing: -0.01em;
}
.share-panel-close {
    width: 36px;
    height: 36px;
    background: var(--paper);
    border: 2px solid var(--ink);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-hard-sm);
    transition: all 0.2s ease;
}
.share-panel-close:hover {
    transform: rotate(90deg);
    background: var(--pink);
    color: #ffffff;
}
.share-panel-close svg { width: 18px; height: 18px; }
.share-platforms {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.share-platform-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--paper);
    border: 2px solid var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-hard-sm);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}
.share-platform-card:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard);
    background: var(--yellow);
}
.share-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    border: 2px solid var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: var(--shadow-hard-sm);
}
.share-card-icon.wechat { background: #07c160; color: #ffffff; }
.share-card-icon.link { background: var(--blue); color: #ffffff; }
.share-card-icon.poster { background: var(--orange); color: #ffffff; }
.share-card-icon svg { width: 22px; height: 22px; }
.share-card-info { flex: 1; }
.share-card-title {
    display: block;
    font-family: var(--font-doodle);
    font-size: 15px;
    font-weight: 900;
    color: var(--ink);
    margin-bottom: 2px;
}
.share-card-desc {
    display: block;
    font-family: var(--font-doodle);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted, #888);
}
.share-card-arrow { color: var(--ink); }
.share-card-arrow svg { width: 18px; height: 18px; }

/* ====== 微信分享 / 海报模态框 ====== */
.wechat-share-modal,
.poster-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}
.wechat-share-modal.active,
.poster-modal.active { display: flex; }
.wechat-share-overlay,
.poster-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.wechat-share-content,
.poster-modal-content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 380px;
    background: #ffffff;
    border: 4px solid var(--ink);
    border-radius: 28px;
    padding: 28px 24px;
    box-shadow: var(--shadow-hard-lg);
    animation: modalIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.wechat-share-close,
.poster-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    background: var(--paper);
    border: 2px solid var(--ink);
    color: var(--ink);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-hard-sm);
    transition: all 0.2s ease;
}
.wechat-share-close:hover,
.poster-modal-close:hover {
    transform: rotate(90deg);
    background: var(--pink);
    color: #ffffff;
}
.wechat-share-close svg,
.poster-modal-close svg { width: 18px; height: 18px; }
.wechat-share-header,
.poster-modal-header {
    text-align: center;
    margin-bottom: 20px;
}
.wechat-share-header h3,
.poster-modal-header h3 {
    font-family: var(--font-doodle);
    font-size: 20px;
    font-weight: 900;
    color: var(--ink);
    margin: 0 0 6px;
    letter-spacing: -0.01em;
}
.wechat-share-header p,
.poster-modal-header p {
    font-family: var(--font-doodle);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted, #888);
    margin: 0;
}
.wechat-share-preview,
.poster-preview {
    margin-bottom: 18px;
    text-align: center;
}
.wechat-share-preview img,
.poster-preview img,
.wechat-share-preview canvas,
.poster-preview canvas {
    max-width: 100%;
    border: 3px solid var(--ink);
    border-radius: 16px;
    box-shadow: var(--shadow-hard);
}
.wechat-share-actions,
.poster-actions {
    display: flex;
    justify-content: center;
}
.wechat-share-download-btn,
.poster-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--green);
    color: var(--ink);
    border: 3px solid var(--ink);
    border-radius: 16px;
    font-family: var(--font-doodle);
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: var(--shadow-hard-sm);
    transition: all 0.25s ease;
}
.wechat-share-download-btn:hover,
.poster-download-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hard);
    background: var(--yellow);
}
.wechat-share-download-btn svg,
.poster-download-btn svg { width: 16px; height: 16px; }

/* ====== 响应式 ====== */
@media (min-width: 640px) {
    .entry-archive-bar { padding: 16px 32px; }
    .entry-placard { padding: 24px 32px; }
    .entry-body { padding: 40px 32px; }
    .entry-footer { padding: 28px 32px; }
    .entry-nav { padding: 28px 32px; }
    .entry-text { font-size: 18px; }
}
