/* =========================
   1. 基础设置与背景
   ========================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #fdfbfb 0%, #ebedee 100%);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

.bg-shapes {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    overflow: hidden;
    transition: opacity 0.8s ease;
}

.bg-shapes.hide { opacity: 0; }

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.shape-1 {
    width: 400px; height: 400px;
    background: rgba(255, 182, 193, 0.6);
    top: -100px; left: -100px;
}

.shape-2 {
    width: 500px; height: 500px;
    background: rgba(173, 216, 230, 0.6);
    bottom: -150px; right: -100px;
}

.room-bg {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background-image: url('images/bg-room.png'); 
    background-size: cover;
    background-position: center;
    opacity: 0; 
    z-index: -2; 
    transition: opacity 1.2s ease-in-out;
    pointer-events: none;
}

.room-bg.show { opacity: 1; }

/* =========================
   2. 导航栏与多语言
   ========================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 50px;
    position: relative;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
}
.logo:hover { opacity: 0.8; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active { color: #ff7b9c; }

.lang-switch {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.5);
    padding: 5px 10px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}
.lang-switch button {
    background: transparent;
    border: none;
    cursor: pointer;
    font-weight: bold;
    color: #555;
    transition: color 0.3s;
}
.lang-switch button:hover { color: #ff7b9c; }

/* =========================
   3. 主体布局与卡片
   ========================= */
.hero-section {
    display: flex;
    justify-content: center;
    align-items: center;
    height: calc(100vh - 80px);
    padding: 0 10%;
    gap: 50px;
}

.glass-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
    max-width: 500px;
    z-index: 2;
    transition: all 0.4s ease;
}

.glass-card.hide-card {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50px);
}

.glass-card h1 { font-size: 2.5rem; color: #2c3e50; margin-bottom: 20px; }
.glass-card p { font-size: 1.2rem; color: #555; margin-bottom: 30px; min-height: 30px; }

#typewriter::after {
    content: '|';
    color: #ff7b9c;
    animation: blink 1s step-end infinite;
    font-weight: 300;
    margin-left: 2px;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.btn {
    padding: 12px 30px;
    font-size: 1rem;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 154, 158, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    display: inline-block;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(255, 154, 158, 0.6); }

/* =========================
   4. 猫咪样式与居中动画
   ========================= */
.cat-container {
    z-index: 10;
    transition: transform 0.1s ease-out;
}

.pixel-cat {
    width: 100%;
    max-width: 400px;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0px 15px 25px rgba(255, 154, 158, 0.4)); 
    animation: float 4s ease-in-out infinite;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* 居中状态（按红框大小等比缩放） */
.cat-container.center-cat {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: auto !important;
    height: auto !important;
    z-index: 50;
    pointer-events: none; 
    display: flex;
    justify-content: center;
    align-items: center;
}

.cat-container.center-cat .pixel-cat {
    width: auto !important;
    height: 55vh !important; 
    max-width: 80vw !important; 
    object-fit: contain !important; 
    transform: scale(1) !important; 
    animation: floatCenter 4s ease-in-out infinite !important; 
    pointer-events: auto; 
    filter: drop-shadow(0px 20px 40px rgba(255, 154, 158, 0.6));
}

@keyframes floatCenter {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

#sad-emoji {
    display: none;
    position: absolute;
    top: -20px; left: 50%;
    transform: translateX(-50%);
    font-size: 4rem;
    z-index: 60;
    pointer-events: none;
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.2));
}
@keyframes popDown {
    0% { opacity: 0; transform: translate(-50%, -20px) scale(0.5); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

.floating-text {
    position: fixed;
    font-size: 1.8rem;
    font-weight: bold;
    color: #ff7b9c;
    background: rgba(255, 255, 255, 0.8);
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    transform: translate(-50%, -50%);
}

/* =========================
   5. 鼠标 Emoji 尾迹
   ========================= */
.emoji-cat {
    position: absolute;
    pointer-events: none;
    z-index: 9999;
    font-size: 24px;
    animation: floatEmoji 0.8s ease-out forwards;
}
@keyframes floatEmoji {
    0% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.5) rotate(20deg); }
}

/* =========================
   6. 左下角折叠工具栏
   ========================= */
.toolbar {
    position: fixed;
    bottom: 30px; left: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-group {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px;
    border-radius: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.tool-options {
    display: flex;
    gap: 10px;
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.tool-group.active .tool-options {
    max-width: 300px;
    opacity: 1;
    margin-left: 15px;
    padding-right: 10px;
}

.tool-main-btn, .tool-options button {
    border: none;
    background: white;
    color: #333;
    font-weight: bold;
    cursor: pointer;
    border-radius: 20px;
    transition: all 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    white-space: nowrap;
}

.tool-main-btn { padding: 10px 18px; font-size: 1rem; }
.tool-options button { padding: 8px 12px; font-size: 1.2rem; }
.tool-options button:hover {
    background: #ff9a9e;
    color: white;
    transform: translateY(-3px);
}

/* =========================
   7. 响应式设计
   ========================= */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column-reverse;
        text-align: center;
        gap: 20px;
        padding: 0 5%;
    }
    .glass-card { padding: 30px 20px; }
    .glass-card h1 { font-size: 1.8rem; }
    .navbar { padding: 15px 20px; }
    .nav-links { display: none; }
    .lang-switch { margin-left: auto; }
}
/* =========================
   8. 拖拽喂食特效
   ========================= */

/* 掉落的食物 */
.dropped-food {
    position: absolute;
    width: 60px;
    height: 60px;
    cursor: grab;
    pointer-events: auto; 
    animation: fallDown 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* 抓取时放大 */
.dropped-food.dragging {
    cursor: grabbing;
    transform: scale(1.2);
    z-index: 10000;
    transition: transform 0.1s;
}

/* 吃掉消失动画 */
.dropped-food.eaten {
    animation: fadeAway 1s ease-in forwards;
    pointer-events: none;
}

/* 下落动画 */
@keyframes fallDown {
    0% { top: -100px; opacity: 0; }
    20% { opacity: 1; }
    100% { top: var(--target-y); opacity: 1; }
}

/* 消失动画 */
@keyframes fadeAway {
    0% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0); } /* 直接缩成 0 消失 */
}