/* 全局基础与配色 */
body {
    background-color: #f7f5f0;
    color: #4a3b32;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.login-card {
	background: white;
	padding: 40px;
	border-radius: 20px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.08);
	text-align: center;
	width: 100%;
	max-width: 360px;
}
.login-card h2 {
	color: #8c533e;
	margin-bottom: 10px;
}
.login-card p {
	color: #7a6e65;
	font-size: 14px;
	margin-bottom: 30px;
}
.back-link {
	display: block;
	margin-top: 25px;
	color: #a38f82;
	text-decoration: none;
	font-size: 13px;
}
.back-link:hover { text-decoration: underline; }

/* 顶部导航栏 */
header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 40px;
	background: rgba(255, 255, 255, 0.6);
	backdrop-filter: blur(10px);
}
.logo { font-size: 24px; font-weight: bold; color: #8c533e; }
.auth-btn {
	background: #d97736;
	color: white;
	padding: 10px 24px;
	border-radius: 20px;
	text-decoration: none;
	font-weight: bold;
	box-shadow: 0 4px 10px rgba(217, 119, 54, 0.3);
	transition: all 0.3s ease;
}
.auth-btn:hover { background: #b85b20; transform: translateY(-2px); }

/* 咖啡馆门口场景 */
.cafe-entrance {
	position: relative;
	max-width: 800px;
	height: 500px;
	margin: 40px auto;
	background: linear-gradient(to bottom, #e3c4a8 0%, #cbb094 70%, #8c6d53 70%);
	border-radius: 20px;
	box-shadow: 0 10px 30px rgba(0,0,0,0.1);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
}

/* 咖啡馆大门与招牌 */
.sign {
	background: #5c3a21;
	color: #fceade;
	padding: 12px 30px;
	border-radius: 0 0 12px 12px;
	font-size: 20px;
	letter-spacing: 2px;
	box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.door {
	width: 180px;
	height: 250px;
	background: #7a4b2a;
	border: 6px solid #422612;
	border-bottom: none;
	margin-top: 20px;
	border-radius: 10px 10px 0 0;
	position: relative;
}
.door-glass {
	width: 70%;
	height: 50%;
	background: #d4e8f0;
	margin: 20px auto;
	border-radius: 5px;
	opacity: 0.8;
}

/* 门口的地毯 */
.rug {
	position: absolute;
	bottom: 30px;
	width: 260px;
	height: 90px;
	background: #d95d55;
	border: 4px dashed #f7c59f;
	border-radius: 50px;
	box-shadow: 0 8px 15px rgba(0,0,0,0.15);
	display: flex;
	justify-content: center;
	align-items: center;
}

/* CSS 纯代码睡着的橘猫 */
.sleeping-cat {
	position: relative;
	width: 70px;
	height: 45px;
	background: #f2994a;
	border-radius: 40px 40px 20px 20px;
	animation: breathe 3s infinite ease-in-out;
}
/* 猫咪耳朵 */
.sleeping-cat::before {
	content: '';
	position: absolute;
	top: -6px; left: 10px;
	width: 0; height: 0;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-bottom: 12px solid #f2994a;
}
/* 猫咪尾巴包裹着身体 */
.sleeping-cat::after {
	content: '';
	position: absolute;
	bottom: 0; right: -10px;
	width: 40px; height: 12px;
	background: #f2994a;
	border-radius: 10px;
}
/* 猫咪睡觉的 Zzz 动画 */
.zzz {
	position: absolute;
	top: -25px;
	right: 0;
	font-size: 16px;
	font-weight: bold;
	color: #8c533e;
	animation: zzz-anim 2s infinite;
}

@keyframes breathe {
	0%, 100% { transform: scale(1); }
	50% { transform: scale(1.05, 0.98); }
}
@keyframes zzz-anim {
	0% { opacity: 0; transform: translate(0, 0); }
	50% { opacity: 1; }
	100% { opacity: 0; transform: translate(10px, -15px); }
}

.welcome-text {
	text-align: center;
	margin-top: 10px;
}

/* 🌸 方案 2 的 SweetAlert2 Toast 自定义圆角与阴影 */
.rounded-toast {
    border-radius: 16px !important;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
	font-family: 'PingFang SC', sans-serif;
	background-color: #f7ebe1; color: #4a3b32; padding: 15px;
	max-width: 600px; margin: 0 auto;
}

.user-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }

.status-bar {
	background: white; padding: 12px 15px; border-radius: 15px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.05);
	display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}

.pet-name-box {
	font-size: 14px; font-weight: bold; cursor: pointer;
	display: flex; align-items: center; gap: 4px;
	background: #fdf5ef; padding: 5px 10px; border-radius: 20px; border: 1px solid #e8cfb8;
}
.pet-name-box:hover { background: #ffe3d1; }
.edit-icon { font-size: 11px; opacity: 0.6; }

.stat-item { font-size: 13px; font-weight: bold; }
.exp-bar-box {
	width: 60px; height: 10px; background: #eee; border-radius: 5px; overflow: hidden;
	display: inline-block; vertical-align: middle; margin-left: 3px;
}
.exp-bar-fill {
	height: 100%; background: #4CAF50; width: <?= $expPercent ?>%; transition: width 0.4s ease;
}

/* 每日签到 Card */
.daily-claim-card {
	background: #fff3e6; border: 2px dashed #d97736; border-radius: 12px;
	padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px;
}
.claim-btn {
	background: #d97736; color: white; border: none; padding: 8px 14px; border-radius: 8px;
	font-weight: bold; cursor: pointer;
}

/* 宠物房间与不同背景样式 */
#pet-room {
	width: 100%; height: 380px;
	border: 4px solid #8c533e; border-radius: 20px; position: relative; overflow: hidden;
	display: flex; justify-content: center; align-items: center;
	box-shadow: inset 0 0 20px rgba(0,0,0,0.1); transition: background 0.5s ease;
}

#pet-room.theme-default { background: linear-gradient(to bottom, #fceade 65%, #e8cfb8 65%); }
#pet-room.theme-camping { background: linear-gradient(to bottom, #1a2a3a 70%, #2e4d36 70%); }
#pet-room.theme-cafe    { background: linear-gradient(to bottom, #eddccb 60%, #a67c52 60%); }

#pet { font-size: 90px; user-select: none; cursor: pointer; transition: transform 0.2s; z-index: 2; }
#pet:hover { transform: scale(1.1); }

.room-actions {
	position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 5;
}
.room-btn {
	background: rgba(217, 119, 54, 0.9); color: white; border: none; padding: 8px 14px;
	border-radius: 20px; cursor: pointer; font-weight: bold; font-size: 13px;
	box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

#inventory-bar {
	position: absolute; bottom: 0; left: 0; width: 100%; height: 85px;
	background: rgba(255, 255, 255, 0.95); display: flex; align-items: center; gap: 15px; padding: 0 15px;
	overflow-x: auto; border-top: 2px solid #8c533e; transition: transform 0.3s ease; z-index: 10;
}
#inventory-bar.hidden { transform: translateY(100%); }
.item-card {
	min-width: 55px; height: 55px; background: #fff; border: 2px solid #d97736; border-radius: 12px;
	display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: grab;
}

/* 任务板块 */
.section-box {
	margin-top: 15px; background: white; padding: 18px; border-radius: 15px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
.task-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }

.task-item {
	display: flex; align-items: center; justify-content: space-between;
	padding: 12px 10px; border-bottom: 1px dashed #eee; border-radius: 8px;
}
.task-item label { display: flex; align-items: center; gap: 10px; font-size: 15px; cursor: pointer; }
.task-item input[type="checkbox"] { width: 18px; height: 18px; accent-color: #d97736; }

.task-item.completed { background-color: #f2f2f2; opacity: 0.6; pointer-events: none; }
.task-item.completed label span { text-decoration: line-through; color: #888; }

.create-task-btn {
	display: block; width: 100%; text-align: center; background: #8c533e; color: white;
	padding: 12px; border-radius: 10px; text-decoration: none; font-weight: bold; margin-top: 12px;
}

.weekly-progress-bar { width: 100%; height: 12px; background: #eee; border-radius: 6px; overflow: hidden; margin: 8px 0; }
.weekly-progress-fill { height: 100%; background: #d97736; }

/* ----------------------------------------------------
   🌟 商店 Modal 弹窗 CSS
---------------------------------------------------- */
.modal-overlay {
	position: fixed; top: 0; left: 0; width: 100%; height: 100%;
	background: rgba(0, 0, 0, 0.5); display: flex; justify-content: center; align-items: center;
	z-index: 100; opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }

.shop-modal {
	background: white; width: 90%; max-width: 450px; border-radius: 20px; padding: 20px;
	box-shadow: 0 10px 25px rgba(0,0,0,0.2); max-height: 85vh; overflow-y: auto; position: relative;
}
.modal-close {
	position: absolute; top: 15px; right: 20px; font-size: 22px; cursor: pointer; color: #888;
}

.shop-tabs { display: flex; gap: 10px; margin: 15px 0; border-bottom: 2px solid #eee; padding-bottom: 8px; }
.shop-tab {
	font-weight: bold; padding: 6px 12px; cursor: pointer; border-radius: 8px; color: #888;
}
.shop-tab.active { background: #fdf5ef; color: #d97736; }

.shop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shop-item {
	border: 2px solid #f0e0d0; border-radius: 12px; padding: 12px; text-align: center; background: #fffaf5;
}
.shop-item-preview {
	height: 70px; border-radius: 8px; margin-bottom: 8px; display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.shop-item-title { font-weight: bold; font-size: 13px; margin-bottom: 4px; }
.shop-item-price { font-size: 12px; color: #d97736; font-weight: bold; margin-bottom: 8px; }
.shop-buy-btn {
	width: 100%; padding: 6px; border: none; border-radius: 8px; background: #d97736; color: white;
	font-weight: bold; font-size: 12px; cursor: pointer;
}
.shop-buy-btn.equipped { background: #4CAF50; cursor: default; }
.shop-buy-btn.use-btn { background: #8c533e; }
.rounded-toast {
	border-radius: 16px !important;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important;
}

.card {
	background: white; padding: 25px; border-radius: 20px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
h2 { color: #8c533e; margin-bottom: 6px; font-size: 20px; text-align: center; }
p.subtitle { font-size: 12px; color: #888; text-align: center; margin-bottom: 20px; }

/* 3 个槽位的卡片样式 */
.slots-container { display: flex; flex-direction: column; gap: 12px; margin-bottom: 25px; }

.slot-card {
	background: #fdfaf7; border: 2px dashed #e8cfb8; border-radius: 12px;
	padding: 12px 15px; display: flex; justify-content: space-between; align-items: center;
}
.slot-card.filled { border-style: solid; background: #fff; }
.slot-card.locked { background: #f2f2f2; border-color: #ccc; cursor: not-allowed; }

.slot-title { font-size: 14px; font-weight: bold; color: #5c3a21; flex: 1; }
.slot-card.empty .slot-title { color: #aaa; font-weight: normal; font-size: 13px; }

.clear-btn { color: #e74c3c; cursor: pointer; font-size: 16px; font-weight: bold; padding: 0 5px; }
.reward-badge { background: #ffe3d1; color: #d97736; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: bold; }
.locked-badge { background: #e0e0e0; color: #666; font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: bold; }

/* Preset 常用模版区 */
.presets-section { border-top: 2px dashed #eee; padding-top: 20px; margin-bottom: 25px; }
.presets-section h4 { font-size: 14px; color: #8c533e; margin-bottom: 12px; }

/* 新建 Preset 输入框 */
.add-preset-row { display: flex; gap: 8px; margin-bottom: 15px; }
.add-preset-row input {
	flex: 1; padding: 9px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 13px; outline: none;
}
.add-preset-btn {
	background: #8c533e; color: white; border: none; padding: 9px 14px; border-radius: 8px;
	cursor: pointer; font-size: 13px; font-weight: bold;
}

/* Preset 点击标签 */
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	background: #f0e6df; color: #6e5a4d; font-size: 13px; padding: 8px 12px;
	border-radius: 20px; display: flex; align-items: center; gap: 8px; cursor: pointer;
	box-shadow: 0 2px 4px rgba(0,0,0,0.03); transition: all 0.2s;
}
.chip:hover { background: #d97736; color: white; }
.chip .del-btn { color: #aaa; font-size: 14px; }
.chip:hover .del-btn { color: #fff; }

/* 最底部的提交按钮 */
.submit-btn {
	width: 100%; background: #d97736; color: white; border: none; padding: 14px;
	border-radius: 12px; font-size: 16px; font-weight: bold; cursor: pointer;
	box-shadow: 0 4px 10px rgba(217, 119, 54, 0.2);
}
.submit-btn:hover { background: #b85b20; }
.back-link { display: block; text-align: center; margin-top: 15px; color: #a38f82; text-decoration: none; font-size: 14px; }

/* 🐾 柔和暖色调 页脚 (Footer) 样式 */
.app-footer {
    /*background-color: #fffaf5;*/
    border-top: 1px solid #ebdcd0;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: #8c7b70;
    margin-top: auto; /* 让页脚在页面内容少时自动沉底 */
}

.footer-container {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: #d97736;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    cursor: pointer;
}

.footer-links a:hover {
    color: #b55d22;
    text-decoration: underline;
}

/* 🪟 模态框 (Modal) 样式 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: #fffaf5;
    border-radius: 20px;
    max-width: 550px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #8c7b70;
    cursor: pointer;
}

.modal-card h2 {
    margin-top: 0;
    color: #4a3b32;
}

.modal-card h3 {
    margin-top: 20px;
    font-size: 1.05rem;
    color: #d97736;
}

.modal-card p {
    line-height: 1.6;
    font-size: 0.95rem;
}

/* ==================================================
 * 📱 沉浸式移动端全屏设计 (含底部定位修复)
 * ================================================== */

/* 1. 🖼️ 全屏插画卡片主容器 */
.cover-hero {
    position: relative;
    width: 92%;
    max-width: 420px;
    height: 85vh;
    height: 85dvh;                  
    max-height: 750px;
    margin: 15px auto;
    border-radius: 28px;
    
    background: url('../images/bg-cover.webp') no-repeat center bottom;
    background-size: cover;
    
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(74, 59, 50, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 2. 🥛 顶部欢迎卡片 */
.top-container {
    position: absolute;
    top: 16px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 8;
}

.welcome-card {
    width: 88%;
    background: rgba(255, 252, 247, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 12px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 8px 20px rgba(60, 38, 28, 0.12);
}

.welcome-card h2 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
    color: #5c3d2e;
    font-weight: 700;
}

.welcome-card p {
    margin: 0;
    font-size: 0.82rem;
    color: #5c3d2e;
    line-height: 1.4;
    opacity: 0.9;
}

/* 3. 🎯 猫猫头顶 Zzz 动画 */
.cat-zzz-container {
    position: absolute;
    bottom: 34%;                    /* 对齐猫猫头顶 */
    left: 26%;
    display: flex;
    gap: 3px;
    pointer-events: none;
    z-index: 10;                    /* 🌟 提高层级，防止被背景遮挡 */
}

.zzz-letter {
    font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Round', sans-serif;
    font-weight: 800;
    color: #ffffff !important;      /* 🌟 强制纯白色，防止手机浏览器变成黑色 */
    
    /* 🌟 深色外发光与 Drop Shadow，确保在暖阳光影背景下清晰突出 */
    text-shadow: 
        0 2px 4px rgba(60, 38, 28, 0.9),
        0 0 8px rgba(0, 0, 0, 0.5);
        
    opacity: 0;
    animation: zzzFloat 2.4s infinite ease-in-out;
    -webkit-text-fill-color: #ffffff !important; /* 兼容 iOS Safari 文本填充色 */
}

.zzz-letter.z1 { font-size: 0.95rem; animation-delay: 0s; }
.zzz-letter.z2 { font-size: 1.25rem; animation-delay: 0.6s; }
.zzz-letter.z3 { font-size: 1.55rem; animation-delay: 1.2s; }

@keyframes zzzFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.8) rotate(-10deg);
    }
    50% {
        opacity: 0.95;
        transform: translateY(-18px) scale(1.1) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-34px) scale(1.3) rotate(15deg);
    }
}

/* 4. 📦 🌟 底部容器 (强制吸附最下方，解决组件错位) */
.bottom-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 9;                     /* 确保高于背景图和动画层 */
}

/* 5. ✨ Sign Up | Login 文字 */
.auth-link-box {
    margin-bottom: 12px;
    text-align: center;
}

.text-auth-btn {
    color: #ffffff !important;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    
    text-shadow: 
        0 2px 4px rgba(40, 25, 18, 0.7), 
        0 0 10px rgba(60, 38, 28, 0.8);
        
    display: inline-block;
    padding: 4px 8px;
    background: none !important;
    border: none !important;
    backdrop-filter: none !important;
    transition: all 0.25s ease;
}

.text-auth-btn:hover {
    transform: translateY(-2px) scale(1.05);
    text-shadow: 
        0 3px 6px rgba(40, 25, 18, 0.85), 
        0 0 15px rgba(60, 38, 28, 0.95);
}

.auth-link-box .link-dot {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    margin: 0 6px;
    text-shadow: 0 2px 4px rgba(60, 38, 28, 0.8);
}

/* 次要链接（Add to Home Screen）样式 - 稍微精细透明一点，突出 Sign Up */
.text-auth-btn.sub-link {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 600;
    cursor: pointer;
}

.text-auth-btn.sub-link:hover {
    opacity: 1;
    color: #fffaf0 !important;
}

/* 如果选用方案二 (上下堆叠)，加上这行 */
.auth-link-box.stacked {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* 6. 🐾 嵌入式 Footer */
.app-footer-embedded {
    width: 100%;
    padding: 10px 0 12px 0;
    background: rgba(60, 38, 28, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-align: center;
    color: #fffaf5;
    font-size: 0.75rem;
}

.app-footer-embedded .footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.app-footer-embedded .footer-links a {
    color: #fcebd9;
    text-decoration: none;
    font-weight: 500;
}

.app-footer-embedded .footer-links .dot {
    color: #d97736;
}

.app-footer-embedded .copyright {
    opacity: 0.8;
    font-size: 0.7rem;
}

/* --------------------------------------------------
 * 💻 手机端全屏优化 (@media - 修复 Footer 定位)
 * -------------------------------------------------- */
@media screen and (max-width: 480px) {
    html, body {
        margin: 0;
        padding: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;            /* 锁定页面防滚 */
    }

    .cover-hero {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        margin: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .top-container {
        top: 24px;                   /* 避免刘海屏 */
    }

    .bottom-container {
        bottom: 0;                   /* 手机全屏时强行贴到底部 */
        padding-bottom: env(safe-area-inset-bottom, 0px); /* 兼容 iPhone 底部黑条安全区 */
    }

    .welcome-card {
        width: 90%;
        padding: 14px 18px;
    }

    .app-footer-embedded {
        padding: 12px 0 16px 0;      /* 手势区域安全留白 */
    }

}