/* ============================================
   猫伴日记阁 · 共享样式
   温暖手作绘本风 — 小染配色
   ============================================ */

/* ---------- CSS 自定义属性（主题色） ---------- */
:root {
    --color-bg: #FFC4A3;          /* 奶油橘 - 背景主色 */
    --color-yellow: #FFD93D;      /* 蜜糖黄 - 好感条/高亮 */
    --color-gray: #8E9AAF;        /* 猫咪灰 - 文字/边框 */
    --color-pink: #FFB7C5;        /* 樱花粉 - 按钮/泡泡 */
    --color-card-bg: rgba(255, 245, 235, 0.85);
    --color-text: #4d2f1f;        /* 深棕文字 */
    --color-text-light: #7a5a4a;
    --color-border: #ecd9cc;
    --color-shadow: rgba(180, 100, 60, 0.2);
    --radius-lg: 48px;
    --radius-md: 28px;
    --radius-sm: 60px;
    --font-stack: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 全局重置 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
}

body {
    font-family: var(--font-stack);
    background: var(--color-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-image: radial-gradient(circle at 20% 30%, #ffe1cc 0%, var(--color-bg) 90%);
    color: var(--color-text);
}

/* ---------- 导航栏 ---------- */
.nav-bar {
    width: 100%;
    max-width: 560px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.nav-bar a {
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    color: var(--color-text-light);
    background: var(--color-card-bg);
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--color-border);
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.nav-bar a:hover {
    background: var(--color-pink);
    border-color: var(--color-pink);
    transform: translateY(-2px);
}

.nav-bar a:active {
    transform: scale(0.95);
}

.nav-bar .logo {
    font-size: 22px;
    font-weight: 800;
    background: none;
    border: none;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--color-yellow), var(--color-pink));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- 卡片容器 ---------- */
.diary {
    width: 100%;
    max-width: 560px;
    background: var(--color-card-bg);
    backdrop-filter: blur(4px);
    border-radius: var(--radius-lg) var(--radius-lg) 32px 32px;
    padding: 20px 18px 28px;
    box-shadow: 0 20px 40px var(--color-shadow), 0 8px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    border: 2px solid #fff3e6;
}

/* ---------- 毛线球好感条 ---------- */
.yarn-rail {
    background: #f0dfd0;
    border-radius: var(--radius-sm);
    height: 28px;
    padding: 3px;
    box-shadow: inset 0 3px 8px rgba(120, 70, 40, 0.2);
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.yarn-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--color-yellow), #fccf3a, var(--color-yellow));
    border-radius: var(--radius-sm);
    box-shadow: 0 0 12px var(--color-yellow);
    transition: width 0.4s ease;
    position: relative;
}

.yarn-fill::after {
    content: "🧶";
    position: absolute;
    right: -6px;
    top: -12px;
    font-size: 26px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.yarn-rail .label {
    position: absolute;
    right: 16px;
    top: 2px;
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-light);
    letter-spacing: 1px;
}

/* ---------- 顶部 HUD ---------- */
.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.date-badge {
    background: var(--color-pink);
    padding: 6px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    box-shadow: 0 2px 6px var(--color-pink);
}

.mood-emoji {
    font-size: 32px;
    line-height: 1;
    background: #fff2e6;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

/* ---------- 舞台 ---------- */
.stage {
    background: #f7ede3;
    border-radius: 80px 80px 40px 40px;
    padding: 20px 10px 10px;
    margin: 6px 0 12px;
    position: relative;
    min-height: 220px;
    box-shadow: inset 0 4px 12px #dbbcaa;
    border: 2px solid var(--color-border);
}

.cat-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.cat-box {
    position: relative;
    width: 140px;
    height: 120px;
    margin: 0 auto;
    cursor: grab;
}

.cat-body {
    font-size: 80px;
    line-height: 1;
    text-align: center;
    transition: transform 0.2s;
    filter: drop-shadow(0 6px 12px rgba(140, 80, 40, 0.2));
    position: relative;
    z-index: 5;
}

.cat-eyes {
    font-size: 28px;
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
    transition: all 0.1s;
}

.cat-extra {
    font-size: 18px;
    position: absolute;
    bottom: -10px;
    right: -20px;
    background: #fff2e6;
    border-radius: 30px;
    padding: 0 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    white-space: nowrap;
}

/* ---------- 躲藏点 ---------- */
.hide-spots {
    display: flex;
    justify-content: space-around;
    margin: 8px 0 4px;
    gap: 6px;
}

.spot {
    background: #e6d5c4;
    border-radius: 40px;
    padding: 8px 12px;
    font-size: 22px;
    flex: 1;
    text-align: center;
    box-shadow: inset 0 2px 6px #b2947e;
    cursor: pointer;
    transition: 0.2s;
    border: 2px solid #dcc1ae;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--color-text);
    font-weight: 600;
}

.spot:active { transform: scale(0.94); }

.spot.found {
    background: var(--color-yellow);
    border-color: #f5c542;
    box-shadow: 0 0 20px var(--color-yellow);
    animation: spotPulse 0.6s ease;
}

@keyframes spotPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.hidden-clue {
    font-size: 14px;
    margin-top: 4px;
    background: #fff6ed;
    border-radius: var(--radius-sm);
    padding: 6px 16px;
    text-align: center;
    font-weight: 600;
    color: var(--color-text-light);
    min-height: 32px;
}

/* ---------- 猫粮碗 ---------- */
.food-bowl {
    position: absolute;
    left: 10px;
    bottom: 10px;
    font-size: 44px;
    cursor: grab;
    z-index: 20;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.15));
    transition: transform 0.1s;
    touch-action: none;
}

.food-bowl:active { transform: scale(0.9); }

.bowl-glow {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--color-yellow), transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.food-bowl.near-cat .bowl-glow {
    opacity: 1;
}

/* ---------- 逗猫棒 ---------- */
.wand {
    position: absolute;
    right: 10px;
    bottom: 14px;
    font-size: 48px;
    cursor: grab;
    z-index: 20;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
    touch-action: none;
    transition: transform 0.05s;
}

.wand:active { transform: rotate(8deg) scale(0.95); }

/* ---------- 留言墙 ---------- */
.msg-wall {
    background: #f7ede3;
    border-radius: var(--radius-md) var(--radius-md) 18px 18px;
    padding: 12px 12px 8px;
    margin: 12px 0 6px;
    box-shadow: inset 0 2px 8px #dbbcaa;
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-content: flex-start;
}

.bubble {
    background: var(--color-pink);
    backdrop-filter: blur(4px);
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    box-shadow: 0 2px 6px var(--color-pink);
    border: 1px solid #ffdae3;
    transition: 0.2s;
    max-width: 160px;
    word-break: break-word;
    animation: bubbleRise 0.5s ease-out;
}

@keyframes bubbleRise {
    0% { opacity: 0; transform: translateY(16px) scale(0.8); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.bubble:hover { transform: scale(1.05); background: var(--color-pink); }

.msg-input-area {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.msg-input-area input {
    flex: 1;
    border: none;
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    background: #fff6ed;
    font-size: 15px;
    outline: 2px solid var(--color-border);
    font-weight: 600;
    color: var(--color-text);
}

.msg-input-area input:focus { outline-color: var(--color-pink); }

.msg-input-area button {
    background: var(--color-pink);
    border: none;
    border-radius: var(--radius-sm);
    padding: 0 22px;
    font-weight: 800;
    font-size: 18px;
    color: var(--color-text);
    box-shadow: 0 2px 6px var(--color-pink);
    cursor: pointer;
    transition: 0.15s;
}

.msg-input-area button:active { transform: scale(0.9); }

/* ---------- 猫爪按钮 ---------- */
.paw-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--color-pink);
    border: none;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    font-size: 36px;
    box-shadow: 0 8px 20px var(--color-pink);
    cursor: pointer;
    transition: 0.2s;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff2e6;
}

.paw-btn:active { transform: scale(0.85); }

.paw-btn:hover {
    box-shadow: 0 8px 28px var(--color-pink);
    transform: scale(1.05);
}

/* ---------- 日记侧栏 ---------- */
.diary-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 32px;
    cursor: pointer;
    background: #fff2e6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: 0.2s;
    border: 2px solid var(--color-border);
}

.diary-icon:active { transform: scale(0.9); }

.diary-panel {
    position: absolute;
    top: 70px;
    right: 10px;
    background: #fff6ed;
    border-radius: var(--radius-md);
    padding: 18px 18px 14px;
    max-width: 220px;
    box-shadow: 0 12px 30px rgba(80, 40, 20, 0.2);
    border: 2px solid var(--color-border);
    z-index: 50;
    display: none;
}

.diary-panel.show { display: block; }

.diary-panel h4 {
    color: var(--color-text-light);
    margin-bottom: 6px;
    font-size: 16px;
}

.diary-panel p {
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text);
}

.close-diary {
    background: none;
    border: none;
    font-size: 20px;
    float: right;
    cursor: pointer;
    color: #a07a66;
}

/* ---------- 粒子 ---------- */
.particle-box {
    position: absolute;
    pointer-events: none;
    z-index: 30;
}

.gold-particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--color-yellow);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--color-yellow);
    animation: floatUp 0.8s forwards;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(0.2); }
}

/* ---------- 翻肚皮 ---------- */
.belly-up .cat-body { transform: rotate(180deg) scaleX(-1); }
.belly-up .cat-eyes { display: none; }

/* ---------- 渐变标题 ---------- */
.gradient-title {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-yellow), var(--color-pink), var(--color-gray));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

/* ---------- 游戏页卡片 ---------- */
.game-card {
    background: var(--color-card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin: 12px 0;
    border: 2px solid var(--color-border);
    box-shadow: 0 4px 12px var(--color-shadow);
    transition: 0.2s;
    cursor: pointer;
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--color-shadow);
}

.game-card:active { transform: scale(0.98); }

/* ---------- APP 底部 Tab 导航 ---------- */
.app-tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff6ed;
    border-top: 2px solid var(--color-border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 0 env(safe-area-inset-bottom, 6px) 0;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(180, 100, 60, 0.12);
}

.app-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--color-text-light);
    font-size: 11px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 20px;
    transition: 0.15s;
    gap: 2px;
}

.app-tab-item .tab-icon { font-size: 24px; line-height: 1.2; }

.app-tab-item.active {
    color: var(--color-text);
    background: var(--color-pink);
}

.app-tab-item:active { transform: scale(0.9); }

.page-content { padding-bottom: 72px; width: 100%; max-width: 560px; }

/* ---------- 首页入口卡片 ---------- */
.home-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}

.home-card {
    background: #fff6ed;
    border-radius: 28px;
    padding: 20px 12px;
    text-align: center;
    border: 2px solid var(--color-border);
    box-shadow: 0 4px 12px var(--color-shadow);
    transition: 0.2s;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: var(--color-text);
}

.home-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px var(--color-shadow); }
.home-card:active { transform: scale(0.96); }

.home-card .card-icon { font-size: 48px; display: block; margin-bottom: 4px; }
.home-card .card-title { font-size: 17px; font-weight: 800; }
.home-card .card-desc { font-size: 12px; color: var(--color-text-light); margin-top: 2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 480px) {
    .diary { padding: 14px 12px; }
    .cat-body { font-size: 64px; }
    .food-bowl { font-size: 36px; }
    .wand { font-size: 38px; }
    .nav-bar a { font-size: 13px; padding: 6px 12px; }
    .gradient-title { font-size: 22px; }
    .home-grid { grid-template-columns: 1fr 1fr; }
}

/* ========== CSS 手绘猫咪 ========== */
.cat-face {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    width: 100px;
    height: 100px;
}

.cat-face .head {
    width: 88px;
    height: 76px;
    background: #f5cba7;
    border-radius: 50% 50% 45% 45%;
    position: relative;
    box-shadow: 0 4px 8px rgba(140,80,40,0.15);
}

/* 耳朵 */
.cat-face .ear-l,
.cat-face .ear-r {
    position: absolute;
    top: -12px;
    width: 22px;
    height: 22px;
    background: #f5cba7;
    border-radius: 50% 50% 0 0;
    z-index: -1;
}
.cat-face .ear-l { left: 6px; transform: rotate(-15deg); }
.cat-face .ear-r { right: 6px; transform: rotate(15deg); }
.cat-face .ear-l::after,
.cat-face .ear-r::after {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    width: 14px;
    height: 14px;
    background: #f09b8a;
    border-radius: 50% 50% 0 0;
}

/* 眼睛 */
.cat-face .eyes {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding-top: 18px;
}
.cat-face .eye {
    width: 18px;
    height: 18px;
    background: #2d1b0e;
    border-radius: 50%;
    position: relative;
    animation: catBlink 3s infinite;
}
.cat-face .eye::after {
    content: '';
    position: absolute;
    top: 3px;
    right: 3px;
    width: 7px;
    height: 7px;
    background: white;
    border-radius: 50%;
}

@keyframes catBlink {
    0%, 94%, 100% { transform: scaleY(1); }
    96% { transform: scaleY(0.1); }
}

/* 鼻子 */
.cat-face .nose {
    width: 8px;
    height: 6px;
    background: #f09b8a;
    border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
    margin: 2px auto 0;
}

/* 嘴巴 */
.cat-face .mouth {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin-top: -1px;
}
.cat-face .mouth span {
    width: 8px;
    height: 6px;
    border: 2px solid #8b6b5a;
    border-top: none;
    border-radius: 0 0 10px 10px;
}

/* 胡须 */
.cat-face .whiskers {
    position: absolute;
    top: 36px;
    left: 0;
    right: 0;
    pointer-events: none;
}
.cat-face .whiskers::before,
.cat-face .whiskers::after {
    content: '';
    position: absolute;
    width: 28px;
    height: 2px;
    background: #b09484;
    border-radius: 2px;
}
.cat-face .whiskers::before { left: -18px; top: 0; transform: rotate(-8deg); }
.cat-face .whiskers::after { right: -18px; top: 0; transform: rotate(8deg); }

/* 腮红 */
.cat-face .blush-l,
.cat-face .blush-r {
    position: absolute;
    top: 40px;
    width: 16px;
    height: 12px;
    background: rgba(255,150,150,0.45);
    border-radius: 50%;
}
.cat-face .blush-l { left: 2px; }
.cat-face .blush-r { right: 2px; }

/* 身体（小椭圆） */
.cat-face .body {
    margin-top: -4px;
    width: 50px;
    height: 30px;
    background: #f5cba7;
    border-radius: 50% 50% 40% 40%;
    position: relative;
}

/* 猫 emoji 扑跳动画 */
.cat-emoji-big.pounce {
    animation: emojiPounce 0.3s ease;
}
@keyframes emojiPounce {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.15); }
    100% { transform: translateY(0) scale(1); }
}

/* 扑逗猫棒动画 */
.cat-face.pounce {
    animation: catPounce 0.3s ease;
}
@keyframes catPounce {
    0% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-8px) scale(1.08); }
    100% { transform: translateY(0) scale(1); }
}
