/* 信件/明信片 样式 — 从 extras.css 拆分 */
/* --- 【全新 V3.0】信件功能样式 (可翻转明信片) --- */

/* 1. 信件列表页: 简约明信片风格 (这部分保持不变) */
#letters-list-page .page-content {
    background-color: #f4f4f4;
    padding-top: 10px;
}
.postcard-item {
    background-color: #fff;
    margin: 0 15px 15px;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.postcard-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}
.postcard-image {
    width: 100%;
    padding-bottom: 65%;
    background-color: #eee;
    background-size: cover;
    background-position: center;
    filter: grayscale(80%);
}
.postcard-content { padding: 18px 20px; }
.postcard-content .letter-title { font-weight: 600; font-size: 17px; margin-bottom: 6px; color: #333; }
.postcard-content .letter-date { font-size: 13px; color: var(--secondary-text); }


/* 2. 【核心改造】信件详情页: 3D翻转舞台 */
#letter-view-page .page-content {
    background-color: #e9ecef; /* 改为灰色背景，突出卡片 */
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px; /* 关键：创建3D透视效果 */
    overflow: hidden; /* 防止卡片旋转时溢出 */
}

.postcard-container {
    width: 90%;
    max-width: 400px;
    height: 80%;
    max-height: 600px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d; /* 关键：让子元素保持3D空间 */
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.postcard-container.is-flipped {
    transform: rotateY(180deg); /* 关键：点击后沿Y轴翻转180度 */
}

.postcard-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* 关键：翻转后背面不可见 */
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
}

.postcard-front {
    background-color: #ccc;
    background-size: cover;
    background-position: center;
    display: flex; /* 用于放置提示文字 */
    justify-content: center;
    align-items: flex-end;
}
.postcard-front .flip-prompt {
    color: white;
    background: rgba(0,0,0,0.4);
    padding: 8px 15px;
    border-radius: 15px;
    margin-bottom: 20px;
    font-size: 14px;
    backdrop-filter: blur(5px);
}
/* --- 【V3.1 核心升级】美化明信片背面 --- */
.postcard-back {
    background-color: #fcfaf7; /* 更精致的米色背景 */
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    font-family: 'Songti SC', 'STSong', 'SimSun', serif; /* 优雅的宋体 */
}

/* 信件正文容器 */
.letter-content-wrapper {
    flex-grow: 1;
    overflow-y: auto;
    padding: 30px 35px; /* 加大内边距，提供呼吸感 */
    line-height: 2; /* 增大行距 */
    color: #4a4a4a;
    font-size: 16px;
    -webkit-overflow-scrolling: touch; /* 移动端滚动优化 */
}
/* 优化滚动条样式 */
.letter-content-wrapper::-webkit-scrollbar { width: 4px; }
.letter-content-wrapper::-webkit-scrollbar-track { background: transparent; }
.letter-content-wrapper::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

/* 信件标题 */
.letter-content-wrapper .letter-title {
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2em; /* 与正文拉开距离 */
}

/* 信件段落 */
.letter-content-wrapper .letter-body p {
    margin-bottom: 1.5em; /* 段落间距 */
    text-indent: 0; /* 取消强制首行缩进，采用段落间空行 */
}
.letter-content-wrapper .letter-body p:first-of-type {
    text-indent: 2em; /* 只让第一段首行缩进，更符合排版习惯 */
}


/* 优雅的分割线 */
.elegant-divider {
    border: none;
    height: 1px;
    background-color: #e0e0e0;
    margin: 0 35px;
}

/* 底部署名区域 */
.postcard-footer {
    flex-shrink: 0;
    padding: 20px 35px;
    display: flex;
    justify-content: flex-end; /* 整体靠右 */
    align-items: center;
    font-size: 15px;
    color: #777;
}

.postcard-footer .signature-area {
    text-align: right;
}
