/* 时光邮局 · 给未来写信 / 信箱
   温暖纸张风格，所有样式仅在 .future-letter-page 与 .letterbox-page 内生效 */

.future-letter-page,
.letterbox-page {
    --paper: #f4ebda;
    --paper-soft: #faf3e5;
    --paper-card: #fffdf8;
    --ink: #2f2a24;
    --ink-soft: #6d6357;
    --ink-faint: #9a8f81;
    --line: #e4d8c2;
    --line-strong: #d3c4a8;
    --seal: #b23a30;
    --seal-dark: #8f2c24;
    --seal-soft: #f7e6e1;
    --gold: #b98b25;
    --shadow: 0 18px 40px rgba(73, 54, 35, 0.10);
    --shadow-soft: 0 6px 18px rgba(73, 54, 35, 0.07);
    --radius: 18px;

    background-color: var(--paper);
    background-image:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.65), transparent 42%),
        radial-gradient(circle at 88% 0%, rgba(255, 250, 238, 0.8), transparent 40%);
    color: var(--ink);
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    min-height: 100vh;
    padding-bottom: 4rem;
    overflow-x: hidden;
}

.future-letter-page a,
.letterbox-page a {
    color: var(--ink);
    text-decoration: none;
}

.future-letter-page a:hover,
.letterbox-page a:hover {
    color: var(--seal);
    text-decoration: none;
}

.future-letter-page :focus-visible,
.letterbox-page :focus-visible {
    outline: 2px solid var(--seal);
    outline-offset: 2px;
}

/* ===== 顶部主视觉 ===== */
.fl-hero {
    position: relative;
    padding: 4.2rem 1.5rem 4.6rem;
    background: linear-gradient(180deg, #fffaf0 0%, #f6eddd 100%);
    border-bottom: 1px solid var(--line);
    overflow: hidden;
}

.fl-hero::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: repeating-linear-gradient(90deg, var(--line-strong) 0 8px, transparent 8px 16px);
}

.fl-hero-inner {
    position: relative;
    z-index: 2;
    max-width: 1160px;
    margin: 0 auto;
    padding-right: 200px;
}

.fl-kicker {
    display: inline-block;
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    color: var(--gold);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.fl-hero h1 {
    font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
    font-size: clamp(2.1rem, 4.6vw, 3.2rem);
    line-height: 1.2;
    letter-spacing: 0.06em;
    color: var(--ink);
    margin-bottom: 0.9rem;
}

.fl-hero p {
    color: var(--ink-soft);
    font-size: 1.02rem;
    max-width: 34em;
    margin-bottom: 1.8rem;
}

.fl-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.fl-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.05rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: rgba(255, 253, 248, 0.85);
    font-size: 0.88rem;
    color: var(--ink-soft);
    transition: all 0.2s ease;
}

.fl-chip i {
    color: var(--seal);
}

.fl-chip em {
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--seal);
    border-radius: 999px;
    min-width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.32rem;
}

.fl-chip:hover {
    border-color: var(--seal);
    color: var(--seal);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.fl-hero-mark {
    position: absolute;
    top: 50%;
    right: max(1.5rem, calc((100% - 1160px) / 2));
    transform: translateY(-50%) rotate(-8deg);
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px dashed rgba(178, 58, 48, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    color: var(--seal);
    font-family: "Noto Serif SC", "Songti SC", serif;
    text-align: center;
    opacity: 0.9;
    pointer-events: none;
}

.fl-hero-mark span {
    font-size: 2.6rem;
    line-height: 1;
    font-weight: 700;
}

.fl-hero-mark small {
    font-size: 0.58rem;
    letter-spacing: 0.18em;
    line-height: 1.5;
    color: var(--ink-faint);
}

/* ===== 主体布局 ===== */
.fl-wrap {
    position: relative;
    z-index: 3;
    max-width: 1160px;
    margin: -2.8rem auto 0;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    gap: 2rem;
    align-items: start;
}

.fl-wrap-done {
    grid-template-columns: minmax(0, 720px);
    justify-content: center;
}

.fl-card {
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2.2rem;
}

.fl-form-card {
    padding-bottom: 2rem;
}

/* ===== 分区标题 ===== */
.fl-section-head {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
    margin-bottom: 1.4rem;
}

.fl-section-head-gap {
    margin-top: 2.4rem;
    padding-top: 1.8rem;
    border-top: 1px dashed var(--line);
}

.fl-step {
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--seal);
    background: var(--paper-soft);
    letter-spacing: 0.02em;
}

.fl-section-head h2 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.16rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
}

.fl-section-head p {
    font-size: 0.82rem;
    color: var(--ink-faint);
}

/* ===== 表单 ===== */
.fl-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.fl-field {
    margin-bottom: 1.15rem;
}

.fl-label {
    display: block;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 0.45rem;
    letter-spacing: 0.02em;
}

.fl-label em {
    font-style: normal;
    font-weight: 400;
    font-size: 0.74rem;
    color: var(--ink-faint);
    margin-left: 0.3rem;
}

.fl-input,
.fl-textarea {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fffdf9;
    color: var(--ink);
    font-size: 0.95rem;
    font-family: inherit;
    padding: 0.78rem 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.fl-input::placeholder,
.fl-textarea::placeholder {
    color: #b3a795;
}

.fl-input:focus,
.fl-textarea:focus {
    outline: none;
    border-color: var(--seal);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(178, 58, 48, 0.09);
}

.fl-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.76rem;
    color: var(--ink-faint);
}

.fl-editor {
    position: relative;
}

.fl-textarea {
    min-height: 190px;
    line-height: 1.85;
    resize: vertical;
    padding-bottom: 3rem;
}

.fl-ai-btn {
    position: absolute;
    right: 0.8rem;
    bottom: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.42rem 0.85rem;
    border: 1px solid rgba(178, 58, 48, 0.35);
    background: var(--seal-soft);
    color: var(--seal);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fl-ai-btn:hover {
    background: var(--seal);
    color: #fff;
    border-color: var(--seal);
}

.fl-ai-btn:disabled {
    opacity: 0.55;
    cursor: wait;
}

/* AI 提示气泡 */
.fl-tip {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.5rem);
    background: #fffdf8;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(60, 44, 30, 0.16);
    padding: 0.7rem 0.9rem;
    font-size: 0.78rem;
    color: var(--ink-soft);
    line-height: 1.6;
    display: none;
    z-index: 20;
    max-width: 280px;
}

.fl-tip p {
    margin: 0;
}

.fl-tip b {
    color: var(--seal);
}

.fl-tip.show {
    display: block;
    animation: fl-fade-in 0.18s ease;
}

.fl-tip::after {
    content: "";
    position: absolute;
    right: 1.4rem;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: #fffdf8;
    border-right: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
    transform: rotate(45deg);
}

.fl-tip-warn {
    background: #fdf3ee;
    border-color: #eccfc5;
    color: var(--seal-dark);
}

.fl-tip-warn::after {
    background: #fdf3ee;
    border-color: #eccfc5;
}

.fl-tip-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

.fl-tip-btn {
    border: 1px solid var(--line-strong);
    background: #fff;
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 0.25rem 0.85rem;
    font-size: 0.76rem;
    cursor: pointer;
}

.fl-tip-confirm {
    background: var(--seal);
    color: #fff;
    border-color: var(--seal);
}

.fl-counter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.55rem;
    font-size: 0.76rem;
    color: var(--ink-faint);
}

.fl-counter b {
    color: var(--ink-soft);
}

.fl-counter-bar {
    flex: 1;
    height: 4px;
    border-radius: 999px;
    background: #eee3ce;
    overflow: hidden;
}

.fl-counter-bar span {
    display: block;
    width: 0;
    height: 100%;
    background: var(--gold);
    transition: width 0.15s linear, background 0.2s ease;
}

.fl-counter-bar span.is-warn {
    background: var(--seal);
}

#remainingChars.is-warn {
    color: var(--seal);
}

.fl-error {
    display: none;
    margin-top: 0.4rem;
    color: var(--seal);
    font-size: 0.78rem;
}

.fl-error.show {
    display: block;
}

/* 模板 */
.fl-templates {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.6rem;
}

.fl-template {
    border: 1px solid var(--line);
    background: var(--paper-soft);
    color: var(--ink-soft);
    border-radius: 10px;
    padding: 0.65rem 0.4rem;
    font-size: 0.82rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.fl-template i {
    color: var(--gold);
    font-size: 0.85rem;
}

.fl-template:hover {
    border-color: var(--seal);
    color: var(--seal);
    background: #fff;
    transform: translateY(-1px);
}

/* 公开 / 私密 */
.fl-visibility {
    border: 0;
    padding: 0;
    margin: 0 0 1rem;
}

.fl-visibility legend {
    padding: 0;
    margin-bottom: 0.55rem;
}

.fl-vis-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    cursor: pointer;
    background: #fffdf9;
    transition: all 0.2s ease;
    margin-bottom: 0.6rem;
}

.fl-vis-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fl-vis-icon {
    flex: none;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-faint);
    background: var(--paper-soft);
    transition: all 0.2s ease;
}

.fl-vis-text b {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 0.15rem;
}

.fl-vis-text small {
    display: block;
    font-size: 0.78rem;
    color: var(--ink-faint);
    line-height: 1.55;
}

.fl-vis-option:hover {
    border-color: var(--line-strong);
}

.fl-vis-option:has(input:checked) {
    border-color: var(--seal);
    background: #fff8f5;
    box-shadow: 0 0 0 3px rgba(178, 58, 48, 0.08);
}

.fl-vis-option input:checked ~ .fl-vis-icon {
    background: var(--seal);
    border-color: var(--seal);
    color: #fff;
}

.fl-anon {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1.2rem;
    padding: 0.65rem 0.9rem;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    font-size: 0.82rem;
    color: var(--ink-soft);
    cursor: pointer;
    background: rgba(255, 253, 246, 0.7);
}

.fl-anon[hidden] {
    display: none;
}

.fl-anon input {
    accent-color: var(--seal);
    width: 15px;
    height: 15px;
}

.fl-actions {
    margin-top: 1.6rem;
    text-align: center;
}

.fl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2.2rem;
    border-radius: 999px;
    font-size: 0.98rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.fl-btn-primary {
    background: var(--seal);
    color: #fff;
    box-shadow: 0 10px 22px rgba(178, 58, 48, 0.24);
}

.fl-btn-primary:hover {
    background: var(--seal-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(178, 58, 48, 0.28);
}

.fl-btn-ghost {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink-soft);
}

.fl-btn-ghost:hover {
    border-color: var(--seal);
    color: var(--seal);
}

.fl-btn-submit {
    min-width: 220px;
}

.fl-actions-note {
    margin-top: 0.7rem;
    font-size: 0.76rem;
    color: var(--ink-faint);
}

/* 提示条 */
.fl-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    background: var(--seal-soft);
    border: 1px solid #eccfc5;
    color: var(--seal-dark);
    font-size: 0.85rem;
    margin-bottom: 1.3rem;
}

/* ===== 右侧预览 ===== */
.fl-side {
    position: sticky;
    top: 1.5rem;
    align-self: start;
}

.fl-preview {
    background: #fbf5e8;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.2rem;
}

.fl-preview-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding-bottom: 0.7rem;
    margin-bottom: 1rem;
    border-bottom: 1px dashed var(--line-strong);
    font-size: 0.78rem;
    color: var(--ink-faint);
}

.fl-preview-head span:first-child {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 0.95rem;
    color: var(--ink);
    letter-spacing: 0.06em;
}

#previewDate {
    text-align: right;
}

/* 信封 */
.fl-envelope {
    position: relative;
    background: linear-gradient(165deg, #fffdf7 0%, #f7edd8 100%);
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    padding: 1.1rem 1.2rem 0.9rem;
    box-shadow: 0 10px 22px rgba(80, 60, 40, 0.08);
    overflow: hidden;
}

.fl-envelope::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 58px;
    background: linear-gradient(180deg, #f6ead2 0%, #fdf7ea 100%);
    border-bottom: 1px solid rgba(211, 196, 168, 0.55);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    opacity: 0.75;
}

.fl-env-top {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.9rem;
    min-height: 62px;
}

.fl-stamp {
    width: 52px;
    height: 62px;
    border: 1.5px dashed var(--seal);
    border-radius: 4px;
    color: var(--seal);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-family: "Noto Serif SC", "Songti SC", serif;
    background: rgba(255, 250, 240, 0.85);
    transform: rotate(-4deg);
    font-size: 0.72rem;
}

.fl-stamp i {
    font-size: 0.85rem;
}

.fl-postmark {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    border: 1.5px dashed rgba(109, 99, 87, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    color: var(--ink-faint);
    transform: rotate(9deg);
}

.fl-postmark b {
    font-size: 0.66rem;
    letter-spacing: 0.12em;
}

.fl-postmark small {
    font-size: 0.44rem;
    letter-spacing: 0.08em;
}

.fl-env-body {
    position: relative;
    z-index: 2;
    padding: 0.2rem 0.1rem 0.4rem;
}

.fl-env-label {
    font-size: 0.62rem;
    letter-spacing: 0.28em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-bottom: 0.1rem;
}

.fl-env-to {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.3rem;
    letter-spacing: 0.05em;
    color: var(--ink);
    word-break: break-all;
    line-height: 1.4;
}

.fl-env-subject {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--ink-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fl-env-foot {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.85rem;
    padding-top: 0.6rem;
    border-top: 1px dashed rgba(211, 196, 168, 0.8);
    font-size: 0.72rem;
    color: var(--ink-faint);
}

#previewBadge {
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: #fffdf7;
}

#previewBadge.is-public {
    color: var(--seal);
    border-color: rgba(178, 58, 48, 0.4);
    background: var(--seal-soft);
}

#previewAnon[hidden] {
    display: none;
}

/* 信纸 */
.fl-paper {
    margin-top: 1rem;
    position: relative;
    background-color: #fffdf6;
    background-image: repeating-linear-gradient(
        180deg,
        transparent 0,
        transparent 27px,
        rgba(180, 150, 110, 0.16) 27px,
        rgba(180, 150, 110, 0.16) 28px
    );
    background-position: 0 3.1rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 1.1rem 1.2rem 1.3rem;
}

.fl-paper-head {
    display: flex;
    justify-content: space-between;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: var(--ink-faint);
    padding-bottom: 0.6rem;
    margin-bottom: 0.7rem;
    border-bottom: 1px solid rgba(228, 216, 194, 0.9);
    font-family: "Noto Serif SC", "Songti SC", serif;
}

.fl-paper h4 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 0.95rem;
    color: var(--ink);
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.fl-paper #previewText {
    font-size: 0.88rem;
    line-height: 1.9;
    color: #4a4239;
    white-space: pre-wrap;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 10;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 5.7rem;
}

.fl-paper #previewText.is-placeholder {
    color: #b6aa98;
}

.fl-paper-sign {
    margin-top: 0.8rem;
    text-align: right;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 0.85rem;
    color: var(--ink-soft);
    min-height: 1.2rem;
}

.fl-preview-note {
    margin-top: 0.9rem;
    font-size: 0.72rem;
    color: var(--ink-faint);
    text-align: center;
}

.fl-preview-note i {
    margin-right: 0.25rem;
}

/* ===== 成功态 ===== */
.fl-done {
    text-align: center;
    padding: 3.4rem 2rem 2.8rem;
}

.fl-done-seal {
    width: 76px;
    height: 76px;
    margin: 0 auto 1.4rem;
    border-radius: 50%;
    border: 2px dashed rgba(178, 58, 48, 0.5);
    color: var(--seal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    background: var(--seal-soft);
    transform: rotate(-6deg);
}

.fl-done h2 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.6rem;
    letter-spacing: 0.08em;
    margin-bottom: 0.7rem;
}

.fl-done > p {
    color: var(--ink-soft);
    font-size: 0.92rem;
}

.fl-done-note {
    margin-top: 1.1rem;
    padding: 0.9rem 1.1rem;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--paper-soft);
    font-size: 0.8rem;
    line-height: 1.8;
    color: var(--ink-faint);
}

.fl-done-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.8rem;
}

/* ===== 小贴士 ===== */
.fl-tips {
    max-width: 1160px;
    margin: 3.4rem auto 0;
    padding: 0 1.5rem;
}

.fl-tips h3 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    text-align: center;
    font-size: 1.25rem;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    color: var(--ink);
}

.fl-tips-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.fl-tip-card {
    background: rgba(255, 253, 248, 0.75);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.3rem 1.2rem;
    transition: all 0.2s ease;
}

.fl-tip-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-soft);
}

.fl-tip-card i {
    color: var(--seal);
    font-size: 1.1rem;
    margin-bottom: 0.7rem;
    display: inline-block;
}

.fl-tip-card b {
    display: block;
    font-size: 0.92rem;
    margin-bottom: 0.4rem;
    letter-spacing: 0.03em;
}

.fl-tip-card p {
    font-size: 0.79rem;
    line-height: 1.75;
    color: var(--ink-faint);
}

/* ===== 蜜罐字段 ===== */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ===== 加载层 ===== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(249, 243, 232, 0.82);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-overlay.show {
    display: flex;
}

.loading-content {
    text-align: center;
    color: var(--ink-soft);
    font-size: 0.85rem;
}

.loading-spinner {
    width: 38px;
    height: 38px;
    margin: 0 auto 0.9rem;
    border: 3px solid rgba(178, 58, 48, 0.15);
    border-top-color: var(--seal);
    border-radius: 50%;
    animation: fl-spin 0.9s linear infinite;
}

@keyframes fl-spin {
    to { transform: rotate(360deg); }
}

@keyframes fl-fade-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   信箱页
   ========================================================= */
.lb-hero {
    padding: 3.8rem 1.5rem 3.2rem;
    background: linear-gradient(180deg, #fffaf0 0%, #f6eddd 100%);
    border-bottom: 1px solid var(--line);
}

.lb-hero-inner {
    max-width: 1160px;
    margin: 0 auto;
}

.lb-hero h1 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: clamp(1.9rem, 4vw, 2.7rem);
    letter-spacing: 0.1em;
    margin: 0.4rem 0 0.8rem;
}

.lb-hero p {
    color: var(--ink-soft);
    font-size: 0.95rem;
    max-width: 44em;
}

.lb-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.6rem;
    margin-top: 1.6rem;
}

.lb-stat b {
    display: block;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.6rem;
    line-height: 1.1;
    color: var(--seal);
}

.lb-stat span {
    font-size: 0.76rem;
    color: var(--ink-faint);
    letter-spacing: 0.08em;
}

.lb-main {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.lb-tabs {
    display: flex;
    gap: 0.45rem;
    padding: 0.4rem;
    margin: -1.35rem 0 2rem;
    background: #fffdf8;
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    width: fit-content;
    position: relative;
    z-index: 3;
}

.lb-tab {
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-family: inherit;
    padding: 0.55rem 1.3rem;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition: all 0.2s ease;
}

.lb-tab em {
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink-faint);
}

.lb-tab.is-active {
    background: var(--seal);
    color: #fff;
    box-shadow: 0 8px 18px rgba(178, 58, 48, 0.22);
}

.lb-tab.is-active em {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.lb-panel {
    display: none;
    padding-bottom: 1rem;
}

.lb-panel.is-active {
    display: block;
}

.lb-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lb-panel-head h2 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.1rem;
    letter-spacing: 0.06em;
}

.lb-panel-head span {
    font-size: 0.76rem;
    color: var(--ink-faint);
}

/* 公开信卡片 */
.lb-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.1rem;
}

.lb-card {
    position: relative;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.4rem 1.3rem 1.2rem;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: all 0.22s ease;
    text-align: left;
    font-family: inherit;
    color: var(--ink);
    overflow: hidden;
}

.lb-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--seal);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lb-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: var(--line-strong);
}

.lb-card:hover::before {
    opacity: 1;
}

.lb-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
}

.lb-card-tag {
    font-size: 0.66rem;
    letter-spacing: 0.16em;
    color: var(--gold);
    text-transform: uppercase;
}

.lb-card-date {
    font-size: 0.7rem;
    color: var(--ink-faint);
}

.lb-card h3 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.04rem;
    line-height: 1.5;
    margin-bottom: 0.55rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lb-card-excerpt {
    font-size: 0.82rem;
    line-height: 1.85;
    color: var(--ink-soft);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
    flex: 1;
}

.lb-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--line);
    font-size: 0.74rem;
    color: var(--ink-faint);
}

.lb-card-foot .lb-more {
    color: var(--seal);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* 信箱列表 */
.lb-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.lb-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    gap: 1.1rem;
    align-items: center;
    background: var(--paper-card);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 1rem 1.15rem;
    transition: all 0.2s ease;
}

.lb-row:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-soft);
}

.lb-row-date {
    text-align: center;
    border-right: 1px dashed var(--line);
    padding-right: 1rem;
}

.lb-row-date b {
    display: block;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.25rem;
    line-height: 1.15;
    color: var(--ink);
}

.lb-row-date span {
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
}

.lb-row-main {
    min-width: 0;
}

.lb-row-main h3 {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 0.98rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink);
}

.lb-row-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.9rem;
    font-size: 0.74rem;
    color: var(--ink-faint);
}

.lb-row-meta i {
    margin-right: 0.25rem;
    color: var(--line-strong);
}

.lb-badge {
    flex: none;
    font-size: 0.72rem;
    padding: 0.28rem 0.75rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    color: var(--ink-faint);
    background: var(--paper-soft);
    white-space: nowrap;
}

.lb-badge-pending {
    color: #8a6a1c;
    border-color: #e6d3a3;
    background: #fdf6e3;
}

.lb-badge-sent {
    color: var(--ink-faint);
    border-color: var(--line-strong);
    background: var(--paper-soft);
}

.lb-badge-review {
    color: var(--seal-dark);
    border-color: #eccfc5;
    background: var(--seal-soft);
}

.lb-badge-public {
    color: var(--seal);
    border-color: rgba(178, 58, 48, 0.4);
    background: var(--seal-soft);
}

/* 空状态 */
.lb-empty {
    text-align: center;
    padding: 4rem 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    background: rgba(255, 253, 248, 0.7);
    color: var(--ink-faint);
}

.lb-empty i {
    font-size: 1.8rem;
    color: var(--line-strong);
    margin-bottom: 0.9rem;
    display: block;
}

.lb-empty p {
    font-size: 0.88rem;
    margin-bottom: 0.3rem;
}

.lb-empty small {
    font-size: 0.76rem;
}

.lb-empty a {
    color: var(--seal);
    font-weight: 600;
}

.lb-footnote {
    margin-top: 2rem;
    font-size: 0.75rem;
    color: var(--ink-faint);
    text-align: center;
}

/* 阅读弹层 */
.lb-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(41, 30, 21, 0.55);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.lb-modal.is-open {
    display: flex;
}

.lb-modal-card {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 86vh;
    overflow-y: auto;
    background: #fffdf7;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    box-shadow: 0 30px 70px rgba(30, 20, 12, 0.35);
    padding: 2.2rem 2.4rem 2.4rem;
}

.lb-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--line);
    background: var(--paper-soft);
    color: var(--ink-faint);
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lb-modal-close:hover {
    color: var(--seal);
    border-color: var(--seal);
}

.lb-modal-kicker {
    font-size: 0.66rem;
    letter-spacing: 0.24em;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

.lb-modal-title {
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: 1.45rem;
    line-height: 1.5;
    letter-spacing: 0.04em;
    margin-bottom: 0.8rem;
    padding-right: 2rem;
}

.lb-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.1rem;
    font-size: 0.76rem;
    color: var(--ink-faint);
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px dashed var(--line);
}

.lb-modal-body {
    font-size: 0.94rem;
    line-height: 2;
    color: #3f3830;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: "Noto Serif SC", "Songti SC", serif;
}

.lb-modal-sign {
    margin-top: 1.6rem;
    text-align: right;
    font-family: "Noto Serif SC", "Songti SC", serif;
    color: var(--ink-soft);
    font-size: 0.9rem;
}

body.lb-modal-open {
    overflow: hidden;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
    .fl-wrap {
        grid-template-columns: minmax(0, 1fr);
        margin-top: -2rem;
        gap: 1.6rem;
    }

    .fl-side {
        position: static;
    }

    .fl-preview {
        max-width: 560px;
        margin: 0 auto;
    }

    .fl-tips-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .lb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .fl-hero-mark {
        opacity: 0.35;
    }
}

@media (max-width: 768px) {
    .fl-hero {
        padding: 2.8rem 1rem 3.4rem;
    }

    .fl-hero-inner {
        padding-right: 0;
    }

    .fl-hero-mark {
        display: none;
    }

    .fl-wrap {
        padding: 0 1rem;
        margin-top: -1.8rem;
    }

    .fl-card {
        padding: 1.5rem 1.2rem;
        border-radius: 14px;
    }

    .fl-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .fl-templates {
        grid-template-columns: repeat(2, 1fr);
    }

    .fl-tips {
        padding: 0 1rem;
        margin-top: 2.4rem;
    }

    .fl-tips-grid {
        grid-template-columns: 1fr;
    }

    .fl-tip {
        right: 0;
        left: 0;
        max-width: none;
    }

    .fl-tip::after {
        display: none;
    }

    .fl-btn-submit {
        width: 100%;
    }

    .lb-hero {
        padding: 2.6rem 1rem 2.8rem;
    }

    .lb-main {
        padding: 0 1rem;
    }

    .lb-grid {
        grid-template-columns: 1fr;
    }

    .lb-row {
        grid-template-columns: 68px minmax(0, 1fr);
        grid-template-areas:
            "date main"
            "badge badge";
        gap: 0.6rem 0.9rem;
        padding: 0.9rem;
    }

    .lb-row-date {
        grid-area: date;
    }

    .lb-row-main {
        grid-area: main;
    }

    .lb-badge {
        grid-area: badge;
        justify-self: start;
        margin-left: 0;
    }

    .lb-badge {
        margin-left: calc(68px + 0.9rem);
    }

    .lb-modal {
        padding: 0.8rem;
    }

    .lb-modal-card {
        padding: 1.5rem 1.2rem 1.8rem;
        max-height: 90vh;
    }

    .lb-modal-title {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .fl-hero h1 {
        letter-spacing: 0.03em;
    }

    .fl-hero-actions {
        gap: 0.5rem;
    }

    .fl-chip {
        font-size: 0.8rem;
        padding: 0.45rem 0.8rem;
    }

    .fl-done {
        padding: 2.4rem 1.2rem 2rem;
    }

    .fl-done-actions .fl-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .future-letter-page *,
    .letterbox-page * {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
}
