* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: white;
    font-size: 42px;
    margin-bottom: 5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}

/* 主要内容区域 */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

/* 房间卡片 */
.room-card {
    background: white;
    border-radius: 25px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.room-container {
    position: relative;
    width: 100%;
}

.room-background {
    position: relative;
    width: 100%;
    height: 450px;
    background: linear-gradient(180deg, #e0f2fe 0%, #f0f9ff 50%, #d4a574 100%);
    border-radius: 15px;
    overflow: hidden;
}

/* 墙壁装饰 */
.wall-decoration {
    position: absolute;
    top: 20px;
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 30px;
}

.wall-item {
    font-size: 45px;
}

.window-item {
    position: relative;
    width: 80px;
    height: 80px;
}

.window-frame {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #87ceeb 0%, #b0e0e6 100%);
    border: 6px solid #8b4513;
    border-radius: 10px;
    position: relative;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.5);
}

.window-frame::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    background: #8b4513;
    transform: translateY(-50%);
}

.window-frame::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #8b4513;
    transform: translateX(-50%);
}

.window-light {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: windowShine 3s ease-in-out infinite;
}

@keyframes windowShine {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.clock {
    font-size: 40px;
}

/* 左侧家具 */
.furniture-left {
    position: absolute;
    left: 30px;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bookshelf {
    font-size: 55px;
}

.plant {
    font-size: 45px;
    animation: plantSway 4s ease-in-out infinite;
}

@keyframes plantSway {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

/* 右侧家具 */
.furniture-right {
    position: absolute;
    right: 30px;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.lamp {
    font-size: 45px;
    animation: lampGlow 2s ease-in-out infinite;
}

@keyframes lampGlow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

.table {
    font-size: 55px;
}

/* 地毯区域 */
.carpet-area {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 200px;
}

.carpet {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #d2691e 0%, #cd853f 50%, #d2691e 100%);
    border-radius: 20px;
    border: 8px solid #8b4513;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
}

.carpet::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    border: 3px solid rgba(139, 69, 19, 0.3);
    border-radius: 10px;
}

/* 地毯上的玩具 */
.carpet-toys {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.toy {
    position: absolute;
    font-size: 30px;
}

.toy:nth-child(1) {
    top: 20px;
    left: 15%;
    animation: toyRoll 5s ease-in-out infinite;
}

.toy:nth-child(2) {
    bottom: 20px;
    right: 15%;
    animation: toyBounce 3s ease-in-out infinite;
}

@keyframes toyRoll {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(360deg); }
}

@keyframes toyBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 宠物 */
.pet-character {
    position: absolute;
    bottom: 50px;
    left: 30%;
    cursor: pointer;
    transition: all 0.3s;
}

.pet-character:hover {
    transform: scale(1.15);
}

.pet-character:hover .interact-hint {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.interact-hint {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 5px 12px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s;
    margin-bottom: 5px;
    pointer-events: none;
}

.pet-emoji {
    font-size: 80px;
    animation: petBreath 3s ease-in-out infinite;
}

@keyframes petBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pet-bubble {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 8px 15px;
    border-radius: 15px;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.pet-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: white;
}

.pet-bubble.hidden {
    display: none;
}

/* 柏皓 */
.owner-character {
    position: absolute;
    bottom: 50px;
    right: 30%;
    cursor: pointer;
    text-align: center;
    transition: left 2s ease-in-out, right 2s ease-in-out;
}

.owner-character:hover .interact-hint {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}

.owner-name {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-top: 5px;
}

/* 火柴人样式 */
.stickman {
    position: relative;
    width: 60px;
    height: 100px;
    margin: 0 auto;
}

.stickman-head {
    position: absolute;
    width: 24px;
    height: 24px;
    border: 3px solid #333;
    border-radius: 50%;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: #ffd4a3;
}

.stickman-body {
    position: absolute;
    width: 3px;
    height: 35px;
    background: #333;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.stickman-arm {
    position: absolute;
    width: 3px;
    height: 25px;
    background: #333;
    top: 28px;
    transform-origin: top center;
}

.stickman-arm-left {
    left: calc(50% - 15px);
    transform: rotate(-30deg);
}

.stickman-arm-right {
    left: calc(50% + 12px);
    transform: rotate(30deg);
}

.stickman-leg {
    position: absolute;
    width: 3px;
    height: 35px;
    background: #333;
    top: 59px;
    transform-origin: top center;
}

.stickman-leg-left {
    left: calc(50% - 8px);
}

.stickman-leg-right {
    left: calc(50% + 5px);
}

/* 火柴人走路动画 */
.stickman.walking .stickman-arm-left {
    animation: armSwingLeft 0.6s ease-in-out infinite;
}

.stickman.walking .stickman-arm-right {
    animation: armSwingRight 0.6s ease-in-out infinite;
}

.stickman.walking .stickman-leg-left {
    animation: legSwingLeft 0.6s ease-in-out infinite;
}

.stickman.walking .stickman-leg-right {
    animation: legSwingRight 0.6s ease-in-out infinite;
}

@keyframes armSwingLeft {
    0%, 100% { transform: rotate(-30deg); }
    50% { transform: rotate(20deg); }
}

@keyframes armSwingRight {
    0%, 100% { transform: rotate(30deg); }
    50% { transform: rotate(-20deg); }
}

@keyframes legSwingLeft {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(30deg); }
}

@keyframes legSwingRight {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(-30deg); }
}

/* 火柴人站立时的呼吸动画 */
.stickman:not(.walking) {
    animation: stickmanIdle 3s ease-in-out infinite;
}

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

/* 资产显示 */
.assets-display {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.asset-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.asset-item:last-child {
    margin-bottom: 0;
}

.asset-icon {
    font-size: 24px;
}

.asset-value {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    min-width: 40px;
}

/* 功能小卡片 */
.function-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.mini-card {
    background: white;
    border: none;
    border-radius: 15px;
    padding: 25px 20px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.mini-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.mini-icon {
    font-size: 50px;
    margin-bottom: 10px;
}

.mini-label {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

/* 兑换按钮 */
.exchange-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #48bb78, #38a169);
    border: none;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(72, 187, 120, 0.3);
    transition: all 0.3s;
}

.exchange-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

.exchange-btn:disabled {
    background: linear-gradient(135deg, #cbd5e0, #a0aec0);
    cursor: not-allowed;
    box-shadow: none;
}

.exchange-icon {
    font-size: 20px;
}

/* 弹窗 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 25px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-content h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.exchange-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
    font-size: 32px;
}

.exchange-info {
    background: #f7fafc;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.exchange-info p {
    margin-bottom: 10px;
    color: #666;
    font-size: 16px;
}

.exchange-info span {
    font-weight: bold;
    color: #667eea;
}

.exchange-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.exchange-input label {
    font-weight: bold;
    color: #333;
}

.exchange-input input {
    flex: 1;
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
}

.btn-max {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
}

.button-group {
    display: flex;
    gap: 10px;
}

.btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 15px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: #e2e8f0;
    color: #333;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #48bb78;
    color: white;
    padding: 15px 30px;
    border-radius: 25px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    font-size: 16px;
    animation: slideDown 0.3s ease;
}

.toast.hidden {
    display: none;
}

.toast.error {
    background: #f56565;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}


/* 生日卡片特殊样式 */
.birthday-card {
    background: linear-gradient(135deg, #ff6b9d 0%, #feca57 50%, #48dbfb 100%);
    animation: birthdayGlow 2s ease-in-out infinite;
}

@keyframes birthdayGlow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(255, 107, 157, 0.8);
        transform: scale(1.05);
    }
}

.birthday-card .mini-icon {
    animation: birthdayBounce 1s ease-in-out infinite;
}

@keyframes birthdayBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(10deg); }
}
