﻿.pet-panel,
.pet-detail-modal {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    background: var(--btn_bg_s);
    overflow: hidden;
    overscroll-behavior: contain;
    color: #fff;
    z-index:300;
}

.pet-header,
.pet-detail-header {
    height: 6%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(0,0,0,0.22);
    color: var(--btn_color_q);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.pet-header-title,
.pet-detail-header-title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 2px;
}

.pet-close-btn,
.pet-detail-close-btn {
    position: absolute;
    right: 6px;
    bottom: -14px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    object-fit: contain;
    cursor: pointer;
    z-index: 5;
}

.pet-total-bar {
    height: 2%;
    display: flex;
    align-items: center;
    justify-content: start;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(0, 0, 0, 0.12);
    padding: 0px 10px;
}

.pet-toolbar {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: calc(6% + 8px);
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding:8px;
    box-sizing: border-box;
    background: rgb(71 58 3 / 88%);
    border-radius: 8px;
    backdrop-filter: blur(2px);
    border: 1px solid;
}

.pet-decompose-summary-text {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.84);
}

.pet-decompose-dropdown {
    position: relative;
}

.pet-decompose-dropdown-btn {
    min-width: 112px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    background: rgba(255,255,255,0.2);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.pet-decompose-dropdown-menu {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(100% + 4px);
    top: auto;
    background: rgba(20,20,20,0.96);
    border-radius: 6px;
    overflow: hidden;
    z-index: 50;
    border: 1px solid rgba(255,255,255,0.12);
}

.pet-decompose-dropdown-item {
    width: 100%;
    height: 36px;
    border: 0;
    background: transparent;
    color: rgba(255,255,255,0.86);
    font-size: 13px;
}

.pet-decompose-dropdown-item-active {
    font-weight: 700;
}

.pet-decompose-quality-huang {
    color: #f7d56b;
}

.pet-decompose-quality-xuan {
    color: #66c2ff;
}

.pet-decompose-quality-di {
    color: #d58bff;
}

.pet-decompose-quality-tian {
    color: #ff9658;
}

.pet-decompose-dropdown-item[data-quality="1"] {
    color: #f7d56b;
}

.pet-decompose-dropdown-item[data-quality="2"] {
    color: #66c2ff;
}

.pet-decompose-dropdown-item[data-quality="3"] {
    color: #d58bff;
}

.pet-decompose-dropdown-item[data-quality="4"] {
    color: #ff9658;
}

.pet-decompose-dropdown-item[data-quality="1"].pet-decompose-dropdown-item-active {
    background: rgba(247,213,107,0.18);
}

.pet-decompose-dropdown-item[data-quality="2"].pet-decompose-dropdown-item-active {
    background: rgba(102,194,255,0.18);
}

.pet-decompose-dropdown-item[data-quality="3"].pet-decompose-dropdown-item-active {
    background: rgba(213,139,255,0.18);
}

.pet-decompose-dropdown-item[data-quality="4"].pet-decompose-dropdown-item-active {
    background: rgba(255,150,88,0.18);
}

.pet-body {
    height: 86%;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    padding: 8px;
}

.pet-list-wrap,
.pet-atlas-detail-wrap {
    width: 100%;
    height: 100%;
    position: relative;
    background: rgba(0,0,0,0.08);
    border-radius: 8px;
    overflow: hidden;
}

.pet-loop {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    touch-action: pan-y;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 72px;
    box-sizing: border-box;
}

.pet-empty,
.pet-loading {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    text-align: center;
    color: rgba(255,255,255,0.75);
    font-size: 12px;
    pointer-events: none;
}

.pet-empty {
    top: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pet-footer {
    height: 6%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    background: rgba(0,0,0,0.18);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.pet-footer-btn,
.pet-footer-submit {
    height: 38px;
    border: 0;
    border-radius: 6px;
    padding: 0 16px;
    background: var(--btn_bg_s);
    color: var(--btn_color_q);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.pet-footer-btn-active {
    background: var(--btn_bg_q);
    color: var(--btn_color_s);
}

.pet-footer-submit {
    margin-left: auto;
    min-width: 112px;
    background: #f1ae01;
    color: #231607;
    border: 1px solid #ffebc4;
}

.pet-item {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.pet-item-current {
    outline: 4px solid #00ff3d;
    outline-offset: -2px;
}

.pet-item-inner {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}

.pet-item-icon {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: rgba(0,0,0,0.12);
}

.pet-item-hero-icon {
    position: absolute;
    right: 4px;
    top: 4px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgb(252 233 5 / 75%);
    background: rgb(255 255 255 / 61%);
}

.pet-item-bottom {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 34px;
    padding: 4px 6px;
    box-sizing: border-box;
    background: rgba(0,0,0,0.48);
}

.pet-item-name {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-item-meta {
    margin-top: 2px;
    font-size: 11px;
    color: rgba(255,255,255,0.88);
    line-height: 1.2;
}

.pet-item-mask {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    background: rgba(0,0,0,0.48);
}

.pet-item-selected-icon {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translate(-50%, -50%);
    object-fit: contain;
    z-index: 6;
}

.pet-atlas-item {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
}

.pet-atlas-video-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: rgba(0,0,0,0.18);
}

.pet-atlas-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pet-atlas-name {
    padding: 6px 8px;
    font-size: 13px;
    color: #fff;
    text-align: center;
    background: rgba(0,0,0,0.38);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pet-atlas-detail-wrap {
    display: none;
    padding: 10px;
    box-sizing: border-box;
}

.pet-atlas-detail-back {
    position: absolute;
    left: 10px;
    top: 10px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    border: 0;
    border-radius: 6px;
    background: rgb(0 0 0 / 70%);
    color: #ffffff;
    padding: 10px;
}

.pet-atlas-detail-video-wrap {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.18);
    position: relative;
}

.pet-atlas-detail-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.pet-atlas-detail-name {
    margin-top: 10px;
    font-size: 18px;
    font-weight: 700;
    color: #fff4cc;
    text-align: center;
}

.pet-atlas-detail-desc {
    margin-top: 10px;
    height: calc(100% - 54% - 44px);
    min-height: 80px;
    overflow-y: auto;
    line-height: 1.65;
    font-size: 14px;
    color: rgba(255,255,255,0.88);
    white-space: pre-wrap;
}

.pet-detail-body {
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
    padding: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 固定视频区域高度，避免切换视频时产生布局跳动 */
.pet-detail-video-wrap {
    width: 100%;
    /* 响应式稳定高度：不超过 48vh 且最大 520px，保证桌面/移动体验 */
    height: min(520px, 48vh);
    max-height: 560px;
    /* 保留宽高比作为兼容回退（不依赖它作为唯一控制） */
    aspect-ratio: 16 / 9;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0,0,0,0.18);
    box-sizing: border-box;
    min-height: 200px; /* 小屏幕的最低高度保障 */
}

.pet-detail-video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    background: #000;
}

.pet-detail-video-mask {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    padding: 10px;
    box-sizing: border-box;
    background: linear-gradient(to bottom, rgba(0,0,0,0.58), rgba(0,0,0,0));
}

.pet-detail-name {
    font-size: 18px;
    font-weight: 700;
    color: #fff4cc;
}

.pet-detail-meta {
    margin-top: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.82);
}

.pet-detail-middle {
    margin-top: 10px;
    display: grid;
    grid-template-columns: .92fr 1.08fr;
    gap: 10px;
}

.pet-stats {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.pet-stat-card {
    flex: 1 1 50%;
    width: calc(50% - 4px);
    min-width: 0;
    padding: 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pet-stat-label {
    font-size: 12px;
    color: rgba(255,255,255,0.72);
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
}

.pet-stat-value {
    margin-top: 0;
    font-size: 16px;
    font-weight: 700;
    color: #6dff8b;
    white-space: nowrap;
    flex: 0 0 auto;
}


.pet-detail-entries {
    height: 180px;
    overflow-y: auto;
    padding-right: 2px;
    border-radius: 8px;
}

.pet-entry-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 20px;
    padding: 6px 15px;
    border-radius: 0px;
    background: rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid #ffffff3b;
}

.pet-entry-name {
    font-size: 13px;
    color: #ffd800;
    min-width: 0;
}

.pet-entry-value {
    font-size: 13px;
    color: #6dff8b;
    white-space: nowrap;
}

.pet-entry-empty {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 12px;
}

.pet-tabs {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.pet-tab-btn {
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.86);
    font-size: 14px;
}

.pet-tab-btn-active {
    background: #f1ae01;
    color: #231607;
    font-weight: 700;
}

.pet-detail-bottom {
    margin-top: 10px;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}


.pet-detail-tab-panel {
    display: none;
    width: 100%;
    height: 100%;
    min-height: 0;
    padding: 10px;
    box-sizing: border-box;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
}

.pet-cost-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pet-cost-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 6px;
}

.pet-cost-text {
    font-size: 13px;
    color: #ffd79b;
}

.pet-action-row {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.pet-action-btn-save {
    min-width: 100px;
    height: 38px;
    border: 0;
    border-radius: 6px;
    background: #43cb3d;
    color: #231607;
    font-size: 15px;
    font-weight: 700;
}
.pet-action-btn-save:disabled {
    opacity: 0.65;
}
.pet-action-btn {
    min-width: 100px;
    height: 38px;
    border: 0;
    border-radius: 6px;
    background: #f1ae01;
    color: #231607;
    font-size: 15px;
    font-weight: 700;
}

    .pet-action-btn:disabled {
        opacity: 0.65;
    }

.pet-wash-hint {
    margin-top: 0px;
    font-size: 12px;
    color: rgba(255,255,255,0.72);
    text-align: center;
}

.hero-pet-slot {
    position: relative;
    overflow: hidden;
}

.hero-pet-slot-inner {
    width: 100%;
    height: 100%;
    position: relative;
}

.hero-pet-slot-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-pet-slot-advance {
    position: absolute;
    left: 2px;
    top: 2px;
    min-width: 30px;
    height: 18px;
    padding: 0 4px;
    border-radius: 10px;
    background: rgba(0,0,0,0.55);
    color: #ffe49a;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-pet-slot-level {
    position: absolute;
    right: 2px;
    bottom: 2px;
    min-width: 34px;
    height: 18px;
    padding: 0 4px;
    border-radius: 10px;
    background: rgba(0,0,0,0.55);
    color: #9cff9f;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 420px) {
    .pet-detail-middle {
        grid-template-columns: 1fr;
    }

    .pet-footer {
        gap: 10px;
        padding: 6px 8px;
    }

    .pet-footer-btn,
    .pet-footer-submit {
        padding: 0 12px;
        font-size: 14px;
    }
}
.pet-detail-nav {
    position: absolute;
    bottom: 40%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    z-index: 20;
}

.pet-detail-nav-left {
    left: 12px;
}

.pet-detail-nav-right {
    right: 12px;
}

.pet-detail-nav-left img {
    transform: rotate(180deg);
}

.pet-detail-nav img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    display: block;
}
#pet-footer-unwear-btn {
    margin-left: auto;
    margin-right: auto;
}