/* ===== 梦想小屋 Dream House v10 ===== */
/* 背景图浏览 + 心动值解锁 + 左右滑动切换场景；家具/商城/仓库已移除 */

#dreamHousePage {
    position: fixed;
    inset: 0;
    display: none;
    flex-direction: column;
    background: #fffafc;
    z-index: 60;
}

/* ===== 头部栏 ===== */
.dh-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #fff;
    border-bottom: 1px solid #f3d9e3;
}
.dh-back {
    width: 36px; height: 36px; border: none; background: transparent;
    display: flex; align-items: center; justify-content: center;
    color: #c2185b; cursor: pointer; border-radius: 50%;
}
.dh-back:active { background: #fbeaf0; }
.dh-title {
    flex: 1; margin: 0; font-size: 17px; font-weight: 600; color: #b03060; text-align: center;
}
.dh-days {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px;
    font-size: 12px; color: #ad1457;
    background: #fce4ec; padding: 4px 10px; border-radius: 12px;
}
.dh-days-heart {
    color: #FF3B30; width: 13px; height: 13px; flex: 0 0 auto;
}

/* ===== 横向轮播舞台 ===== */
.dh-stage {
    flex: 1 1 auto;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.dh-stage::-webkit-scrollbar { display: none; }
.dh-slide {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    opacity: 1;
    transform: none;
    transition: none;
}
.dh-bg {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

/* ===== 场景圆点指示器 ===== */
.dh-dots {
    position: absolute;
    left: 50%;
    bottom: calc(14px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
    padding: 6px 12px;
    background: rgba(40,30,38,0.32);
    border-radius: 16px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}
.dh-dot {
    width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%;
    background: rgba(255,255,255,0.55); cursor: pointer; transition: all .2s;
}
.dh-dot.active { background: #fff; width: 20px; border-radius: 4px; }
.dh-dot:active { transform: scale(0.9); }

/* ===== 锁定遮罩 ===== */
.dh-lock {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    background: rgba(255,250,252,0.86);
}
.dh-lock-inner { text-align: center; color: #b06a85; }
.dh-lock-inner svg { width: 40px; height: 40px; color: #d49ab4; margin-bottom: 8px; }
.dh-lock-text { margin: 0; font-size: 14px; color: #9a6f82; padding: 0 24px; }

/* ===== 未开通小屋友好提示 ===== */
.dh-disabled-tip {
    display: none; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; height: 70vh; text-align: center; padding: 0 32px;
}
.dh-disabled-tip svg { width: 48px; height: 48px; color: #d49ab4; }
.dh-disabled-tip p { margin: 0; font-size: 15px; color: #9a6f82; line-height: 1.6; }

/* ===== 选好友浮层 ===== */
#dhFriendPicker { display: none; }
#dhFriendPicker.show { display: flex; }
.dh-picker-card {
    width: min(420px,92vw); max-width: 420px; max-height: 76vh;
    display: flex; flex-direction: column; padding: 0; overflow: hidden;
}
.dh-picker-header {
    display: flex; align-items: center; justify-content: space-between; padding: 16px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.dh-picker-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: #2b2530; }
.dh-picker-close {
    border: none; background: transparent; cursor: pointer; width: 30px; height: 30px;
    border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #9a8f9f;
}
.dh-picker-close:hover { background: rgba(0,0,0,0.05); color: #5a4f60; }
.dh-picker-close svg { width: 18px; height: 18px; }
.dh-picker-list { overflow-y: auto; padding: 8px; -webkit-overflow-scrolling: touch; }
.dh-picker-item {
    width: 100%; display: flex; align-items: center; gap: 12px;
    padding: 11px 12px; border: none; background: transparent; border-radius: 12px;
    cursor: pointer; text-align: left; color: #2b2530;
}
.dh-picker-item:hover { background: rgba(255,122,168,0.08); }
.dh-picker-item:active { background: rgba(255,122,168,0.16); }
.dh-picker-avatar {
    width: 42px; height: 42px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    background: linear-gradient(135deg,#ffd3e2,#d6c2f0);
}
.dh-picker-avatar--txt {
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 600; font-size: 17px;
}
.dh-picker-name { flex: 1; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dh-picker-chevron { width: 18px; height: 18px; color: #c4b8cb; flex-shrink: 0; }
.dh-picker-loading, .dh-picker-empty { padding: 28px 16px; text-align: center; color: #9a8f9f; font-size: 14px; }

/* ===== 深色模式 ===== */
body.dark #dreamHousePage,
[data-theme="dark"] #dreamHousePage { background: #1d1722; }
body.dark .dh-header,
[data-theme="dark"] .dh-header { background: #251d2b; border-bottom-color: #3a2f42; }
body.dark .dh-title,
[data-theme="dark"] .dh-title { color: #ffb3cd; }
body.dark .dh-days,
[data-theme="dark"] .dh-days { background: #3a2030; color: #ff9bc0; }
body.dark .dh-lock,
[data-theme="dark"] .dh-lock { background: rgba(29,23,34,0.86); }
body.dark .dh-lock-text,
[data-theme="dark"] .dh-lock-text { color: #c89ab0; }
body.dark .dh-disabled-tip svg,
[data-theme="dark"] .dh-disabled-tip svg { color: #c89ab0; }
body.dark .dh-disabled-tip p,
[data-theme="dark"] .dh-disabled-tip p { color: #c89ab0; }

/* 深色：选好友浮层 */
body.dark #dhFriendPicker .modal-card,
[data-theme="dark"] #dhFriendPicker .modal-card { background: #251d2b; }
body.dark .dh-picker-header,
[data-theme="dark"] .dh-picker-header { border-bottom-color: #3a2f42; }
body.dark .dh-picker-header h3,
[data-theme="dark"] .dh-picker-header h3 { color: #ffb3cd; }
body.dark .dh-picker-close,
[data-theme="dark"] .dh-picker-close { color: #9a8aa8; }
body.dark .dh-picker-close:hover,
[data-theme="dark"] .dh-picker-close:hover { background: rgba(255,255,255,0.06); color: #d6a9bd; }
body.dark .dh-picker-item,
[data-theme="dark"] .dh-picker-item { color: #ecd9e6; }
body.dark .dh-picker-item:hover,
[data-theme="dark"] .dh-picker-item:hover { background: rgba(255,122,168,0.12); }
body.dark .dh-picker-name,
[data-theme="dark"] .dh-picker-name { color: #ecd9e6; }

/* ===== 客厅小猫热区 + 彩蛋气泡 ===== */
.dh-egg-hotspot {
    position: absolute;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 6;
}
.dh-egg-hotspot:focus-visible {
    outline: 2px solid #4A90D9;
    outline-offset: 2px;
    border-radius: 10px;
}
.dh-egg-bubble {
    position: absolute;
    bottom: 120%;
    left: calc(50% + var(--bubble-shift, 0px));
    transform: translateX(-50%);
    min-width: 200px;
    max-width: 300px;
    box-sizing: border-box;
    background: linear-gradient(180deg, #fffdf5 0%, #fff6e0 100%);
    color: #4a3b2a;
    border: 1px solid #ecd9a8;
    border-radius: 16px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.55;
    text-align: center;
    box-shadow: 0 8px 24px rgba(120,90,40,0.22), 0 2px 6px rgba(120,90,40,0.12);
    z-index: 12;
    animation: dh-bubble-pop .22s ease-out;
    pointer-events: none;
}
.dh-egg-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: calc(50% + var(--arrow-shift, 0px));
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #fff6e0;
    filter: drop-shadow(0 2px 1px rgba(120,90,40,0.10));
}
@keyframes dh-bubble-pop {
    from { opacity: 0; transform: translateX(-50%) translateY(6px) scale(.96); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
/* 深色模式：气泡保持暖黄奶油色，仅微调阴影 */
body.dark .dh-egg-bubble,
[data-theme="dark"] .dh-egg-bubble {
    background: linear-gradient(180deg, #423a26 0%, #36301f 100%);
    color: #f6e9c8;
    border-color: #5a4d30;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 2px 6px rgba(0,0,0,0.3);
}
body.dark .dh-egg-bubble::after,
[data-theme="dark"] .dh-egg-bubble::after { border-top-color: #36301f; }
body.dark .dh-picker-loading, body.dark .dh-picker-empty,
[data-theme="dark"] .dh-picker-loading, [data-theme="dark"] .dh-picker-empty { color: #9a8aa8; }

/* ===== 图片+对话弹层 ===== */
.dh-image-dialogue {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(45, 35, 30, 0.72);
    z-index: 40;
    animation: dh-dialogue-fade .22s ease-out;
}
@keyframes dh-dialogue-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.dh-image-dialogue-card {
    max-width: 520px;
    width: 100%;
    max-height: 86vh;
    overflow: auto;
    box-sizing: border-box;
    background: linear-gradient(180deg, #fffdf5 0%, #fff6e0 100%);
    border: 1px solid #ecd9a8;
    border-radius: 22px;
    padding: 18px;
    box-shadow: 0 20px 60px rgba(70, 50, 30, 0.35);
    text-align: center;
    animation: dh-card-pop .26s ease-out;
}
@keyframes dh-card-pop {
    from { opacity: 0; transform: translateY(14px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dh-image-dialogue-card img {
    display: block;
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 16px;
    background: #f5ecd6;
}
.dh-image-dialogue-caption {
    margin: 14px 0 4px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 14px;
    color: #5a4b32;
    font-size: 15px;
    line-height: 1.6;
    text-align: center;
}

/* 图片未配置占位：避免裂图，直接提示是数据问题 */
.dh-image-dialogue-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    margin: 4px 0 8px;
    padding: 20px;
    border: 2px dashed #d9cbb0;
    border-radius: 16px;
    color: #9a8a6a;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.4);
}

/* 深色：弹层 */
body.dark .dh-image-dialogue-card,
[data-theme="dark"] .dh-image-dialogue-card {
    background: linear-gradient(180deg, #2f2820 0%, #262018 100%);
    border-color: #5a4d30;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
body.dark .dh-image-dialogue-card img,
[data-theme="dark"] .dh-image-dialogue-card img { background: #1d1812; }
body.dark .dh-image-dialogue-caption,
[data-theme="dark"] .dh-image-dialogue-caption {
    background: rgba(255, 255, 255, 0.08);
    color: #f6e9c8;
}
body.dark .dh-image-dialogue-placeholder,
[data-theme="dark"] .dh-image-dialogue-placeholder {
    border-color: #5a4d30;
    color: #b9a988;
    background: rgba(255, 255, 255, 0.05);
}
