/* 邮件 · 馆藏信函方案。列表排版与奖励色在原始/午夜主题中保持一致。 */
#mailboxPopup {
    background: rgba(7, 12, 13, .76);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

#mailboxPopup .mailbox-card {
    display: flex;
    flex-direction: column;
    width: min(92vw, 430px);
    max-width: 430px;
    max-height: 85vh;
    max-height: min(750px, calc(100dvh - 30px));
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(188, 164, 117, .5);
    border-radius: 16px;
    background: linear-gradient(150deg, #242922, #131b1b 50%, #1c211d);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 22px 55px rgba(0, 0, 0, .72);
    color: #eee7d5;
}

#mailboxPopup .mailbox-header {
    flex: none;
    padding: 22px 22px 16px;
    border-bottom: 1px solid rgba(190, 169, 121, .3);
}

#mailboxPopup .mailbox-eyebrow {
    color: #c0a979;
    font-size: 10px;
    letter-spacing: 3px;
}

#mailboxPopup .mailbox-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 7px;
}

#mailboxPopup .mailbox-heading h3 {
    margin: 0;
    color: #f0ddb0;
    font-family: SimSun, "Songti SC", serif;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    -webkit-text-fill-color: currentColor;
    text-shadow: none;
}

#mailboxPopup .mailbox-close {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(190, 169, 121, .45);
    border-radius: 5px;
    background: rgba(15, 24, 24, .7);
    color: #dfd1ad;
    font-size: 20px;
    line-height: 1;
}

#mailboxPopup .mailbox-header p {
    margin: 6px 0 0;
    color: #aaa99f;
    font-size: 11px;
}

#mailboxPopup .mailbox-list {
    flex: 1;
    min-height: 0;
    margin: 0;
    padding: 0 22px;
    overflow-x: hidden;
    overflow-y: auto;
    scrollbar-color: #796f53 #171e1b;
    color: #eee7d5;
    font-size: 13px;
    line-height: 1.6;
}

#mailboxPopup .mailbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 3px;
    color: #d3b883;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
}

#mailboxPopup .mailbox-group:after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(155, 141, 106, .4);
}

#mailboxPopup .mailbox-entry {
    padding: 15px 0 16px;
    border-bottom: 1px solid rgba(173, 161, 125, .24);
}

#mailboxPopup .mailbox-entry.is-read .mailbox-title,
#mailboxPopup .mailbox-entry.is-read .mailbox-content { opacity: .68; }

#mailboxPopup .mailbox-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #aaa99f;
    font-size: 10px;
}

#mailboxPopup .mailbox-tag {
    padding: 1px 5px;
    border: 1px solid rgba(171, 88, 179, .34);
    border-radius: 3px;
    background: #3b2940;
    color: #dfa7df;
}

#mailboxPopup .mailbox-entry.is-personal .mailbox-tag {
    border-color: rgba(168, 149, 108, .43);
    background: #34362b;
    color: #d8c38e;
}

#mailboxPopup .mailbox-meta time {
    margin-left: auto;
    white-space: nowrap;
}

#mailboxPopup .mailbox-title {
    margin: 7px 0 5px;
    color: #f2ebd9;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

#mailboxPopup .mailbox-content {
    margin: 0;
    color: #c0beb2;
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

#mailboxPopup .mailbox-entry-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 7px 10px;
    margin-top: 10px;
    min-height: 25px;
}

#mailboxPopup .mailbox-rewards {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    min-width: 0;
}

#mailboxPopup .mailbox-reward {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

#mailboxPopup .mailbox-reward img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

#mailboxPopup .mailbox-reward.gold { color: #ffd700; }
#mailboxPopup .mailbox-reward.emerald { color: #4caf50; }
#mailboxPopup .mailbox-reward.ruby { color: #e53939; }
#mailboxPopup .mailbox-reward.sapphire { color: #4488ff; }
#mailboxPopup .mailbox-reward.item { color: #ff8800; }
#mailboxPopup .mailbox-reward.other { color: #d9c692; }

#mailboxPopup .mailbox-entry-foot button {
    margin-left: auto;
    padding: 6px 16px;
    border: 1px solid #e8d5a2;
    border-radius: 4px;
    background: #d8b96d;
    color: #181d18;
    font-size: 11px;
    font-weight: 900;
}

#mailboxPopup .mailbox-entry-foot button:hover,
#mailboxPopup .mailbox-entry-foot button:focus-visible,
#mailboxPopup .mailbox-close:hover,
#mailboxPopup .mailbox-close:focus-visible {
    filter: brightness(1.15);
    outline: 2px solid #e5d1a0;
    outline-offset: 2px;
}

#mailboxPopup .mailbox-expiry,
#mailboxPopup .mailbox-claimed {
    color: #9ea79b;
    font-size: 10px;
}

#mailboxPopup .mailbox-empty {
    padding: 26px 8px;
    color: #a4a69c;
    font-size: 12px;
    text-align: center;
}

#mailboxPopup .mailbox-actions {
    display: flex;
    flex: none;
    gap: 8px;
    padding: 13px 17px;
    border-top: 1px solid rgba(172, 152, 113, .29);
    background: #141b19;
}

#mailboxPopup .mailbox-actions .start-btn {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 10px 5px;
    border: 1px solid rgba(171, 150, 108, .44);
    border-radius: 5px;
    background: #2d342d !important;
    color: #e9dfc8;
    font-size: 11px;
    font-weight: 700;
    text-shadow: none;
    box-shadow: none;
}

#mailboxPopup .mailbox-actions .start-btn:first-child {
    border-color: #d6bf87;
    background: #c9ae76 !important;
    color: #1a211d;
}

@media (max-width: 360px) {
    #mailboxPopup .mailbox-header { padding: 18px 15px 14px; }
    #mailboxPopup .mailbox-list { padding: 0 15px; }
    #mailboxPopup .mailbox-meta { flex-wrap: wrap; }
}
