/* ── Index page styles ── */

.header {
    text-align: center;
    padding: 5rem 1rem 3rem;
    max-width: 800px;
    margin: 0 auto;
}

/* ── Avatar ── */
.avatar-wrap {
    position: relative;
    display: inline-block;
    margin: 0 auto 2rem;
}
.avatar {
    width: 120px;
    height: 120px;
    background: conic-gradient(
        from var(--avatar-angle),
        var(--accent-pink),
        var(--accent-blue),
        var(--accent-yellow),
        var(--accent-pink)
    );
    border-radius: 50%;
    border: 4px solid white;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(255, 183, 178, 0.25),
        0 0 60px rgba(168, 230, 207, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.6rem;
    line-height: 1;
    text-align: center;
    animation: float 3s ease-in-out infinite, avatarSpin 8s linear infinite;
    cursor: default;
    user-select: none;
}
.avatar-deco {
    position: absolute;
    font-size: 0.9rem;
    opacity: 0;
    animation: decoDrift 4s ease-in-out infinite;
    pointer-events: none;
}
.avatar-deco.d1 { top: -8px;   right: -5px;  animation-delay: 0s; }
.avatar-deco.d2 { bottom: 5px;  left: -12px;  animation-delay: 1s; }
.avatar-deco.d3 { top: 10px;   left: -10px;  animation-delay: 2s; }
.avatar-deco.d4 { bottom: -6px; right: -10px; animation-delay: 3s; }

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.header p {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* ── Dashboard cards ── */
.dashboard-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.7rem;
    max-width: 480px;
    margin: 1.2rem auto 0;
    position: relative;
}
/* Faint purple "·" bridging the pair — purple = pink+mint blended */
.dashboard-cards::after {
    content: '·';
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.4rem; line-height: 0;
    color: var(--accent-purple); opacity: 0.45;
    pointer-events: none;
}
.person-card {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    border: none;
    box-shadow: var(--liquid-shadow);
    backdrop-filter: var(--liquid-filter-soft);
    -webkit-backdrop-filter: var(--liquid-filter-soft);
    padding: 0.9rem 1.1rem 0.95rem;
    cursor: pointer;
    transition: transform 0.4s var(--spring), box-shadow 0.4s var(--ease-soft);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
/* Frosted surface + a soft diagonal wash unique to each person */
.person-card.jim {
    background:
        linear-gradient(135deg, rgba(168, 230, 207, 0.14), rgba(168, 230, 207, 0) 58%),
        var(--liquid-bg-soft);
}
.person-card.bling {
    background:
        linear-gradient(135deg, rgba(255, 183, 178, 0.13), rgba(255, 183, 178, 0) 58%),
        var(--liquid-bg-soft);
}
/* Corner glow that blooms on hover */
.person-card::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s var(--ease-soft);
    pointer-events: none;
}
.person-card.jim::before   { background: radial-gradient(circle at 85% 12%, rgba(168, 230, 207, 0.35), transparent 55%); }
.person-card.bling::before { background: radial-gradient(circle at 85% 12%, rgba(255, 183, 178, 0.33), transparent 55%); }
.person-card:hover { transform: translateY(-3px); box-shadow: var(--liquid-shadow-hover); }
.person-card:hover::before { opacity: 1; }
.person-card:active { transform: translateY(-1px) scale(0.99); }
.person-card > * { position: relative; z-index: 1; }
.person-card-header {
    display: flex; align-items: center; gap: 0.45rem;
    margin-bottom: 0.5rem;
}
.person-card-header .pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: #66bb6a; animation: pulse 2s infinite; flex-shrink: 0;
}
.person-card-name { font-size: 0.84rem; font-weight: 600; color: var(--text-main); letter-spacing: 0.01em; }
.person-card-city {
    font-size: 0.62rem; color: var(--text-light); margin-left: auto;
    padding: 0.12rem 0.5rem; border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500;
}
.person-card-weather { font-size: 1.05rem; font-weight: 600; margin: 0.1rem 0 0.05rem; color: var(--text-main); }
.person-card-feels { font-size: 0.68rem; color: var(--text-light); margin-bottom: 0.15rem; min-height: 0.9em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-card-time { font-size: 0.72rem; color: var(--text-light); letter-spacing: 0.02em; }
.person-card-status {
    font-size: 0.76rem; color: var(--text-light);
    margin-top: 0.35rem; opacity: 0.92;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dashboard-summary {
    text-align: center; font-size: 0.82rem; color: #aaa;
    margin-top: 0.8rem;
    min-height: 1.5rem;   /* 预留一行高度：纪念日填进来时不再把下方内容顶一下（无 CLS） */
}
.dashboard-summary .days-count { color: var(--accent-pink); font-weight: 600; }
.dashboard-summary .today-activity { margin-left: 0.5rem; }
.dashboard-summary .today-activity span { margin: 0 0.15rem; }
@media (max-width: 600px) {
    .dashboard-cards { grid-template-columns: 1fr; max-width: 300px; gap: 0.6rem; }
    .dashboard-cards::after { font-size: 1.2rem; }
    .perspective-card { max-width: 320px; width: auto; }
}

/* ── Pulse variants ── */
.pulse.sleeping { background: #bdbdbd; animation: none; }
.pulse.busy     { background: #ff7043; animation: pulse-orange 2s infinite; }
.pulse.fun      { background: #ab47bc; animation: pulse-purple 2s infinite; }
.pulse.chill    { background: #42a5f5; animation: pulse-blue 2s infinite; }

/* ── Today in Our History ── */
.history-cards {
    display: flex; gap: 1rem; overflow-x: auto;
    padding: 0.5rem 0 1rem; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.history-cards::-webkit-scrollbar { display: none; }
.history-card {
    --glass-rgb: 255, 183, 178;
    --glass-rgb-2: 255, 250, 249;
    --glass-line: rgba(236,228,220,0.72);
    flex: 0 0 220px; scroll-snap-align: start;
    background:
        radial-gradient(circle at 92% 88%, rgba(var(--glass-rgb), 0.09), transparent 42%),
        radial-gradient(circle at 12% 0%, rgba(var(--glass-rgb-2), 0.06), transparent 38%),
        var(--liquid-bg);
    border-radius: 18px;
    box-shadow: var(--liquid-shadow);
    backdrop-filter: var(--liquid-filter);
    -webkit-backdrop-filter: var(--liquid-filter);
    overflow: hidden; cursor: pointer;
    transition: transform 0.3s var(--ease-soft), box-shadow 0.3s;
}
.history-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--liquid-shadow-hover);
}
.history-card.grad-1 { --glass-rgb: 253, 160, 133; --glass-rgb-2: 246, 211, 101; --glass-line: rgba(253, 160, 133, 0.34); }
.history-card.grad-2 { --glass-rgb: 143, 211, 244; --glass-rgb-2: 132, 250, 176; --glass-line: rgba(132, 220, 190, 0.34); }
.history-card.grad-3 { --glass-rgb: 161, 196, 253; --glass-rgb-2: 194, 233, 251; --glass-line: rgba(161, 196, 253, 0.32); }
.history-card.grad-4 { --glass-rgb: 166, 193, 238; --glass-rgb-2: 251, 194, 235; --glass-line: rgba(221, 160, 221, 0.32); }
.history-card.grad-5 { --glass-rgb: 252, 182, 159; --glass-rgb-2: 255, 236, 210; --glass-line: rgba(252, 182, 159, 0.34); }
.history-card.grad-6 { --glass-rgb: 161, 140, 209; --glass-rgb-2: 251, 194, 235; --glass-line: rgba(161, 140, 209, 0.30); }
.history-card.glass-theme-1 { --glass-rgb: 255, 183, 178; --glass-rgb-2: 255, 234, 167; --glass-line: rgba(255, 183, 178, 0.34); }
.history-card.glass-theme-2 { --glass-rgb: 168, 230, 207; --glass-rgb-2: 194, 233, 251; --glass-line: rgba(168, 230, 207, 0.32); }
.history-card.glass-theme-3 { --glass-rgb: 214, 234, 248; --glass-rgb-2: 166, 193, 238; --glass-line: rgba(166, 193, 238, 0.30); }
.history-card.glass-theme-4 { --glass-rgb: 255, 224, 178; --glass-rgb-2: 252, 182, 159; --glass-line: rgba(255, 198, 145, 0.32); }
.history-card.glass-theme-5 { --glass-rgb: 221, 160, 221; --glass-rgb-2: 251, 194, 235; --glass-line: rgba(221, 160, 221, 0.28); }
.history-card.glass-theme-6 { --glass-rgb: 196, 244, 210; --glass-rgb-2: 255, 238, 185; --glass-line: rgba(175, 220, 165, 0.28); }
.history-card-img {
    height: 100px; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; border-radius: 12px 12px 0 0;
}
.history-card-body { padding: 0.7rem 0.9rem; }
.history-card-body h4 { font-size: 0.82rem; margin-bottom: 0.2rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-card-body p { font-size: 0.72rem; color: var(--text-light); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.history-card-date { font-size: 0.68rem; color: #bbb; margin-top: 0.3rem; }

/* ── Reaction bar ── */
.reaction-bar {
    display: flex; gap: 0.4rem; flex-wrap: wrap;
    margin-top: 0.8rem; padding-top: 0.6rem;
    border-top: 1px dashed #f0f0f0;
}
.reaction-btn {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.25rem 0.6rem; border-radius: 20px;
    border: 1.5px solid #f0f0f0; background: transparent;
    font-size: 0.75rem; cursor: pointer;
    transition: all 0.2s var(--ease-soft);
    font-family: inherit; color: var(--text-light);
}
.reaction-btn:hover { border-color: var(--accent-pink); background: #fff5f5; }
.reaction-btn.active { border-color: var(--accent-pink); background: #ffe0e0; color: var(--text-main); }
.reaction-btn .reaction-count { font-size: 0.68rem; min-width: 0.8em; text-align: center; }

/* ── Perspective card (frosted, opens from a person card) ── */
.perspective-card {
    margin: 1rem auto 0;
    display: block;
    width: fit-content;
    max-width: 420px;
    padding: 1.1rem 1.4rem 1.2rem;
    text-align: left;
    border-radius: 22px;
    border: none;
    box-shadow: var(--liquid-shadow);
    backdrop-filter: var(--liquid-filter-soft);
    -webkit-backdrop-filter: var(--liquid-filter-soft);
    animation: slideDown 0.45s var(--spring);
}
/* Tinted by whoever we're looking at */
.perspective-card.pv-of-bling { background: linear-gradient(135deg, rgba(255, 183, 178, 0.13), rgba(255, 183, 178, 0) 60%), var(--liquid-bg); }
.perspective-card.pv-of-jim   { background: linear-gradient(135deg, rgba(168, 230, 207, 0.14), rgba(168, 230, 207, 0) 60%), var(--liquid-bg); }
.pv-header { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.7rem; }
.pv-avatar { font-size: 1.6rem; line-height: 1; }
.pv-head-text { min-width: 0; flex: 1; }
.pv-name { font-size: 0.9rem; font-weight: 600; color: var(--text-main); }
.pv-time { font-size: 0.74rem; color: var(--text-light); margin-top: 0.1rem; }
.pv-temp { font-size: 1.15rem; font-weight: 600; color: var(--text-main); white-space: nowrap; }
.pv-weather {
    font-size: 0.82rem; color: var(--text-main); line-height: 1.55;
    padding: 0.5rem 0.8rem; margin-bottom: 0.6rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
}
/* Literary quote + attribution */
.pv-quote {
    margin: 0 0 0.3rem;
    padding: 0 0.8rem;   /* match .pv-weather text inset so quote ↔ care line left edges align */
    font-size: 0.88rem; line-height: 1.7; color: var(--text-main);
    font-weight: 500; letter-spacing: 0.01em;
}
.pv-cite {
    font-size: 0.7rem; color: var(--text-light);
    text-align: right; margin-bottom: 0.8rem; opacity: 0.85;
    padding: 0 0.8rem;   /* align attribution right edge with the card's text column */
}
.pv-detail {
    display: block; text-align: center;
    font-size: 0.74rem; text-decoration: none;
    padding: 0.4rem; border-radius: 999px;
    background: rgba(255, 255, 255, 0.4);
    transition: background 0.25s var(--ease-soft), color 0.25s var(--ease-soft), transform 0.25s var(--spring), border-color 0.25s var(--ease-soft);
}
/* Button color follows the city it points to */
.pv-of-bling .pv-detail { color: var(--accent-pink); border: 1.5px solid rgba(255, 183, 178, 0.55); }
.pv-of-bling .pv-detail:hover { transform: translateY(-1px); background: var(--accent-pink); color: #fff; border-color: var(--accent-pink); }
.pv-of-jim .pv-detail { color: #52c7a0; border: 1.5px solid rgba(168, 230, 207, 0.7); }
.pv-of-jim .pv-detail:hover { transform: translateY(-1px); background: var(--accent-blue); color: var(--text-main); border-color: var(--accent-blue); }

/* ── Couple motif (replaces "装修施工中") ── */
.couple-motif {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    margin-top: 1.6rem; font-size: 1.5rem;
}
.couple-motif .cm-bear  { animation: cmBob 3s var(--ease-soft) infinite; }
.couple-motif .cm-bunny { animation: cmBob 3s var(--ease-soft) infinite 1.5s; }
.couple-motif .cm-link { display: inline-flex; align-items: center; gap: 0.35rem; }
.couple-motif .cm-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-purple); opacity: 0.5; }
.couple-motif .cm-heart { color: var(--accent-pink); font-size: 1rem; animation: cmBeat 1.8s ease-in-out infinite; }
@keyframes cmBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes cmBeat { 0%, 100% { transform: scale(1); opacity: 0.85; } 50% { transform: scale(1.25); opacity: 1; } }
.couple-caption {
    margin-top: 0.6rem; font-size: 0.85rem; color: #b9b0ad;
    text-align: center; transition: opacity 0.4s var(--ease-soft);
}
@media (prefers-reduced-motion: reduce) {
    .couple-motif .cm-bear, .couple-motif .cm-bunny, .couple-motif .cm-heart { animation: none; }
}

/* ── Post detail modal —— 和后台 edit-modal 同一块玻璃（admin.css .edit-modal 配方）── */
.post-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(96, 74, 64, 0.18);
    backdrop-filter: blur(14px) saturate(1.12);
    -webkit-backdrop-filter: blur(14px) saturate(1.12);
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.post-modal.active { display: flex; }
.post-modal-card {
    background:
        radial-gradient(circle at 10% 0%, rgba(255,183,178,0.16), transparent 38%),
        radial-gradient(circle at 92% 4%, rgba(168,230,207,0.14), transparent 42%),
        linear-gradient(145deg, rgba(255,255,255,0.66), rgba(255,248,246,0.42) 50%, rgba(246,255,251,0.48)),
        rgba(255, 252, 248, 0.78);
    backdrop-filter: blur(30px) saturate(1.32);
    -webkit-backdrop-filter: blur(30px) saturate(1.32);
    border-radius: 24px;
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    max-height: 85dvh;
    overflow: hidden;
    box-shadow:
        0 18px 46px rgba(70, 55, 55, 0.14),
        inset 0 1px 1px rgba(255,255,255,0.82);
    animation: slideDown 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
}
/* 滚动层做成「三段式」：上下留出玻璃边，滚动条悬浮在中段，不顶到圆角
 *（仿 admin edit-modal：标题/按钮是实体段，滚动条只跑中间）*/
.post-modal-scroll {
    overflow-y: auto;
    flex: 1;
    margin: 0.9rem 4px 0.9rem 0;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(180, 170, 170, 0.42) transparent;
}
.post-modal-scroll::-webkit-scrollbar { width: 7px; }
.post-modal-scroll::-webkit-scrollbar-track { background: transparent; }
.post-modal-scroll::-webkit-scrollbar-thumb {
    background: rgba(180, 170, 170, 0.34);
    border: 2px solid rgba(255, 252, 248, 0.9);
    border-radius: 999px;
}
.post-modal-scroll::-webkit-scrollbar-thumb:hover { background: rgba(255, 183, 178, 0.72); }
.post-modal-header {
    padding: 1.2rem 2rem 0;   /* 顶部总留白 = 0.9rem 滚动层边距 + 这里，和原 2rem 持平 */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
/* × = iOS sheet 风格的烟灰小圆钮：嵌进玻璃而不是浮在上面的白饼，
 * 视觉 34px 但 ::before 撑出 48px 触控热区；hover 染粉 + 轻转 90° */
.post-modal-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 3;
    background: rgba(82, 68, 62, 0.07);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    color: rgba(82, 68, 62, 0.58);
    flex-shrink: 0;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.38);
    transition: background 0.2s, color 0.2s, transform 0.28s var(--spring);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}
.post-modal-close::before {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
}
.post-modal-close:hover,
.post-modal-close:active {
    background: rgba(255, 183, 178, 0.30);
    color: #b95f57;
    transform: rotate(90deg);
}
.post-modal-emoji { font-size: 3rem; margin-bottom: 1rem; }
.post-modal-body { padding: 1rem 2rem 1.2rem; }   /* 底部总留白 = 1.2 + 0.9rem 滚动层边距 */
.post-modal-body .pm-tag {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: 15px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 0.8rem;
}
.post-modal-body .pm-tag.pink   { background: #ffe0e0; color: #e74c3c; }
.post-modal-body .pm-tag.green  { background: #d4edda; color: #27ae60; }
.post-modal-body .pm-tag.blue   { background: #d6eaf8; color: #2980b9; }
.post-modal-body .pm-tag.purple { background: #e8daef; color: #8e44ad; }
.post-modal-body h2 { font-size: 1.4rem; margin-bottom: 1rem; line-height: 1.4; }
.post-modal-body .pm-content {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.8;
    white-space: pre-line;
}
.post-modal-body .pm-author {
    text-align: right;
    font-style: italic;
    color: #d0c4bb;
    font-size: 0.82rem;
    margin-top: 1rem;
}
.post-modal-body .pm-meta {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    font-size: 0.82rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem 0.5rem;
}
@media (max-width: 600px) {
    .post-modal { padding: 1rem; backdrop-filter: blur(8px) saturate(1.08); -webkit-backdrop-filter: blur(8px) saturate(1.08); }
    .post-modal-card { border-radius: 18px; backdrop-filter: blur(18px) saturate(1.26); -webkit-backdrop-filter: blur(18px) saturate(1.26); }
    .post-modal-header { padding: 1rem 1.5rem 0; }
    .post-modal-body { padding: 0.8rem 1.5rem 0.9rem; }
    /* 触控目标加高（原 ~26px 太小），iOS 聚焦不放大整页 */
    .reaction-btn { padding: 0.45rem 0.8rem; min-height: 38px; }
    .comment-form textarea { font-size: 16px; }
}
