body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    font-family: Arial, sans-serif;
}

/* 背景图片样式 */
.background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('bg.jpg'); /* 替换为你的背景图片链接 */
    background-repeat: repeat; /* 背景图片平铺 */
    background-size: auto; /* 背景图片大小不变 */
}

/* Logo 图片样式 */
.logo {
    position: absolute;
    top: 50px; /* 距离顶部 50px */
    left: 50%;
    transform: translateX(-50%); /* 左右居中 */
    z-index: 1;
}

.logo img {
    width: 250px; /* 设置 Logo 的宽度为 250px */
    height: auto; /* 高度自适应 */
}

.center {
    position: absolute;
    top: 60%; /* 整体往下移动 */
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

/* 通用按钮样式 */
button {
    padding: 12px 24px;
    font-size: 18px;
    margin: 20px;
    cursor: pointer;
    border: none;
    border-radius: 5px;
    color: white;
    background: linear-gradient(135deg, #FF8C00, #FFA500);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    width: 200px; /* 所有按钮宽度一致 */
    display: block;
    text-align: center;
    text-decoration: none; /* 去掉下划线 */
    z-index: 2; /* 确保按钮在弹幕上方 */
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* 万能导航按钮样式 */
#wndhBtn {
    background: linear-gradient(135deg, #007BFF, #0056b3); /* 蓝色渐变 */
}

#fastResult {
    font-size: 36px; /* 字体大小调整 */
    color: #FF8C00;
    margin-bottom: 30px; /* 往下移动一点，更靠近按钮 */
    font-weight: bold;
    position: absolute;
    top: -60px; /* 调整位置，更靠近按钮 */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 1; /* 确保食物名称在弹幕上方 */
}

/* 骰子容器样式 */
#diceContainer {
    position: absolute;
    top: -150px; /* 调整位置，避免与食物名称重叠 */
    left: 50%;
    transform: translateX(-50%);
    perspective: 1000px; /* 3D 透视效果 */
    z-index: 1; /* 确保骰子在弹幕上方 */
}

.dice {
    width: 50px; /* 默认骰子体积 */
    height: 50px;
    position: relative;
    transform-style: preserve-3d; /* 保持 3D 效果 */
    transform: rotateX(0deg) rotateY(0deg);
    transition: transform 1s ease-out;
}

/* 骰子的每个面 */
.face {
    position: absolute;
    width: 50px; /* 默认骰子体积 */
    height: 50px;
    background: white;
    border: 2px solid #FF8C00; /* 边框颜色优化 */
    border-radius: 8px; /* 圆角调整 */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px; /* 字体大小调整 */
    font-weight: bold;
    color: #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    background: #f0f0f0; /* 背景色优化 */
}

/* 骰子的 6 个面 */
.front  { transform: translateZ(25px); }
.back   { transform: rotateY(180deg) translateZ(25px); }
.right  { transform: rotateY(90deg) translateZ(25px); }
.left   { transform: rotateY(-90deg) translateZ(25px); }
.top    { transform: rotateX(90deg) translateZ(25px); }
.bottom { transform: rotateX(-90deg) translateZ(25px); }

/* 骰子旋转动画 */
@keyframes rollDice {
    0%   { transform: rotateX(0deg) rotateY(0deg); }
    100% { transform: rotateX(720deg) rotateY(720deg); }
}

.rolling {
    animation: rollDice 1s linear infinite;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 3; /* 弹窗在最上层 */
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px; /* 调整内边距 */
    border-radius: 15px;
    text-align: center;
    width: 400px; /* 默认宽度 */
    max-height: 80vh; /* 限制弹窗最大高度 */
    overflow-y: auto; /* 启用垂直滚动条 */
    overflow-x: hidden; /* 禁用水平滚动条 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* 移动端样式 */
@media (max-width: 768px) {
    .modal-content {
        width: 80vw; /* 移动端宽度为屏幕宽度的 80% */
        max-height: 80vh; /* 高度自适应 */
        padding: 15px; /* 调整内边距 */
    }

    textarea {
        max-height: 50vh; /* 限制输入框最大高度 */
    }

    .modal-content h2 {
        font-size: 20px; /* 调整标题字体大小 */
    }

    .modal-content .tip {
        font-size: 12px; /* 调整提示文字大小 */
    }

    textarea {
        font-size: 14px; /* 调整输入框字体大小 */
    }

    #confirmBtn {
        font-size: 14px; /* 调整按钮字体大小 */
        padding: 8px 16px; /* 调整按钮内边距 */
    }

    /* 移动端骰子体积缩小 */
    .dice {
        width: 40px; /* 移动端骰子体积 */
        height: 40px;
    }

    .face {
        width: 40px; /* 移动端骰子体积 */
        height: 40px;
        font-size: 14px; /* 字体大小调整 */
    }

    /* 调整骰子位置，避免与 Logo 重叠 */
    #diceContainer {
        top: -120px; /* 调整骰子位置 */
    }
}

/* 弹窗标题样式 */
.modal-content h2 {
    margin: 0 0 10px 0; /* 重置 h2 的默认 margin */
    font-size: 24px;
    color: #333;
    text-align: center;
}

/* 弹窗提示文字样式 */
.modal-content .tip {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px; /* 减少提示与输入框的间距 */
    text-align: center;
}

/* 输入框样式 */
textarea {
    width: calc(100% - 20px); /* 减去 padding，确保不超出弹窗宽度 */
    min-height: 100px; /* 设置最小高度 */
    max-height: 40vh; /* 限制输入框最大高度 */
    margin-bottom: 20px; /* 增加输入框与按钮的间距 */
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    resize: vertical; /* 允许垂直调整高度 */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: auto; /* 内容超出时显示滚动条 */
    display: block;
    margin: 0 auto; /* 输入框左右居中对齐 */
    outline: none;
}

textarea:focus {
    border-color: #FF8C00;
}

/* 确定按钮样式 */
#confirmBtn {
    background: linear-gradient(135deg, #FF8C00, #FFA500);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s ease;
    width: 100%;
    display: block;
    margin: 0 auto; /* 按钮左右居中对齐 */
    margin-top: 10px; /* 增加按钮与输入框的间距 */
}

#confirmBtn:hover {
    background: linear-gradient(135deg, #FFA500, #FF8C00);
}

/* 食物弹幕样式 */
.food-item {
    position: absolute;
    color: #888;
    font-weight: bold;
    white-space: nowrap;
    user-select: none;
    z-index: 0; /* 确保食物弹幕在按钮下方 */
}

@keyframes moveLeft {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}