/* 重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: "Microsoft YaHei", sans-serif;
}

/* 背景图设置 */
#background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('背景图.jpg');
    background-size: cover;
    background-position: center;
    z-index: -1;
    filter: brightness(0.8);
}

/* UI 头部 */
#ui-header {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    pointer-events: none; /* 默认穿透 */
}

.stats-group {
    display: flex;
    gap: 10px;
}

.info-box {
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 16px;
    font-weight: bold;
    color: #5a4a75;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Logo 按钮特殊处理 */
#logo-btn {
    pointer-events: auto; /* 允许点击 */
    cursor: pointer;
    transition: transform 0.1s;
    padding-right: 12px;
}

#logo-btn:active {
    transform: scale(0.95);
}

.mini-logo {
    height: 24px;
    margin-right: 6px;
}

/* 蝴蝶样式 */
.butterfly {
    position: absolute;
    width: 80px;
    height: 80px;
    cursor: pointer;
    z-index: 50;
    touch-action: manipulation;
    /* 移除CSS transition，完全由JS控制 opacity 以配合反比例函数 */
}

/* 通用弹窗背景 */
#modal-overlay, #pause-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
    backdrop-filter: blur(3px); /* 背景模糊提升质感 */
}

.hidden {
    display: none !important;
}

/* 弹窗内容框 */
.modal-content, .menu-content {
    background: white;
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    width: 85%;
    max-width: 360px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 菜单特定样式 */
.menu-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.menu-section p {
    color: #5a4a75;
    font-weight: bold;
    margin-bottom: 10px;
}

.tip-text {
    font-size: 12px;
    color: #999 !important;
    margin-top: 8px;
    font-weight: normal !important;
}

.difficulty-options {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.diff-btn {
    background: #f0f0f0;
    border: 2px solid transparent;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
}

.diff-btn.active {
    background: #e6e1ff;
    border-color: #7b68ee;
    color: #7b68ee;
    font-weight: bold;
}

.menu-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 按钮样式 */
button {
    font-family: inherit;
    border: none;
    outline: none;
}

.primary-btn {
    background: #7b68ee;
    color: white;
    padding: 12px 40px;
    border-radius: 25px;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
}

.action-btn {
    background: #7b68ee;
    color: white;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    width: 100%;
}

.action-btn.secondary {
    background: #f0f0f0;
    color: #555;
}

.action-btn.warning {
    background: #ffb3b3;
    color: #d63031;
}

/* Toast 提示 */
#toast {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    z-index: 300;
    font-size: 14px;
}

@keyframes popIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
