/* ===================================
 * 宠物小屋 + 玩具系统样式
 * =================================== */
.pet-house-modal .pet-house-container {
    width: 960px;
    max-width: 95vw;
    height: 88vh;
    max-height: 90vh;
    background: #FDF6EC;
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.pet-house-header {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background: linear-gradient(135deg, #E85D3A, #F08A5D);
    color: #fff;
    gap: 12px;
    flex-shrink: 0;
}
.pet-house-header-left { display:flex; align-items:center; gap:8px; flex:1; }
.ph-student-icon { font-size:22px; background:rgba(255,255,255,0.2); border-radius:50%; width:36px; height:36px; display:flex; align-items:center; justify-content:center; }
.ph-student-name { font-size:16px; font-weight:700; }
.pet-house-header-right { display:flex; align-items:center; gap:6px; }
.ph-resource { font-size:14px; background:rgba(255,255,255,0.25); padding:4px 12px; border-radius:14px; font-weight:600; }
.pet-house-close { background:rgba(255,255,255,0.3); border:none; color:#fff; font-size:18px; width:32px; height:32px; border-radius:50%; cursor:pointer; transition:background 0.2s; display:flex; align-items:center; justify-content:center; }
.pet-house-close:hover { background:rgba(255,255,255,0.5); }

/* 三栏主体 */
.pet-house-body { display:flex; flex:1; overflow:hidden; }

/* ===== 左侧好友栏 ===== */
.ph-sidebar { width:180px; min-width:180px; background:#FFF8F0; border-right:1px solid #F0DFC8; display:flex; flex-direction:column; overflow:hidden; flex-shrink:0; }
.ph-sidebar-title { padding:12px 14px 8px; font-size:13px; font-weight:700; color:#8B6914; border-bottom:1px dashed #E8D5B0; }
.ph-friend-list { flex:1; overflow-y:auto; padding:4px 0; }
.ph-friend-item { display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer; transition:background 0.2s; border-bottom:1px solid #F5E8D5; }
.ph-friend-item:hover { background:#FFF0DF; }
.ph-friend-item.active { background:#FFE8D0; border-left:3px solid #E85D3A; padding-left:11px; }
.ph-friend-avatar { width:38px; height:38px; border-radius:50%; background:#FFE0CC; display:flex; align-items:center; justify-content:center; font-size:20px; border:2px solid #F5C8A0; flex-shrink:0; }
.ph-friend-info { flex:1; min-width:0; }
.ph-friend-info .name { font-size:13px; font-weight:700; color:#5D3A1A; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ph-friend-info .pet { font-size:11px; color:#A0784C; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ph-friend-info .lv { font-size:10px; color:#C09060; }

/* ===== 中间场景区 ===== */
.ph-scene-wrapper { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; position:relative; background:radial-gradient(ellipse at center,#F5E6D0 0%,#E8D5B8 60%,#D4C0A0 100%); overflow:hidden; }
.ph-scene { width:100%; flex:1; display:flex; align-items:center; justify-content:center; position:relative; }
.ph-scene .pet-house-scene-bg { width:100%; height:100%; object-fit:cover; border-radius:0; }
.pet-house-pet-img {
    position: absolute; bottom: 10%; left: 50%; transform: translateX(-50%);
    max-width: 160px; max-height: 200px; z-index: 5;
    filter: drop-shadow(0 0 18px rgba(180, 150, 255, 0.4));
}
.ph-scene .pet-house-pet-img { position:absolute; bottom:22%; left:50%; transform:translateX(-50%); width:auto; height:auto; max-width:180px; max-height:220px; z-index:2; }
.pet-house-empty { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; color:rgba(0,0,0,0.3); font-size:20px; z-index:0; }
.pet-house-empty p { margin:0; }

/* 引导气泡 */
.ph-guide-bubble { position:absolute; right:8%; top:25%; background:#fff; border-radius:16px; padding:14px 18px; font-size:13px; color:#5D3A1A; box-shadow:0 4px 16px rgba(0,0,0,0.12); max-width:220px; z-index:10; display:flex; align-items:center; gap:10px; animation:ph-bounce 2s ease-in-out infinite; }
.ph-guide-bubble::after { content:''; position:absolute; right:-8px; top:50%; transform:translateY(-50%); width:0; height:0; border-top:8px solid transparent; border-bottom:8px solid transparent; border-left:8px solid #fff; }
.ph-guide-text { line-height:1.6; }
.ph-guide-arrow { font-size:20px; color:#E85D3A; flex-shrink:0; }
@keyframes ph-bounce { 0%,100% { transform:translateX(0); } 50% { transform:translateX(-6px); } }

/* 玩具槽位 */
.ph-toy-slots { display:flex; gap:14px; padding:10px 0; justify-content:center; }
.ph-toy-slots .pet-house-toy-slot { width:68px; height:68px; border-radius:14px; border:2px dashed #D4C0A0; background:rgba(255,255,255,0.35); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:all 0.2s; position:relative; }
.ph-toy-slots .pet-house-toy-slot:hover { background:rgba(255,255,255,0.55); border-color:#E85D3A; }
.ph-toy-slots .pet-house-toy-slot img { width:48px; height:48px; object-fit:contain; }
.ph-toy-slots .pet-house-toy-slot .toy-cooldown { position:absolute; bottom:2px; font-size:10px; color:#E85D3A; background:rgba(0,0,0,0.5); padding:1px 5px; border-radius:6px; }
.ph-toy-slots .pet-house-toy-slot .toy-name { font-size:9px; color:#5D3A1A; position:absolute; bottom:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:60px; }

/* 底部进度条 */
.ph-pet-bar { display:flex; align-items:center; gap:10px; padding:8px 20px 12px; width:70%; max-width:500px; }
.ph-pet-bar-name { font-size:12px; font-weight:700; color:#5D3A1A; white-space:nowrap; }
.ph-pet-bar-track { flex:1; height:8px; background:rgba(255,255,255,0.5); border-radius:4px; overflow:hidden; }
.ph-pet-bar-fill { height:100%; background:linear-gradient(90deg,#E85D3A,#F08A5D); border-radius:4px; transition:width 0.5s; }
.ph-pet-bar-pct { font-size:11px; color:#A0784C; font-weight:600; min-width:32px; text-align:right; }

/* ===== 右侧操作面板 ===== */
.ph-right-panel { width:240px; min-width:240px; background:#FFF; border-left:1px solid #F0DFC8; display:flex; flex-direction:column; overflow:hidden; flex-shrink:0; }
.ph-right-title { padding:14px 16px 0; font-size:14px; font-weight:700; color:#5D3A1A; }
.ph-action-btns { display:flex; gap:8px; padding:10px 16px; }
.ph-btn-primary,.ph-btn-outline { flex:1; padding:8px 0; border-radius:10px; font-size:13px; font-weight:700; cursor:pointer; border:none; transition:all 0.2s; }
.ph-btn-primary { background:#E85D3A; color:#fff; }
.ph-btn-primary:hover { background:#D44A28; }
.ph-btn-primary.active { background:#E85D3A; box-shadow:0 2px 8px rgba(232,93,58,0.4); }
.ph-btn-outline { background:#FFF; color:#E85D3A; border:2px solid #E85D3A; }
.ph-btn-outline:hover { background:#FFF0EB; }
.ph-btn-outline.active { background:#FFF0EB; box-shadow:0 2px 8px rgba(232,93,58,0.25); }
.ph-panel { flex:1; overflow-y:auto; padding:0 16px 16px; }

/* 主题网格 */
.ph-section-title { font-size:12px; font-weight:700; color:#A0784C; margin:12px 0 8px; padding-bottom:4px; border-bottom:1px dashed #F0DFC8; }
.ph-theme-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.ph-theme-item { cursor:pointer; border-radius:12px; overflow:hidden; border:3px solid transparent; transition:all 0.2s; position:relative; aspect-ratio:4/3; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.ph-theme-item:hover { transform:scale(1.05); border-color:#E85D3A; }
.ph-theme-item.owned { border-color:#FFD700; }
.ph-theme-item.active { border-color:#E85D3A; box-shadow:0 0 0 3px rgba(232,93,58,0.3); }
.ph-theme-item img { width:100%; height:100%; object-fit:cover; position:absolute; top:0; left:0; border-radius:9px; }
.ph-theme-item .ph-theme-label { position:relative; z-index:1; background:rgba(0,0,0,0.55); color:#fff; font-size:10px; padding:3px 8px; text-align:center; font-weight:600; border-radius:6px; }
.ph-tier-badge { position:absolute; bottom:4px; right:4px; z-index:2; font-size:9px; padding:2px 6px; border-radius:8px; color:white; font-weight:600; }
.ph-tier-badge.current { background:#E85D3A; }
.ph-tier-badge.owned { background:rgba(100,200,100,0.8); }
.ph-tier-badge.affordable { background:rgba(255,200,50,0.8); color:#333; }
.ph-tier-badge.locked { background:rgba(0,0,0,0.6); color:rgba(255,255,255,0.4); }

/* 背包网格 */
.ph-backpack-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
.ph-backpack-toy { cursor:pointer; border-radius:10px; border:2px solid #F0DFC8; background:#FFFAF2; aspect-ratio:1; display:flex; flex-direction:column; align-items:center; justify-content:center; transition:all 0.2s; position:relative; padding:4px; }
.ph-backpack-toy:hover { border-color:#E85D3A; transform:scale(1.05); }
.ph-backpack-toy.placed { border-color:#FFD700; background:#FFFDE6; }
.ph-backpack-toy img { width:40px; height:40px; object-fit:contain; }
.ph-backpack-toy .ph-toy-name { font-size:10px; color:#5D3A1A; text-align:center; line-height:1.2; }
.ph-backpack-toy .ph-toy-count { position:absolute; top:2px; right:4px; font-size:10px; background:#E85D3A; color:#fff; border-radius:50%; width:18px; height:18px; display:flex; align-items:center; justify-content:center; font-weight:700; }

/* 玩具商店 */
.ph-shop-inner { padding-top:4px; }
.ph-shop-inner .toy-shop-item { display:flex; align-items:center; gap:10px; padding:10px; background:#FFFAF2; border-radius:12px; margin-bottom:8px; border:1px solid #F0DFC8; cursor:pointer; transition:all 0.2s; }
.ph-shop-inner .toy-shop-item:hover { border-color:#E85D3A; background:#FFF0EB; }
.ph-shop-inner .toy-shop-item img { width:48px; height:48px; object-fit:contain; border-radius:8px; flex-shrink:0; }
.ph-shop-inner .toy-shop-info { flex:1; min-width:0; }
.ph-shop-inner .toy-shop-info .name { font-size:13px; font-weight:700; color:#5D3A1A; }
.ph-shop-inner .toy-shop-info .desc { font-size:11px; color:#A0784C; margin:2px 0; }
.ph-shop-inner .toy-shop-info .effect { font-size:10px; color:#E85D3A; }
.ph-shop-inner .toy-shop-info .owned-tag { font-size:10px; color:#FFD700; }
.ph-shop-inner .toy-shop-buy { background:#E85D3A; color:#fff; border:none; border-radius:8px; padding:6px 12px; font-size:12px; font-weight:700; cursor:pointer; white-space:nowrap; }
.ph-shop-inner .toy-shop-buy:hover { background:#D44A28; }
.ph-shop-inner .toy-shop-buy:disabled { background:#CCC; cursor:not-allowed; }

/* 购买确认弹窗 */
.ph-purchase-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.6); display:none; align-items:center; justify-content:center; z-index:10001; }
.ph-purchase-card { background:linear-gradient(145deg,#2D1B0E,#4A2C1A); border:2px solid rgba(255,200,100,0.3); border-radius:20px; padding:24px 20px 18px; max-width:340px; width:90%; text-align:center; box-shadow:0 12px 40px rgba(0,0,0,0.6); color:#fff; }
.ph-purchase-title { font-size:18px; font-weight:800; color:#FFC857; margin-bottom:12px; }
.ph-purchase-img { width:100%; border-radius:12px; margin-bottom:8px; object-fit:cover; }
.ph-purchase-name { font-size:18px; font-weight:800; margin-bottom:4px; }
.ph-purchase-desc { font-size:12px; color:rgba(255,255,255,0.5); margin-bottom:10px; }
.ph-purchase-stats { display:flex; gap:12px; justify-content:center; margin-bottom:12px; font-size:12px; color:#7EC8E3; background:rgba(126,200,227,0.08); padding:6px 12px; border-radius:10px; }
.ph-purchase-cost-row { display:flex; align-items:center; justify-content:center; gap:8px; margin-bottom:8px; font-size:16px; }
.ph-cost-label { color:rgba(255,255,255,0.5); }
.ph-cost-value { color:#FFC857; font-weight:800; font-size:22px; }
.ph-cost-balance { color:rgba(255,255,255,0.3); font-size:12px; }
.ph-purchase-note { font-size:11px; color:rgba(255,100,100,0.6); margin-bottom:14px; }
.ph-purchase-btns { display:flex; gap:10px; }
.ph-btn-cancel { flex:1; padding:10px 0; border-radius:10px; font-size:14px; cursor:pointer; border:none; background:rgba(255,255,255,0.08); color:rgba(255,255,255,0.55); transition:0.2s; }
.ph-btn-cancel:hover { background:rgba(255,255,255,0.15); }
.ph-btn-confirm { flex:1; padding:10px 0; border-radius:10px; font-size:14px; font-weight:600; cursor:pointer; border:none; background:linear-gradient(135deg,#FFC857,#FF8C00); color:#1A1A2E; box-shadow:0 4px 16px rgba(255,140,0,0.3); }
.ph-btn-confirm:hover { transform:scale(1.03); }

/* 宠物emoji占位 */
.pet-house-pet-emoji {
    position: absolute; bottom: 14%; left: 50%; transform: translateX(-50%);
    font-size: 70px; z-index: 5;
    filter: drop-shadow(0 0 16px rgba(180, 150, 255, 0.5));
    animation: petFloatAnim 3s ease-in-out infinite;
}
@keyframes petFloatAnim {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* 响应式 */
@media (max-width:900px) {
    .pet-house-container { max-height:95vh; }
    .ph-sidebar { width:140px; min-width:140px; }
    .ph-right-panel { width:200px; min-width:200px; }
    .ph-theme-grid { grid-template-columns:repeat(2,1fr); }
}