/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0; /* 确保没有默认边距 */
    overflow: hidden;
}

/* 商店打开时的布局 */
body.shop-open {
    display: flex;
    justify-content: center; /* 改为居中显示 */
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffeaa7, #fab1a0, #fab1a0);
    overflow-x: hidden;
}

/* 主游戏容器 */
#game-container {
    --cat-stage-lift: clamp(188px, 24vh, 236px);
    --control-rail-bottom: clamp(116px, 13vh, 132px);
    --drawer-resting-height: 88px;
    --drawer-bottom: 18px;
    max-width: none;
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
    min-height: 620px;
    background: #fff7ee;
    border-radius: 18px;
    box-shadow: 0 18px 55px rgba(91, 54, 35, 0.24);
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    margin-right: 0;
}

/* 商店打开时的模态框定位 */
body.shop-open #shop-modal,
body.closet-open #closet-panel {
    position: fixed;
    top: 20px;
    right: 20px; /* 固定右边距 */
    width: 380px; /* 稍微减小宽度 */
    height: calc(100vh - 40px);
    transform: none;
    margin: 0;
    display: block;
}

/* 商店打开时的游戏容器 */
body.shop-open #game-container,
body.closet-open #game-container {
    max-width: min(860px, calc(100vw - 430px));
    width: min(70vw, 860px);
    margin-right: 400px; /* 为商场预留足够空间 */
    transform: translateX(0); /* 移除左移，保持游戏容器在视图中央 */
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 游戏主场景 */
#main-scene {
    height: 100%;
    background-image: url('images/backgrounds/bg_room.png');
    background-size: cover;
    background-position: center 78%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: var(--cat-stage-lift);
}

.meteor-sky {
    position: absolute;
    inset: 0;
    display: none;
    overflow: hidden;
    pointer-events: none;
    z-index: 2;
}

#main-scene[data-background-id="bg_sunset_room"] .meteor-sky {
    display: block;
}

.meteor {
    position: absolute;
    --meteor-angle: 31deg;
    --meteor-drop-x: 126px;
    --meteor-drop-y: 184px;
    width: clamp(132px, 14vw, 238px);
    height: 3px;
    border-radius: 999px;
    opacity: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 238, 180, 0) 0%,
        rgba(255, 238, 180, 0.05) 28%,
        rgba(255, 231, 166, 0.34) 62%,
        rgba(255, 245, 212, 0.84) 88%,
        rgba(255, 255, 255, 0.98) 100%
    );
    box-shadow: 0 0 16px rgba(255, 224, 154, 0.38);
    transform: translate3d(0, 0, 0) rotate(var(--meteor-angle));
    transform-origin: 100% 50%;
    animation: meteor-fall 12s cubic-bezier(0.2, 0.08, 0.46, 1) infinite;
}

.meteor::after {
    content: "";
    position: absolute;
    right: -4px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 0 14px rgba(255, 239, 188, 0.9), 0 0 28px rgba(255, 199, 125, 0.28);
    transform: translateY(-50%);
}

.meteor-one {
    top: 9%;
    left: 18%;
    --meteor-angle: 32deg;
    --meteor-drop-x: 140px;
    --meteor-drop-y: 202px;
    animation-duration: 13s;
    animation-delay: 0.8s;
}

.meteor-two {
    top: 15%;
    left: 48%;
    width: clamp(118px, 11vw, 204px);
    --meteor-angle: 29deg;
    --meteor-drop-x: 112px;
    --meteor-drop-y: 170px;
    opacity: 0;
    animation-duration: 15s;
    animation-delay: 4.6s;
}

.meteor-three {
    top: 6%;
    left: 66%;
    width: clamp(104px, 9vw, 174px);
    --meteor-angle: 34deg;
    --meteor-drop-x: 96px;
    --meteor-drop-y: 150px;
    opacity: 0;
    animation-duration: 16s;
    animation-delay: 8.4s;
}

@keyframes meteor-fall {
    0%, 64% {
        opacity: 0;
        transform: translate3d(-26px, -32px, 0) rotate(var(--meteor-angle)) scaleX(0.82);
    }
    68% {
        opacity: 0.72;
    }
    77% {
        opacity: 0.62;
        transform: translate3d(var(--meteor-drop-x), var(--meteor-drop-y), 0) rotate(var(--meteor-angle)) scaleX(1);
    }
    82%, 100% {
        opacity: 0;
        transform: translate3d(calc(var(--meteor-drop-x) + 64px), calc(var(--meteor-drop-y) + 68px), 0) rotate(var(--meteor-angle)) scaleX(0.96);
    }
}

/* 猫咪图片 */
#cat-image {
    width: clamp(340px, 51vw, 600px);
    height: auto;
    max-height: 405px;
    object-fit: contain;
    transition: all 0.3s ease;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
    position: relative;
    z-index: 5;
}

.cat-companion-shadow {
    position: absolute;
    left: 50%;
    bottom: calc(var(--cat-stage-lift) - 8px);
    width: 330px;
    height: 50px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: radial-gradient(ellipse at center, rgba(72, 48, 32, 0.28) 0%, rgba(72, 48, 32, 0.12) 54%, rgba(72, 48, 32, 0) 74%);
    opacity: 0.18;
    pointer-events: none;
    z-index: 4;
}

.cup-steam {
    position: absolute;
    left: 76%;
    top: 62%;
    right: auto;
    bottom: auto;
    width: clamp(98px, 9.6vw, 128px);
    height: clamp(108px, 15vh, 136px);
    pointer-events: none;
    z-index: 6;
    animation: cup-steam-float 7.4s ease-in-out infinite;
    will-change: left, top, width, height, opacity, transform;
}

.cup-steam-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.steam-cloud {
    fill: rgba(255, 255, 255, 0.32);
    filter: blur(9px);
    transform-origin: 50% 100%;
    animation: steam-cloud-breathe 5.8s ease-in-out infinite;
}

.steam-ribbon {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: blur(4px);
    transform-origin: 50% 100%;
    animation: steam-ribbon-fade 6.4s ease-in-out infinite;
}

.steam-ribbon-main {
    stroke: rgba(255, 255, 255, 0.62);
    stroke-width: 20px;
}

.steam-ribbon-soft {
    stroke: rgba(255, 250, 238, 0.42);
    stroke-width: 16px;
    animation-delay: 1.2s;
}

@keyframes cup-steam-float {
    0% {
        opacity: 0.24;
        transform: translateY(8px) scale(0.94);
    }
    24% {
        opacity: 0.58;
    }
    58% {
        opacity: 0.42;
        transform: translateY(-12px) scale(1.02);
    }
    100% {
        opacity: 0.12;
        transform: translateY(-38px) scale(1.08);
    }
}

@keyframes steam-cloud-breathe {
    0%, 100% {
        transform: scaleX(0.92) translateX(0);
    }
    50% {
        transform: scaleX(1.08) translateX(6px);
    }
}

@keyframes steam-ribbon-fade {
    0% {
        opacity: 0.52;
        transform: translateX(0) scale(0.96);
    }
    45% {
        opacity: 0.86;
        transform: translateX(-4px) scale(1.02);
    }
    100% {
        opacity: 0.26;
        transform: translateX(9px) scale(1.1);
    }
}

#main-scene.timer-companion-active .cat-companion-shadow {
    opacity: 0.38;
    animation: cat-shadow-breathe 4.8s ease-in-out infinite;
}

#cat-image.timer-sleep-companion {
    animation: cat-breathe 4.8s ease-in-out infinite;
    transform-origin: center bottom;
}

#cat-image.timer-sleep-companion:hover {
    transform: none;
}

#main-scene.timer-companion-paused .cat-companion-shadow,
#main-scene.timer-companion-paused #cat-image.timer-sleep-companion {
    animation-play-state: paused;
}

@keyframes cat-breathe {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-3px) scale(1.012);
    }
}

@keyframes cat-shadow-breathe {
    0%, 100% {
        transform: translateX(-50%) scaleX(1);
        opacity: 0.36;
    }
    50% {
        transform: translateX(-50%) scaleX(0.92);
        opacity: 0.28;
    }
}

@media (prefers-reduced-motion: reduce) {
    #cat-image.timer-sleep-companion,
    #main-scene.timer-companion-active .cat-companion-shadow,
    .meteor {
        animation: none;
    }

    #main-scene.timer-companion-active .cat-companion-shadow {
        opacity: 0.32;
    }

    .meteor-sky {
        display: none !important;
    }
}

#cat-image:hover {
    transform: scale(1.05);
}

#cat-image {
    cursor: pointer;
}

/* 互动状态下的猫咪样式 */
#cat-image.interacting {
    cursor: pointer;
}

#cat-image.interacting::after {
    content: "点击恢复";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
}

html[lang="en"] #cat-image.interacting::after {
    content: "Click to restore";
}

#cat-image.interacting:hover::after {
    opacity: 1;
}

/* 物品收藏区域 */
#items-collection-area {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: var(--drawer-bottom);
    z-index: 95;
    background: rgba(255, 250, 242, 0.76);
    border-radius: 18px;
    padding: 9px 12px;
    margin: 0;
    box-shadow: 0 14px 36px rgba(64, 39, 25, 0.18);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.58);
    transition: all 0.3s ease;
    min-height: 0;
    max-height: var(--drawer-resting-height);
    display: none; /* 默认隐藏，有物品时才显示 */
    overflow: hidden;
}

#items-collection-area.has-items {
    display: none !important;
}

#items-collection-area:hover {
    background: rgba(255, 250, 242, 0.86);
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(64, 39, 25, 0.22);
}

#items-collection-area.is-expanded {
    max-height: min(46vh, 330px);
    overflow-y: auto;
}

/* 收藏区域标题 */
.collection-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    padding-bottom: 0;
    border-bottom: 0;
    cursor: pointer;
}

.collection-title {
    font-size: 15px;
    font-weight: bold;
    color: #2d3436;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-count {
    font-size: 14px;
    color: #2d3436;
    background: rgba(255, 255, 255, 0.5);
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.collection-toggle-button {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(122, 82, 59, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.64);
    color: #7a523b;
    font-size: 16px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

#items-collection-area.is-expanded .collection-toggle-button {
    transform: rotate(180deg);
}

.collection-toggle-button:hover {
    background: rgba(255, 255, 255, 0.9);
}

/* 物品网格容器 */
.items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    justify-content: flex-start;
    align-items: center;
}

#items-collection-area:not(.is-expanded) #purchased-items-container {
    max-height: 38px;
    overflow: hidden;
}

#items-collection-area:not(.is-expanded) #purchased-items-container > p {
    display: none;
}

#items-collection-area:not(.is-expanded) #purchased-items-container h4 {
    display: none;
}

/* 已购买物品样式 */
.purchased-item-img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.6);
    padding: 6px;
    border: 2px solid rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
}

#items-collection-area:not(.is-expanded) .purchased-item-img,
#items-collection-area:not(.is-expanded) .item-slot.interacting {
    width: 58px;
    height: 38px;
    padding: 4px;
    border-radius: 10px;
}

.purchased-item-img:hover {
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(3px 3px 8px rgba(0, 0, 0, 0.3));
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(116, 185, 255, 0.8);
}

.purchased-item-img:active {
    transform: scale(1.05);
}

/* 背景激活状态样式 */
.purchased-item-img.active-background {
    border: 3px solid #FFD700 !important;
    background: rgba(255, 215, 0, 0.2) !important;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5) !important;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.7);
    }
}

/* 背景缩略图特殊样式 */
.background-thumbnail {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.background-thumbnail::after {
    content: '🖼️';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.background-thumbnail:hover::after {
    opacity: 1;
}

/* 互动状态的特殊样式 */
.item-slot.interacting {
    width: 75px;
    height: 75px;
    border: 2px solid rgba(253, 121, 168, 0.6);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fd79a8;
    font-size: 24px;
    background: rgba(253, 121, 168, 0.2);
    backdrop-filter: blur(5px);
    animation: pulse-glow 2s infinite;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.item-slot.interacting:hover {
    transform: scale(1.15) translateY(-2px);
    background: rgba(253, 121, 168, 0.3);
    border-color: rgba(253, 121, 168, 0.8);
    box-shadow: 0 0 15px rgba(253, 121, 168, 0.5);
}

.item-slot.interacting:hover::after {
    content: "点击恢复";
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
}

html[lang="en"] .item-slot.interacting:hover::after {
    content: "Click to restore";
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 0 5px rgba(253, 121, 168, 0.5);
        transform: scale(1);
    }
    50% { 
        box-shadow: 0 0 15px rgba(253, 121, 168, 0.8);
        transform: scale(1.05);
    }
}

/* 物品稀有度样式 */
.purchased-item-img.rarity-common {
    border-color: #95a5a6;
}

.purchased-item-img.rarity-rare {
    border-color: #3498db;
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.3);
}

.purchased-item-img.rarity-epic {
    border-color: #9b59b6;
    box-shadow: 0 0 8px rgba(155, 89, 182, 0.3);
}

.purchased-item-img.rarity-legendary {
    border-color: #f39c12;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.3);
}

/* 猫咪标题区域 */
#cat-title {
    position: absolute;
    top: 24px;
    left: 128px;
    transform: none;
    z-index: 75;
    background: rgba(255, 250, 242, 0.58);
    padding: 4px 10px;
    text-align: center;
    border-radius: 999px;
    border: 1px solid rgba(122, 82, 59, 0.14);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 18px rgba(90, 55, 32, 0.1);
}

#cat-name-display {
    color: #3f3029;
    font-size: 16px;
    margin: 0;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    transition: all 0.3s ease;
    max-width: min(24vw, 220px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#cat-name-display:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

#cat-name-display:hover::after {
    content: "✏️";
    margin-left: 8px;
    font-size: 16px;
    opacity: 0.7;
}

/* 名字编辑容器 */
.name-edit-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
    max-width: 300px;
}

#cat-name-edit {
    padding: 6px 10px;
    border: 2px solid #fab1a0;
    border-radius: 15px;
    font-size: 16px;
    font-family: inherit;
    width: 200px;
    text-align: center;
    outline: none;
}

#cat-name-edit:focus {
    border-color: #e17055;
    box-shadow: 0 0 0 2px rgba(225, 112, 85, 0.3);
}

#save-name-button {
    background-color: #fab1a0;
    border: none;
    border-radius: 15px;
    padding: 8px 15px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

#save-name-button:hover {
    background-color: #e17055;
    transform: scale(1.05);
}

/* 激励提示横幅 */
.encouragement-banner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    color: white;
    text-align: center;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    z-index: 1002;
    display: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border-radius: 0;
}

.encouragement-banner.show {
    display: block !important;
}

.encouragement-banner.pulse {
    animation: pulse 1.5s infinite;
}

.encouragement-banner span {
    font-size: 20px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

@keyframes pulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(0) scale(1.02); }
}

@keyframes bounce {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-10px) scale(1.05); }
}

.banner-content {
    max-width: 600px;
    margin: 0 auto;
}

/* 浮动状态面板 */
.countdown-display {
    position: absolute;
    top: clamp(68px, 8.8vh, 98px);
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    color: #7a523b;
    font-family: 'Comic Sans MS', 'Trebuchet MS', 'Arial Rounded MT Bold', system-ui, sans-serif;
    font-size: clamp(70px, 10vw, 122px);
    font-weight: 1000;
    line-height: 0.95;
    letter-spacing: 0;
    text-align: center;
    --countdown-bold-offset: clamp(1px, 0.12vw, 2px);
    -webkit-text-stroke-width: clamp(1px, 0.14vw, 2.5px);
    -webkit-text-stroke-color: #7a523b;
    paint-order: stroke fill;
    text-shadow:
        var(--countdown-bold-offset) 0 0 #7a523b,
        calc(-1 * var(--countdown-bold-offset)) 0 0 #7a523b,
        0 var(--countdown-bold-offset) 0 #7a523b,
        0 calc(-1 * var(--countdown-bold-offset)) 0 #7a523b,
        0 4px 0 rgba(255, 255, 255, 0.9),
        0 8px 18px rgba(65, 36, 20, 0.18);
    z-index: 35;
    pointer-events: none;
    white-space: nowrap;
}

.countdown-display.noise-hold {
    color: #d84f3f;
    -webkit-text-stroke-color: #d84f3f;
    text-shadow:
        var(--countdown-bold-offset) 0 0 #d84f3f,
        calc(-1 * var(--countdown-bold-offset)) 0 0 #d84f3f,
        0 var(--countdown-bold-offset) 0 #d84f3f,
        0 calc(-1 * var(--countdown-bold-offset)) 0 #d84f3f,
        0 4px 0 rgba(255, 255, 255, 0.95),
        0 10px 22px rgba(126, 45, 32, 0.22);
}

.noise-hold-message {
    position: absolute;
    left: 50%;
    bottom: calc(var(--cat-stage-lift) + clamp(210px, 20vw, 286px));
    transform: translate(-50%, 8px);
    z-index: 78;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: min(520px, calc(100% - 48px));
    min-height: 42px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(216, 79, 63, 0.34);
    background: rgba(255, 248, 242, 0.93);
    color: #c74433;
    box-shadow: 0 12px 28px rgba(126, 45, 32, 0.2);
    backdrop-filter: blur(12px);
    font-size: clamp(15px, 1.4vw, 20px);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
    text-align: center;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.noise-hold-message::before {
    content: "!";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-right: 8px;
    border-radius: 50%;
    background: #d84f3f;
    color: #fff7f0;
    font-size: 15px;
    line-height: 1;
}

.noise-hold-message.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (min-width: 769px) {
    .countdown-display {
        top: clamp(48px, 8vh, 76px);
        bottom: auto;
        font-size: clamp(132px, 11vw, 176px);
    }
}

.floating-status-panel {
    position: absolute;
    left: 50%;
    bottom: var(--control-rail-bottom);
    transform: translateX(-50%);
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(122, 82, 59, 0.18);
    border-radius: 999px;
    padding: 8px 10px 8px 16px;
    color: #4c382d;
    font-size: 13px;
    width: fit-content;
    min-width: 0;
    max-width: calc(100% - 32px);
    display: none; /* 默认隐藏 */
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 22px rgba(90, 55, 32, 0.16);
    z-index: 80;
}

.floating-status-panel.noise-hold {
    min-width: min(470px, calc(100% - 32px));
    padding: 10px 14px 10px 16px;
    background: rgba(255, 248, 242, 0.94);
    border-color: rgba(216, 79, 63, 0.42);
    box-shadow: 0 12px 28px rgba(126, 45, 32, 0.22);
}

.floating-status-panel.noise-hold #mode-icon {
    background: rgba(216, 79, 63, 0.12);
    border-color: rgba(216, 79, 63, 0.2);
}

.floating-status-panel.noise-hold #volume-status {
    color: #c74433 !important;
    font-weight: 800;
    letter-spacing: 0;
    max-width: none;
    white-space: nowrap;
}

.floating-status-panel:not(.noise-on) {
    padding: 8px 12px;
}

.floating-status-panel:not(.noise-on) .status-info {
    display: none;
}

.floating-status-panel:not(.noise-on) .status-controls {
    margin-left: 8px;
}

.floating-status-panel:not(.noise-on) #mode-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(122, 82, 59, 0.08);
    border: 1px solid rgba(122, 82, 59, 0.12);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: 0;
}

.status-controls {
    display: flex;
    gap: 6px;
    margin-left: 0;
}

.control-btn {
    width: 34px;
    height: 34px;
    background: rgba(122, 82, 59, 0.1);
    border: 1px solid rgba(122, 82, 59, 0.16);
    border-radius: 50%;
    padding: 0;
    color: #4c382d;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn:hover {
    background: rgba(122, 82, 59, 0.18);
    transform: scale(1.05);
}

.control-btn:active {
    transform: scale(0.95);
}

#mode-icon {
    font-size: 16px;
    line-height: 1;
}

#mode-title {
    font-weight: bold;
    font-size: 13px;
    white-space: nowrap;
}

.status-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4c382d;
    font-weight: 500;
    text-align: center;
    margin-left: 0;
    min-width: 0;
}

.status-info > div:first-child {
    display: flex;
    justify-content: center;
    align-items: center;
}

#volume-status {
    color: #4c382d;
    font-weight: 600;
    text-align: left;
    width: auto;
    white-space: nowrap;
}

.noise-meter {
    width: 84px;
    height: 8px;
    border-radius: 999px;
    background: rgba(122, 82, 59, 0.15);
    overflow: hidden;
    display: none;
}

.noise-meter-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: #4CAF50;
    transition: width 0.16s ease, background-color 0.16s ease;
}

.floating-status-panel.noise-on .noise-meter {
    display: flex;
}

.floating-status-panel.noise-on {
    min-width: min(420px, calc(100% - 32px));
}

.status-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-width: 0;
}

.status-label {
    font-size: 14px;
    font-weight: bold;
    color: #2d3436;
    min-width: 80px;
    text-align: left;
}

.status-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-progress progress {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    border: none;
    background: #e0e0e0;
}

.status-progress progress::-webkit-progress-bar {
    background-color: #e0e0e0;
    border-radius: 4px;
}

.status-progress progress::-webkit-progress-value {
    background: linear-gradient(90deg, #74b9ff, #0984e3);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.status-value {
    font-size: 14px;
    font-weight: bold;
    color: #2d3436;
    min-width: 60px;
    text-align: right;
}

/* 游戏内UI覆盖层 */
.game-ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 10;
}

/* 小鱼干计数器 */
.fish-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 25px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: auto;
    transition: all 0.3s ease;
    z-index: 60;
}

.fish-counter:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.fish-counter .fish-icon {
    width: 20px;
    height: 20px;
}

.fish-counter span {
    color: #2d3436;
    font-weight: bold;
    font-size: 16px;
}

/* 商店按钮 */
.shop-btn,
.closet-btn,
.music-btn {
    position: absolute;
    top: 20px;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(253, 121, 168, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: auto;
    z-index: 60;
    transition: all 0.3s ease;
}

.shop-btn {
    right: 20px;
    background: rgba(253, 121, 168, 0.9);
    box-shadow: 0 4px 15px rgba(253, 121, 168, 0.3);
}

.closet-btn {
    right: 80px;
    background: rgba(255, 250, 238, 0.96);
    border: 2px solid rgba(122, 82, 59, 0.18);
    box-shadow: 0 6px 18px rgba(90, 55, 32, 0.18);
}

.music-btn {
    right: 200px;
    background: rgba(255, 250, 238, 0.96);
    border: 2px solid rgba(122, 82, 59, 0.18);
    box-shadow: 0 6px 18px rgba(90, 55, 32, 0.18);
}

.shop-btn:hover,
.closet-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(253, 121, 168, 0.4);
}

.shop-btn:hover {
    background: rgba(253, 121, 168, 1);
}

.closet-btn:hover {
    background: white;
    box-shadow: 0 8px 22px rgba(90, 55, 32, 0.26);
}

.music-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 22px rgba(90, 55, 32, 0.26);
    background: white;
}

.music-btn.is-off {
    background: rgba(255, 250, 238, 0.98);
    border-color: rgba(122, 82, 59, 0.26);
}

.music-btn.is-on {
    background: rgba(255, 228, 132, 0.95);
    border-color: rgba(179, 124, 30, 0.28);
    box-shadow: 0 6px 20px rgba(179, 124, 30, 0.28);
}

.music-btn.is-disabled {
    cursor: not-allowed;
    opacity: 0.62;
    filter: grayscale(0.4);
}

.music-btn.is-disabled:hover {
    transform: none;
    background: rgba(255, 250, 238, 0.96);
    box-shadow: 0 4px 15px rgba(90, 55, 32, 0.14);
}

.shop-btn .shop-icon,
.closet-btn .closet-icon,
.music-btn .music-icon {
    color: white;
    font-size: 20px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.music-btn .music-icon {
    color: #4c382d;
    text-shadow: none;
}

.closet-btn .closet-icon {
    color: #4c382d;
    text-shadow: none;
}

.closet-badge {
    position: absolute;
    right: -4px;
    bottom: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #fd79a8;
    border: 2px solid rgba(255, 250, 242, 0.96);
    color: white;
    font-size: 12px;
    font-weight: 900;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(138, 61, 91, 0.28);
}

/* 进度条样式 */
progress {
    width: 200px;
    height: 20px;
    margin-right: 10px;
    border-radius: 10px;
    overflow: hidden;
}

progress::-webkit-progress-bar {
    background-color: #ddd;
    border-radius: 10px;
}

progress::-webkit-progress-value {
    background: linear-gradient(90deg, #00b894, #00cec9);
    border-radius: 10px;
    transition: width 0.3s ease;
}

#trust-value, #fish-treat-display {
    color: #2d3436;
    font-weight: bold;
}

/* 商店按钮 */
.shop-button {
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(253, 121, 168, 0.3);
}

.shop-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(253, 121, 168, 0.4);
}

/* 控制区 */
#controls {
    position: absolute;
    left: 50%;
    bottom: var(--control-rail-bottom);
    transform: translateX(-50%);
    z-index: 92;
    padding: 0;
    background: transparent;
    text-align: center;
    pointer-events: none;
}

/* 图片按钮 - 纯净样式 */
.image-button {
    min-width: 190px;
    min-height: 58px;
    background: rgba(255, 250, 242, 0.82);
    border: 1px solid rgba(122, 82, 59, 0.2);
    border-radius: 999px;
    padding: 10px 22px;
    margin: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 14px 32px rgba(90, 55, 32, 0.18);
    color: #4c382d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: inherit;
    pointer-events: auto;
    backdrop-filter: blur(14px);
}

.mode-button-icon {
    font-size: 24px;
    line-height: 1;
}

.mode-button-text {
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    color: #4c382d;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
    white-space: nowrap;
}

.image-button:hover {
    transform: scale(1.04);
    filter: brightness(1.05);
}

.image-button:active {
    transform: scale(0.98);
}

.image-button:disabled {
    display: none;
    opacity: 0;
    filter: grayscale(100%);
    cursor: not-allowed;
}

/* 状态条 */
#status-bar-container {
    margin-top: 20px;
    background: #ddd;
    height: 30px;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

#status-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #fd79a8, #e84393);
    border-radius: 15px;
    transition: width 0.5s ease;
    position: relative;
}

#status-bar-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: bold;
    color: #2d3436;
    z-index: 1;
}

/* 教师控制面板 */
#teacher-controls {
    background: #e17055;
    color: white;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-weight: bold;
}

#noise-threshold-slider {
    width: 200px;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

#noise-threshold-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#threshold-value {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 10px;
    min-width: 30px;
    text-align: center;
}

/* 警告覆盖层 */
#warning-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 80px;
    z-index: 50;
    animation: pulse 0.5s infinite alternate;
}

#warning-overlay.warning-level-1 {
    background: rgba(255, 193, 7, 0.4);
}

#warning-overlay.warning-level-2 {
    background: rgba(220, 53, 69, 0.5);
}

#warning-icon {
    width: 120px;
    height: 120px;
    filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.5));
    animation: bounce 0.6s infinite alternate;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.5));
}

@keyframes pulse {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* 弹窗样式 */
#setup-modal, #mic-permission-modal, #game-settings-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

#setup-modal {
    display: flex; /* 初始设置模态框需要显示 */
}

#setup-modal.visible, #mic-permission-modal.visible, 
#game-settings-modal.visible {
    display: flex;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.modal-content h2 {
    color: #2d3436;
    margin-bottom: 20px;
    font-size: 24px;
}

.modal-content p {
    color: #636e72;
    margin-bottom: 20px;
    font-size: 16px;
}

.setup-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 4px 0 10px;
    color: #7a523b;
    font-size: 13px;
    font-weight: 800;
}

.setup-flow span:not(.setup-flow-arrow) {
    background: #fff7e8;
    border: 1px solid rgba(225, 112, 85, 0.18);
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 3px 10px rgba(90, 55, 32, 0.06);
}

.setup-flow-arrow {
    color: #e17055;
    font-size: 15px;
}

.modal-content .setup-note {
    margin: 0 0 18px;
    color: #8a6a53;
    font-size: 13px;
    line-height: 1.35;
}

.modal-content input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.modal-content input:focus {
    outline: none;
    border-color: #74b9ff;
}

.modal-content button {
    background: linear-gradient(135deg, #00b894, #00cec9);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

/* 设置模态框特殊样式 */
.settings-modal-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
}

.settings-modal-content h2 {
    color: #2d3436;
    margin-bottom: 25px;
    font-size: 24px;
}

.settings-group {
    margin-bottom: 20px;
    text-align: left;
}

.settings-group label {
    display: block;
    font-weight: bold;
    color: #2d3436;
    margin-bottom: 8px;
    font-size: 16px;
}

.settings-group input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    cursor: pointer;
    margin-bottom: 10px;
}

.settings-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #74b9ff;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.settings-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
}

.settings-group input[type="number"]:focus {
    outline: none;
    border-color: #74b9ff;
}

.settings-value-display {
    display: inline-block;
    background: rgba(116, 185, 255, 0.1);
    color: #74b9ff;
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: bold;
    margin-left: 10px;
    min-width: 50px;
    text-align: center;
}

.settings-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.settings-buttons button {
    flex: 1;
    max-width: 120px;
}

.cancel-button {
    background: linear-gradient(135deg, #b2bec3, #636e72);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 110, 114, 0.3);
}

/* 商店右侧显示样式 */
#shop-modal,
#closet-panel {
    position: fixed;
    top: 20px;
    right: 180px;
    width: 380px;
    height: calc(100vh - 40px);
    display: none;
    z-index: 1000;
    transform: none;
    padding: 0;
    pointer-events: auto;
}

#shop-modal.visible,
#closet-panel.visible {
    display: block;
    animation: fadeIn 0.3s ease-out;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.shop-content,
.closet-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding: 0;
    background: white;
    border-radius: 20px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.4s ease-out;
    margin: 0;
    display: flex;
    flex-direction: column;
    border: none;
    pointer-events: auto;
}

@keyframes slideIn {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.shop-header,
.closet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, #fd79a8, #e84393);
    color: white;
    border-radius: 20px 20px 0 0; /* 上方两个角是圆角 */
    position: relative;
    overflow: hidden;
}

.shop-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    opacity: 0.5;
    pointer-events: none;
}

.shop-header h2 {
    margin: 0;
    color: white;
}

.closet-header {
    background: linear-gradient(135deg, #f6a6b7, #d88fca);
}

.closet-header h2 {
    margin: 0;
    color: white;
}

.close-button {
    background: rgba(255, 255, 255, 0.2);
    color: white !important;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none !important;
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-button:active {
    transform: scale(0.95);
}

/* 确保关闭按钮在最上层 */
#close-shop-button,
#close-closet-button {
    position: absolute;
    right: 15px;
    top: 15px;
    z-index: 9999;
    pointer-events: auto;
    cursor: pointer;
    display: block;
    text-align: center;
    line-height: 38px;
}

.shop-helper {
    margin: 0;
    padding: 13px 24px 12px;
    background: #fff7e8;
    color: #7a523b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    border-bottom: 1px solid rgba(225, 112, 85, 0.12);
}

.closet-helper {
    margin: 0;
    padding: 13px 24px 12px;
    background: #fff7e8;
    color: #7a523b;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    border-bottom: 1px solid rgba(225, 112, 85, 0.12);
}

.closet-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 14px 18px 10px;
    background: #fffaf1;
    border-bottom: 1px solid rgba(122, 82, 59, 0.12);
}

.closet-tab {
    border: 1px solid rgba(122, 82, 59, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    color: #7a523b;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    padding: 9px 12px;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.closet-tab:hover {
    transform: translateY(-1px);
    background: white;
}

.closet-tab.active {
    background: #fd79a8;
    color: white;
    border-color: rgba(232, 67, 147, 0.28);
    box-shadow: 0 6px 14px rgba(232, 67, 147, 0.2);
}

.closet-tabs .closet-tab.active,
.closet-tabs .closet-tab.active:hover,
.closet-tabs .closet-tab.active:focus-visible {
    background: linear-gradient(135deg, #fd79a8 0%, #f3689c 100%) !important;
    color: #ffffff !important;
    border-color: rgba(232, 67, 147, 0.32) !important;
    box-shadow: 0 8px 18px rgba(232, 67, 147, 0.22) !important;
}

.closet-tabs .closet-tab:not(.active),
.closet-tabs .closet-tab:not(.active):hover {
    background: rgba(255, 255, 255, 0.78) !important;
    color: #7a523b !important;
}

.closet-items-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    gap: 14px;
    padding: 18px;
    overflow-y: auto;
    background: #f8f9fa;
}

.closet-card {
    position: relative;
    align-self: start;
    min-height: 0;
    height: auto;
    border: 1px solid #e7ded7;
    border-radius: 16px;
    background: white;
    padding: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    cursor: pointer;
    text-align: center;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.closet-card:hover {
    transform: translateY(-2px);
    border-color: rgba(253, 121, 168, 0.52);
    box-shadow: 0 10px 22px rgba(80, 48, 32, 0.12);
}

.closet-card.active {
    background: linear-gradient(180deg, #fffdf8 0%, #fff8e8 100%);
    border-color: #ffd700;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.22), 0 10px 22px rgba(80, 48, 32, 0.12);
}

.closet-card.disabled {
    cursor: not-allowed;
    opacity: 0.62;
    filter: grayscale(0.25);
}

.closet-card.disabled:hover {
    transform: none;
    border-color: #e7ded7;
    box-shadow: none;
}

.closet-card.background-card {
    min-height: 176px;
}

.closet-card.outfit-card {
    min-height: 206px;
}

.closet-card-img {
    width: 118px;
    height: 118px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.14));
}

.closet-card.background-card .closet-card-img {
    width: 100%;
    height: 96px;
    object-fit: cover;
    border-radius: 12px;
}

.closet-card-title {
    width: 100%;
    color: #2d3436;
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.closet-card-meta {
    min-height: 20px;
    color: #7a523b;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
}

.closet-active-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: #ffd700;
    color: #6b482f;
    font-size: 14px;
    font-weight: 900;
    line-height: 24px;
    box-shadow: 0 3px 8px rgba(127, 91, 20, 0.24);
}

.closet-card.active .closet-active-mark {
    display: block;
}

.closet-empty {
    grid-column: 1 / -1;
    align-self: start;
    min-height: 170px;
    border: 1px dashed rgba(122, 82, 59, 0.24);
    border-radius: 16px;
    background: rgba(255, 250, 242, 0.72);
    color: #7a523b;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.shop-balance {
    padding: 15px 25px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: bold;
    color: #2d3436;
    border-bottom: 1px solid #eee;
    position: relative;
}

.shop-balance .icon {
    width: 28px;
    height: 28px;
    margin-right: 10px;
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
    animation: gentle-bounce 3s infinite ease-in-out;
}

@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* 移除底部渐变线 */

/* 商品网格 */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
    position: relative;
    z-index: 1;
    flex: 1;
    overflow-y: auto;
    pointer-events: auto;
    max-height: calc(100vh - 200px);
    width: 100%;
    box-sizing: border-box;
    margin: 0;
}

/* 分类标题样式 */
.category-header {
    width: 100%;
    margin: 20px 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid #f0c4d9;
    grid-column: 1 / -1; /* 跨越所有列 */
}

.category-header h3 {
    font-size: 18px;
    color: #8a5a83;
    margin: 0;
    padding: 0;
    font-weight: 600;
}

/* 移除背景渐变 */

/* 商品卡片 */
.shop-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: visible;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: auto;
    min-height: 260px;
    margin: 0;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    z-index: 1;
}

.shop-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border-color: #fd79a8;
}

.shop-item::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(253,121,168,0.1) 0%, rgba(253,121,168,0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.shop-item:hover::after {
    opacity: 1;
}

.shop-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin: 0 0 12px 0;
    filter: drop-shadow(2px 2px 5px rgba(0, 0, 0, 0.15));
    transition: all 0.4s ease;
    transform-origin: center center;
    flex-shrink: 0;
    display: block;
    border-radius: 0;
    background-color: transparent;
    padding: 0;
    box-shadow: none;
    border: none;
}

.shop-item:hover img {
    transform: scale(1.1);
    filter: drop-shadow(3px 3px 8px rgba(0, 0, 0, 0.2));
}

/* 内容区域容器 */
.shop-item .item-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    justify-content: flex-start;
    width: 100%;
    min-height: auto;
    padding: 0;
    position: relative;
    overflow: visible;
    gap: 8px;
    align-items: center;
    z-index: 2;
}

/* 价格和按钮容器 - 遵循JavaScript的横向布局 */
.shop-item .item-content > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-top: 16px;
    margin-bottom: 12px;
    flex-wrap: nowrap;
    gap: 12px;
    width: 100% !important;
    position: relative;
    padding: 0;
    min-height: 32px;
    flex-shrink: 0;
}

/* 确保按钮显示 */
.shop-item .buy-button {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
}

.shop-item h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    color: #2d3436;
    position: relative;
    display: block;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: transparent;
    padding: 0;
    border-radius: 0;
    font-weight: bold;
    text-align: center;
    line-height: 1.3;
}

.shop-item .item-description {
    margin: 0;
    font-size: 12px;
    color: #666;
    min-height: 30px;
    max-height: 30px;
    overflow: hidden;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    padding: 0;
    background-color: transparent;
    border-radius: 0;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}



/* 商品价格图标样式 */
.shop-item .price {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    margin: 0 !important;
    font-weight: bold;
    color: #e17055;
    font-size: 13px;
    background: rgba(225, 112, 85, 0.1);
    border-radius: 8px;
    padding: 4px 8px;
    width: fit-content !important;
    transition: all 0.3s ease;
    z-index: 2;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    gap: 4px;
    box-shadow: 0 1px 3px rgba(225, 112, 85, 0.15);
    border: 1px solid rgba(225, 112, 85, 0.2);
    flex-shrink: 0 !important;
}

.shop-item:hover .price {
    background: rgba(225, 112, 85, 0.15);
    transform: scale(1.05);
}

/* 商品图片样式 */
.shop-item-img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-bottom: 15px;
    visibility: visible !important; /* 确保图片可见 */
    opacity: 1 !important; /* 确保图片不透明 */
    z-index: 2;
    position: relative;
    border: 2px solid #fd79a8; /* 添加边框 */
    border-radius: 10px; /* 添加圆角 */
    background-color: white; /* 添加背景色 */
    padding: 5px; /* 添加内边距 */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* 添加阴影 */
}

.shop-item .price .icon {
    width: 16px;
    height: 16px;
    margin-right: 0;
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1));
    animation: spin 10s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 购买按钮 */
.buy-button {
    background: linear-gradient(135deg, #fd79a8, #e84393) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    width: auto !important;
    max-width: none !important;
    position: relative !important;
    overflow: visible !important;
    z-index: 3 !important;
    margin: 0 !important;
    pointer-events: auto !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    box-shadow: 0 2px 6px rgba(232, 67, 147, 0.2) !important;
    min-width: 60px !important;
    text-align: center !important;
    white-space: nowrap !important;
    height: 28px !important;
    letter-spacing: 0.1px !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
}

.shop-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    min-height: 306px !important;
    padding: 14px !important;
    text-align: center !important;
    overflow: hidden !important;
}

.shop-item > .shop-item-img {
    width: 86px !important;
    height: 86px !important;
    margin: 0 0 6px 0 !important;
    align-self: center !important;
    justify-self: center !important;
    flex-shrink: 0 !important;
}

.shop-item-type {
    align-self: flex-start;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(253, 121, 168, 0.12);
    border: 1px solid rgba(253, 121, 168, 0.22);
    color: #9f3f65;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}

.shop-item.shop-item-outfit > .shop-item-img {
    width: 126px !important;
    height: 126px !important;
    margin: 0 0 4px 0 !important;
}

.shop-item.shop-item-background > .shop-item-img {
    width: 100% !important;
    height: 96px !important;
    object-fit: cover !important;
    border-radius: 12px !important;
    border: 2px solid rgba(253, 121, 168, 0.26) !important;
    background: #fff7ee !important;
    padding: 0 !important;
}

.shop-item.shop-item-background .shop-item-type {
    background: rgba(116, 185, 255, 0.13);
    border-color: rgba(116, 185, 255, 0.26);
    color: #25698f;
}

.shop-item .item-content {
    display: grid !important;
    grid-template-rows: 72px 34px !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
    height: 112px !important;
    flex: 0 0 112px !important;
    overflow: visible !important;
}

.shop-item .item-content > div:first-child {
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    max-height: 72px !important;
}

.shop-item h3 {
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    text-align: center !important;
    font-size: 15px !important;
    line-height: 1.2 !important;
    margin-bottom: 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    max-height: 38px !important;
}

.shop-item .item-description {
    text-align: center !important;
    min-height: 0 !important;
    max-height: 34px !important;
    font-size: 12px !important;
    line-height: 1.25 !important;
    width: 100% !important;
}

.shop-item .item-content > div:last-child {
    margin-top: 8px !important;
    margin-bottom: 0 !important;
    gap: 8px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 32px !important;
    height: 32px !important;
    overflow: visible !important;
    flex-shrink: 0 !important;
    position: static !important;
    z-index: 5 !important;
}

.buy-button {
    min-width: 74px !important;
    max-width: 92px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.buy-button:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(232, 67, 147, 0.3) !important;
}

.buy-button:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 5px rgba(232, 67, 147, 0.2) !important;
}

.buy-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.7s ease;
    z-index: -1;
}

.buy-button:hover::before {
    left: 100%;
}

.buy-button:disabled {
    background: linear-gradient(135deg, #b2bec3, #7f8c8d) !important;
    color: #dfe6e9 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
    opacity: 0.85 !important;
    border: 1px solid #dfe6e9 !important;
    display: flex !important;
    visibility: visible !important;
}

.buy-button.owned {
    background: linear-gradient(135deg, #6c757d, #495057) !important;
    color: #f1f2f6 !important;
    border: 1px solid #ced6e0 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.buy-button.owned:hover {
    background: linear-gradient(135deg, #6c757d, #495057) !important;
    transform: none !important;
    box-shadow: none !important;
}

.buy-button.insufficient {
    background: linear-gradient(135deg, #b2bec3, #7f8c8d) !important;
    color: #dfe6e9 !important;
    display: flex !important;
    visibility: visible !important;
    opacity: 0.9 !important;
}

.buy-button.slot-full {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7) !important;
    color: #f1f2f6 !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 0.85 !important;
}

/* 强制确保所有按钮都显示 */
button.buy-button,
.buy-button,
.shop-item button,
.shop-item .buy-button {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 999 !important;
    pointer-events: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 28px !important;
    min-width: 0 !important;
    background: linear-gradient(135deg, #fd79a8, #e84393) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    padding: 6px 8px !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    text-align: center !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
}

/* 确保按钮容器有足够空间 */
.shop-item .item-content {
    min-height: 112px !important;
    height: 112px !important;
    flex: 0 0 112px !important;
}



/* 余额不足按钮样式 */
.buy-button.insufficient {
    background: linear-gradient(135deg, #b2bec3, #7f8c8d); /* 灰色渐变背景 */
    color: #dfe6e9; /* 更浅的文字颜色 */
    opacity: 0.9 !important;
    border: 1px solid #dfe6e9;
}

/* 槽位已满按钮样式 */
.buy-button.slot-full {
    background: linear-gradient(135deg, #a29bfe, #6c5ce7); /* 紫色渐变 */
    color: #f1f2f6;
    opacity: 0.85 !important;
    border: 1px solid #dfe6e9;
}

/* Final shop card action row guard: keep price and button inside every card. */
.shop-item .item-content {
    display: grid !important;
    grid-template-rows: 72px 34px !important;
    min-height: 112px !important;
    height: 112px !important;
    flex: 0 0 112px !important;
    overflow: visible !important;
}

.shop-item .item-content > div:last-child {
    display: grid !important;
    grid-template-columns: 64px minmax(0, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    align-items: center !important;
    justify-content: stretch !important;
    overflow: visible !important;
}

.shop-item .price {
    width: 64px !important;
    max-width: 64px !important;
    justify-content: center !important;
    align-self: center !important;
}

.shop-item .buy-button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    align-self: center !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}



.shop-item.rarity-legendary {
    border-color: #f39c12;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.15);
    background: linear-gradient(to bottom right, white, rgba(243, 156, 18, 0.05));
    animation: legendary-glow 3s infinite alternate;
}

/* 空商店提示样式 */
.empty-shop-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    color: #636e72;
}

.empty-shop-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: bounce 2s infinite alternate;
}

.empty-shop-message p {
    margin: 5px 0;
    font-size: 16px;
}

@keyframes legendary-glow {
    0% { box-shadow: 0 5px 15px rgba(243, 156, 18, 0.15); }
    100% { box-shadow: 0 5px 20px rgba(243, 156, 18, 0.4); }
}

.item-rarity {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: bold;
}

.item-description {
    font-size: 12px;
    color: #666;
    margin: 0 0 10px 0;
    line-height: 1.3;
    max-height: 32px; /* 限制描述高度为2行 */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 限制为2行 */
    -webkit-box-orient: vertical;
    visibility: visible !important; /* 确保描述可见 */
    opacity: 1 !important; /* 确保描述不透明 */
    width: 90%; /* 控制宽度 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    #items-collection-area {
        margin: 10px 15px 0;
        padding: 12px 15px;
    }
    
    .items-grid {
        gap: 8px;
    }
    
    .purchased-item-img, .item-slot.interacting {
        width: 60px;
        height: 60px;
    }
    
    .collection-title {
        font-size: 14px;
    }
    
    .collection-count {
        font-size: 12px;
        padding: 3px 6px;
    }
    
    /* 移动端商店样式调整 */
    #shop-modal {
        width: 90%;
        max-width: 350px;
        right: 5%;
    }

    #closet-panel {
        width: 90%;
        max-width: 350px;
        right: 5%;
    }

    body.shop-open #game-container,
    body.closet-open #game-container {
        max-width: none;
        width: calc(100vw - 20px);
        margin-right: 0;
    }

    body.shop-open #shop-modal,
    body.closet-open #closet-panel {
        top: 12px;
        right: 12px;
        width: calc(100vw - 24px);
        max-width: none;
        height: calc(100svh - 24px);
    }

    .shop-btn,
    .closet-btn,
    .settings-btn,
    .music-btn {
        width: 44px;
        height: 44px;
        top: 14px;
    }

    .shop-btn {
        right: 14px;
    }

    .closet-btn {
        right: 66px;
    }

    .settings-btn {
        right: 118px;
    }

    .music-btn {
        right: 170px;
    }

    .closet-items-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 14px;
    }

    .closet-card {
        min-height: 170px;
    }
    
    .shop-header {
        padding: 12px 15px;
    }
    
    .shop-balance {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    .shop-grid {
        gap: 12px;
        padding: 15px;
        grid-template-columns: 1fr;
    }
    
    .shop-item {
        padding: 12px;
        min-height: 245px;
        max-height: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
        position: relative;
        overflow: hidden;
    }
    
    .shop-item img {
        width: 86px;
        height: 86px;
        flex-shrink: 0;
        margin: 0 0 6px 0;
    }
    
    .shop-item .item-content {
        padding: 0;
        min-height: 112px;
        height: 112px;
        max-height: 112px;
        display: grid;
        grid-template-rows: 72px 34px;
        justify-content: stretch;
        flex: 0 0 112px;
        gap: 6px;
        width: 100%;
    }
    
    .shop-item h3 {
        font-size: 15px;
        margin: 0 0 4px 0;
        padding: 0;
        white-space: normal;
        overflow: hidden;
        text-overflow: clip;
        text-align: center;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    
    .shop-item .item-description {
        font-size: 12px;
        -webkit-line-clamp: 2;
        margin: 0;
        min-height: 22px;
        max-height: 34px;
        text-align: center;
    }

    .shop-item .item-content > div:last-child {
        display: grid !important;
        grid-template-columns: 64px minmax(0, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
        height: 32px !important;
        min-height: 32px !important;
        align-items: center !important;
        justify-content: stretch !important;
        margin: 8px 0 0 0 !important;
        overflow: visible !important;
    }
    
    .shop-item .price {
        font-size: 12px;
        padding: 3px 8px;
        margin: 0;
        align-self: center;
        width: 64px !important;
        max-width: 64px !important;
        justify-content: center !important;
    }
    
    .buy-button {
        min-width: 0;
        font-size: 11px;
        padding: 6px 8px;
        height: 28px;
        width: 100%;
        max-width: 100%;
        align-self: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        overflow: auto;
    }

    #game-container {
        --cat-stage-lift: clamp(190px, 28vh, 250px);
        --control-rail-bottom: clamp(116px, 17vh, 150px);
        --drawer-resting-height: 78px;
        --drawer-bottom: 12px;
        margin: 10px;
        width: calc(100vw - 20px);
        height: calc(100svh - 20px);
        min-height: 560px;
        border-radius: 16px;
    }
    
    #main-scene {
        height: 100%;
        background-position: center 82%;
    }

    .countdown-display {
        top: 76px;
        bottom: auto;
        font-size: clamp(48px, 14vw, 68px);
    }

    .noise-hold-message {
        top: 154px;
        bottom: auto;
        max-width: calc(100% - 32px);
        min-height: 36px;
        padding: 7px 13px;
        font-size: 14px;
    }

    #cat-title {
        top: 18px;
        left: 104px;
        max-width: calc(100% - 220px);
    }

    #cat-name-display {
        font-size: 15px;
        max-width: 100%;
    }

    .floating-status-panel {
        bottom: var(--control-rail-bottom);
        width: fit-content;
        min-width: 0;
        max-width: calc(100% - 20px);
        border-radius: 16px;
        padding: 8px 10px;
    }

    .status-header {
        gap: 6px;
    }

    .status-info {
        margin-left: 4px;
    }

    #volume-status {
        max-width: 170px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .noise-meter {
        width: 58px;
    }

    .floating-status-panel.noise-on {
        min-width: min(330px, calc(100% - 20px));
    }

    .floating-status-panel.noise-hold {
        min-width: min(350px, calc(100% - 20px));
        padding: 8px 10px;
    }

    .floating-status-panel.noise-hold #volume-status {
        max-width: min(220px, 54vw);
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #items-collection-area {
        left: 12px;
        right: 12px;
        bottom: var(--drawer-bottom);
        margin: 0;
        padding: 8px 10px;
        max-height: var(--drawer-resting-height);
    }

    #items-collection-area.is-expanded {
        max-height: min(50vh, 300px);
    }

    #controls {
        bottom: var(--control-rail-bottom);
    }
    
    #cat-image {
        width: min(92vw, 455px);
        height: auto;
        max-height: 305px;
    }

    .cat-companion-shadow {
        bottom: calc(var(--cat-stage-lift) - 8px);
        width: 260px;
        height: 40px;
    }

    .cup-steam {
        width: 92px;
        height: 112px;
    }

    .image-button {
        min-width: 180px;
        min-height: 62px;
        margin: 0 5px;
        padding: 10px 20px;
    }
    
    .mode-button-icon {
        font-size: 28px;
    }

    .mode-button-text {
        font-size: 24px;
    }
    
    #hud {
        padding: 10px 15px;
    }
    
    .hud-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    progress {
        width: 100%;
    }
}

/* 动画效果 */
.bounce {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 60%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    80% { transform: translateY(-5px); }
}

.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 设置模态框优化样式 */
.settings-content {
    background: white;
    padding: 0;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 420px;
    width: 85%;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
}

.settings-header {
    background: #4ECDC4;
    color: white;
    padding: 15px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.settings-header h2 {
    margin: 0;
    color: white;
    font-size: 20px;
}

.settings-section {
    padding: 15px 18px;
    border-bottom: 1px solid #eee;
}

.settings-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.time-btn, .volume-btn {
    background: #f1f1f1;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    min-width: 70px;
    max-width: 100px;
}

.time-btn:hover, .volume-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.time-btn.active, .volume-btn.active {
    background: #4ECDC4;
    color: white;
    box-shadow: 0 4px 10px rgba(78, 205, 196, 0.3);
}

.custom-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.custom-time input {
    width: 70px;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
}

.custom-time input:focus {
    outline: none;
    border-color: #4ECDC4;
}

.volume-presets {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.noise-monitor-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
    color: #2d3436;
    font-weight: 700;
}

.noise-monitor-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #4ECDC4;
}

.privacy-note {
    margin: 0 0 12px;
    color: #636e72;
    font-size: 13px;
    line-height: 1.5;
    text-align: center;
}

.mic-permission-status {
    margin: -4px auto 12px;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    color: #636e72;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    text-align: center;
    max-width: 360px;
}

.mic-permission-status.requesting {
    background: rgba(253, 203, 110, 0.2);
    color: #b46b00;
}

.mic-permission-status.ready {
    background: rgba(46, 204, 113, 0.16);
    color: #16834a;
}

.mic-permission-status.blocked {
    background: rgba(255, 118, 117, 0.16);
    color: #c0392b;
}

.volume-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.volume-slider input[type="range"] {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    cursor: pointer;
}

.volume-slider input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4ECDC4;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-slider span {
    background: rgba(78, 205, 196, 0.1);
    color: #4ECDC4;
    padding: 4px 12px;
    border-radius: 15px;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

.calibration-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 0;
}

.calibration-info {
    font-size: 16px;
    color: #555;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

#current-volume {
    font-weight: bold;
    color: #333;
    background: rgba(78, 205, 196, 0.15);
    padding: 4px 12px;
    border-radius: 12px;
    min-width: 35px;
    text-align: center;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.volume-hint {
    font-size: 14px;
    color: #888;
    margin-left: 5px;
}

.settings-actions {
    display: flex;
    justify-content: space-between;
    padding: 15px 18px;
    background: #f9f9f9;
    position: sticky;
    bottom: 0;
}

.cancel-btn {
    background: #ddd;
    color: #555;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    margin-right: 8px;
}

.cancel-btn:hover {
    background: #ccc;
}

.start-btn {
    background: #4ECDC4;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 2;
}

.start-btn:hover {
    background: #3dbdb5;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(78, 205, 196, 0.3);
}

/* 奖励信息弹窗 */
.reward-info {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    text-align: center;
    min-width: 300px;
    animation: popIn 0.5s ease-out forwards;
}

.reward-info h3 {
    color: #2d3436;
    font-size: 24px;
    margin-bottom: 15px;
}

.reward-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.reward-details p {
    font-size: 18px;
    color: #636e72;
    margin: 5px 0;
}

.total-reward {
    font-size: 22px !important;
    font-weight: bold;
    color: #e17055 !important;
    margin-top: 10px !important;
}

.close-reward-btn {
    background: linear-gradient(135deg, #4ECDC4, #556270);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 10px 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.close-reward-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

.close-reward-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@keyframes popIn {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

/* 设置按钮样式 */
.settings-btn {
    position: absolute;
    top: 20px;
    right: 140px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    pointer-events: auto;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: white;
}

.settings-icon {
    font-size: 24px;
    color: #2d3436;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

/* 游戏设置弹窗样式 */
#game-config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 1001; /* 比游戏UI高 */
    backdrop-filter: blur(5px);
}

.config-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #4ECDC4, #556270);
    color: white;
    border-radius: 20px 20px 0 0;
}

.config-header h2 {
    margin: 0;
    font-size: 24px;
}

.config-section {
    padding: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.config-section:last-of-type {
    border-bottom: none;
}

.config-section h3 {
    margin: 0 0 20px 0;
    color: #2d3436;
    font-size: 18px;
}

/* 奖励设置样式 */
.reward-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.reward-item:hover {
    border-color: #4ECDC4;
    background: #f0fdfc;
}

.reward-item label {
    flex: 1;
    font-weight: bold;
    color: #2d3436;
}

.reward-item input[type="number"] {
    width: 80px;
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.reward-item input[type="number"]:focus {
    outline: none;
    border-color: #4ECDC4;
    box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.1);
}

.reward-note {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4fd;
    border-left: 4px solid #3498db;
    border-radius: 0 8px 8px 0;
    font-size: 14px;
    color: #2c3e50;
    line-height: 1.4;
}

/* 数据管理样式 */
.data-management {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.current-fish {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px;
    background: #fff3cd;
    border: 2px solid #ffeaa7;
    border-radius: 12px;
    font-size: 16px;
    font-weight: bold;
    color: #856404;
}

.danger-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.danger-btn:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.clear-note {
    font-size: 14px;
    color: #e74c3c;
    background: #fdf2f2;
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid #e74c3c;
    margin: 0;
}

/* 设置操作按钮 */
.config-actions {
    display: flex;
    gap: 15px;
    padding: 20px 25px;
    background: #f8f9fa;
    border-radius: 0 0 20px 20px;
}

.config-actions .cancel-btn {
    flex: 1;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.config-actions .cancel-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.save-btn {
    flex: 2;
    background: linear-gradient(135deg, #4ECDC4, #3dbdb5);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(78, 205, 196, 0.3);
}

.save-btn:hover {
    background: linear-gradient(135deg, #3dbdb5, #2ea89a);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 205, 196, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .config-content {
        width: 95%;
        margin: 10px;
    }
    
    .reward-item {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .reward-item input[type="number"] {
        width: 100%;
        max-width: 120px;
        margin: 0 auto;
    }
    
    .config-actions {
        flex-direction: column;
    }
}
