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

body {
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    background: #1a1a2e;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.background-container {
    position: relative;
    display: inline-block;
    line-height: 0;
    user-select: none;
}

.background-image {
    display: block;
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.main-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 340px;
    background: rgba(238, 230, 250, 0.95);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 10;
    overflow: hidden;
}

.main-window.visible {
    opacity: 1;
}

.main-window.fading-out {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.title-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(238, 230, 250, 0.9);
}

.title-text {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}

.close-btn {
    background: rgba(238, 230, 250, 0.9);
    border: none;
    color: #555;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(221, 214, 243, 0.9);
}

.content-area {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.greeting-text {
    text-align: center;
    color: #8A2BE2;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.6;
    padding: 20px;
    background: rgba(248, 240, 255, 0.8);
    border: 2px solid #ddd;
    border-radius: 6px;
    width: 100%;
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.btn {
    font-family: "Microsoft YaHei", sans-serif;
    font-size: 14px;
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #DDD6F3;
    color: #4B0082;
}

.btn-primary:hover {
    background: #C8BFDC;
}

.btn-secondary {
    background: #CE93D8;
    color: #4B0082;
}

.btn-secondary:hover {
    background: #B87DC4;
}

.wishes-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.wish-popup {
    position: absolute;
    width: 180px;
    max-width: 180px;
    background: rgba(255, 248, 250, 0.95);
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    overflow: hidden;
    z-index: 5;
}

.wish-popup.visible {
    opacity: 0.92;
    transform: scale(1);
}

.wish-popup .wish-text {
    color: #4B0082;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 10px;
    word-break: break-all;
}

.wish-popup .wish-btn {
    display: block;
    margin: 0 auto;
    background: #DDD6F3;
    color: #4B0082;
    border: 1px solid #ccc;
    padding: 4px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-family: "Microsoft YaHei", sans-serif;
    cursor: pointer;
    transition: background 0.2s;
}

.wish-popup .wish-btn:hover {
    background: #C8BFDC;
}

.wish-popup .wish-image {
    width: 100%;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.close-all-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.5s, transform 0.2s;
    pointer-events: none;
}

.close-all-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.close-all-btn:hover {
    transform: scale(1.1);
}

.heart-icon {
    width: 60px;
    height: 60px;
}

.close-all-text {
    position: absolute;
    color: #4B0082;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

.restart-btn {
    position: absolute;
    top: 20px;
    right: 90px;
    width: 60px;
    height: 60px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.5s, transform 0.2s;
    pointer-events: none;
}

.restart-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.restart-btn:hover {
    transform: scale(1.1);
}

.restart-icon {
    width: 60px;
    height: 60px;
}

.restart-text {
    position: absolute;
    color: #4B0082;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

.footer-notice {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    pointer-events: none;
}

.footer-notice span {
    display: inline-block;
    font-size: 12px;
    color: #4B0082;
    background: rgba(255, 248, 250, 0.85);
    padding: 5px 14px;
    border-radius: 14px;
    border: 1px solid rgba(206, 147, 216, 0.5);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    white-space: nowrap;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

@media (max-width: 768px) {
    .main-window {
        width: 280px;
    }
    
    .greeting-text {
        font-size: 15px;
    }
    
    .wish-popup {
        width: 140px;
    }
    
    .wish-popup .wish-text {
        font-size: 11px;
    }
}