/* ========================================================
   猫咪详情页样式 v1.0
   宠物雏形模块
   ======================================================== */

/* --- 页面容器 --- */
#cat-detail-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #fff9f0 0%, #fff5f5 50%, #f0f7ff 100%);
    padding-bottom: 120px; /* 给底部猫咪伙伴留空间 */
}

.cat-detail-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- 顶部导航 --- */
.cat-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255, 249, 240, 0.9);
    backdrop-filter: blur(10px);
}

.cat-detail-back-btn {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 13px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}

.cat-detail-back-btn:hover {
    background: #f5f5f5;
    transform: translateX(-2px);
}

.cat-detail-title {
    font-size: 17px;
    font-weight: 700;
    color: #333;
}

/* --- 猫咪头像区 --- */
.cat-detail-avatar-section {
    text-align: center;
    padding: 20px 0 24px;
}

.cat-detail-avatar-wrap {
    position: relative;
    display: inline-block;
    width: 140px;
    height: 140px;
    margin-bottom: 16px;
}

.cat-detail-avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow: 0 4px 20px rgba(255, 150, 100, 0.25);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cat-detail-avatar:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 24px rgba(255, 150, 100, 0.35);
}

/* 摸摸头动画 */
.cat-detail-avatar.pet-animation {
    animation: petBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes petBounce {
    0% { transform: scale(1); }
    30% { transform: scale(1.12) rotate(-2deg); }
    50% { transform: scale(1.08) rotate(2deg); }
    70% { transform: scale(1.05) rotate(-1deg); }
    100% { transform: scale(1); }
}

/* 心形飘动 */
.heart-float {
    position: absolute;
    font-size: 24px;
    top: 20%;
    pointer-events: none;
    animation: heartFloatUp 1.5s ease-out forwards;
    z-index: 5;
}

@keyframes heartFloatUp {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

/* 鱼干飞行动画 */
.fish-fly {
    position: absolute;
    font-size: 32px;
    right: -20px;
    top: 40%;
    pointer-events: none;
    animation: fishFlyToCat 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    z-index: 5;
}

@keyframes fishFlyToCat {
    0% {
        opacity: 0;
        transform: translateX(40px) translateY(-10px) rotate(0deg) scale(0.8);
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-50px) translateY(10px) rotate(-30deg) scale(0.6);
    }
}

/* 聊天气泡 */
.cat-detail-bubble {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: #fff;
    padding: 10px 16px;
    border-radius: 18px;
    font-size: 14px;
    color: #333;
    white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    max-width: 200px;
    white-space: normal;
    text-align: center;
}

.cat-detail-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #fff;
}

.cat-detail-bubble.bubble-in {
    animation: bubbleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubbleIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(-80%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(-100%) scale(1);
    }
}

/* --- 猫咪名字行 --- */
.cat-detail-name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.cat-detail-name {
    font-size: 22px;
    font-weight: 800;
    color: #333;
}

.cat-detail-level {
    font-size: 13px;
    font-weight: 600;
    color: #6c5ce7;
    background: #f0edff;
    padding: 2px 10px;
    border-radius: 10px;
}

.cat-detail-favor-tag {
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    padding: 3px 10px;
    border-radius: 10px;
}

/* --- 状态条区域 --- */
.cat-detail-stats {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

.stat-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.stat-bar-row + .stat-bar-row {
    border-top: 1px solid #f5f5f5;
}

.stat-bar-label {
    width: 70px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.stat-bar {
    flex: 1;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
}

.stat-energy {
    background: linear-gradient(90deg, #52c41a, #73d13d);
}

.stat-mood {
    background: linear-gradient(90deg, #faad14, #ffc53d);
}

.stat-hunger {
    background: linear-gradient(90deg, #fa8c16, #ffa940);
}

.stat-bar-value {
    width: 36px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    text-align: right;
    flex-shrink: 0;
}

/* --- 额外数据卡片 --- */
.cat-detail-extra-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}

.extra-stat-card {
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    text-align: center;
}

.extra-stat-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    font-weight: 500;
}

.extra-stat-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.extra-stat-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stat-talent {
    background: linear-gradient(90deg, #722ed1, #9254de);
}

.stat-experience {
    background: linear-gradient(90deg, #d46b08, #fa8c16);
}

.extra-stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

.extra-stat-value.big {
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #fa8c16, #ff7a45);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.extra-stat-hint {
    font-size: 11px;
    color: #bbb;
    margin-top: 2px;
}

/* --- 互动按钮区 --- */
.cat-detail-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.action-btn {
    background: #fff;
    border: none;
    border-radius: 14px;
    padding: 16px 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.action-btn:active {
    transform: translateY(0);
}

.action-icon {
    font-size: 28px;
    line-height: 1;
    margin-bottom: 4px;
}

.action-text {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.action-sub {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.action-pet {
    background: linear-gradient(135deg, #fff1f0, #fff);
}

.action-pet:hover {
    background: linear-gradient(135deg, #ffccc7, #fff1f0);
}

.action-feed {
    background: linear-gradient(135deg, #fff7e6, #fff);
}

.action-feed:hover {
    background: linear-gradient(135deg, #ffd591, #fff7e6);
}

.action-talk {
    background: linear-gradient(135deg, #e6f7ff, #fff);
}

.action-talk:hover {
    background: linear-gradient(135deg, #91d5ff, #e6f7ff);
}

/* --- 底部状态描述 --- */
.cat-detail-status-desc {
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}

/* --- 响应式 --- */
@media (max-width: 360px) {
    .cat-detail-avatar-wrap {
        width: 120px;
        height: 120px;
    }
    .cat-detail-avatar {
        width: 120px;
        height: 120px;
    }
    .action-btn {
        padding: 12px 6px;
    }
    .action-icon {
        font-size: 24px;
    }
    .action-text {
        font-size: 13px;
    }
}
