/* 基础重置 */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #ffc90e; /* 主背景色：黄色 */
    text-align: center;
}
#app {
    padding-bottom: 50px;
}

/* 头部样式 */
.header {
    background-color: #c90000; /* 顶部背景色：红色 */
    border-radius: 0 0 50% 50%; /* 模拟圆形背景 */
    padding: 30px 0 10px;
    margin-bottom: 20px;
    position: relative;
    z-index: 10;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}
.title {
    font-size: 40px;
    color: #ffc90e; /* 标题字色：黄色 */
    text-shadow: 3px 3px 0 #920000, 5px 5px 0 #000;
    margin: 0;
    line-height: 1;
}
.subtitle {
    font-size: 18px;
    color: white;
    margin: 5px 0 0;
}

/* 导航样式 */
.tabs {
    display: flex;
    justify-content: center;
    position: relative;
    top: -15px; /* 向上移动，覆盖在红色背景上 */
}
.tab {
    background-color: #5d0000;
    color: #ffc90e;
    padding: 8px 20px;
    margin: 0 10px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5);
}
.tab:last-child {
    background-color: #920000; /* "我的奖品"用不同的红色 */
    color: white;
}

/* 抽奖容器 */
.lottery-container {
    width: 90%;
    max-width: 400px;
    margin: 0 auto;
    background-color: #c90000; /* 主体背景色：红色 */
    padding: 20px 10px;
    border-radius: 15px;
    border: 5px solid #ffde00; /* 外边框黄色 */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

/* 参与人数 */
.participant-count {
    color: white;
    font-size: 16px;
    margin-bottom: 15px;
}
.participant-count span {
    font-size: 20px;
    font-weight: bold;
    color: #ffde00;
}

/* 九宫格布局 */
.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 5px;
    background-color: #920000; /* 九宫格内深红色背景 */
    border-radius: 10px;
}

.grid-item {
    background-color: white;
    border: 2px solid #ffde00; /* 格子边框：黄色 */
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px; /* 统一格子高度 */
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.grid-item img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

/* 抽奖按钮样式 */
.draw-button {
    background-color: #ff4500; /* 橙色 */
    color: white;
    font-size: 20px;
    font-weight: bold;
    border-color: #ffde00;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: pulse 1.5s infinite; /* 模拟按钮闪烁 */
}
.draw-button .start-text {
    background-color: #c90000;
    padding: 5px 10px;
    border-radius: 5px;
    margin-top: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* 选中高亮效果（抽奖时的跑马灯） */
.grid-item.active {
    border-color: #c90000; /* 选中边框：深红 */
    box-shadow: 0 0 10px 3px #fff, 0 0 15px 5px #ffde00; /* 闪烁效果 */
    transform: scale(1.05);
    transition: all 0.1s;
}

/* 额外奖品展示区 */
.extra-prizes {
    display: flex;
    justify-content: space-around;
    padding: 15px 0 0;
}
.prize-item {
    background-color: white;
    border-radius: 5px;
    overflow: hidden;
    /*width: 23%;*/
    padding: 5px;
}
.prize-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* 中奖名单区域 */
.winner-list-container {
    width: 90%;
    max-width: 400px;
    margin: 20px auto 0;
    padding: 15px 10px;
    background-color: #fff9e6; /* 浅黄色背景 */
    border-radius: 10px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}
.list-title {
    color: #c90000;
    font-size: 16px;
    margin: 0 0 10px;
}
.winner-scroller {
    height: 30px;
    line-height: 30px;
    overflow: hidden;
    color: #555;
    font-size: 14px;
}
.winner-item {
    transition: transform 0.5s ease-out;
    white-space: nowrap;
}

/* 动画：按钮闪烁 */
@keyframes pulse {
    0% { background-color: #ff4500; }
    50% { background-color: #ff7f50; }
    100% { background-color: #ff4500; }
}


/* ======================== 奖品跑马灯区域样式 ======================== */
.prize-showcase-container {
    width: 90%;
    max-width: 400px;
    margin: 20px auto 0;
    padding: 15px 10px;
    background-color: #fff9e6; /* 浅黄色背景 */
    border-radius: 10px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
    overflow: hidden; /* 隐藏超出容器的跑马灯内容 */
}

.showcase-title {
    color: #c90000;
    font-size: 16px;
    margin: 0 0 10px;
}

.prize-marquee-scroller {
    width: 100%;
    overflow: hidden; /* 裁剪跑马灯内容 */
    white-space: nowrap; /* 确保奖品项不换行 */
    height: 120px; /* 根据奖品图片和文字高度设置 */
}

.marquee-content-wrap {
    display: inline-flex; /* 允许内部元素在一行显示 */
    animation: marquee-scroll 15s linear infinite; /* 跑马灯动画 */
}

/* 跑马灯中的单个奖品项 */
.marquee-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 15px; /* 奖品间的间距 */
    transition: none; /* 禁用可能继承的过渡效果 */
}

.prize-img {
    width: 60px;
    height: 60px;
    border-radius: 50%; /* 圆形图片 */
    object-fit: cover;
    border: 3px solid #ffde00;
}

.prize-name {
    margin-top: 5px;
    font-size: 12px;
    color: #555;
}

/* 跑马灯动画定义 */
@keyframes marquee-scroll {
    0% {
        transform: translateX(0%); /* 初始位置 */
    }
    100% {
        /* 向左滚动 50%，因为内容复制了一份，滚动一半就完成了无缝衔接 */
        transform: translateX(-50%);
    }
}

/* ======================== 弹出层基础样式 ======================== */

/* 遮罩层：覆盖整个屏幕 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* 半透明黑色背景 */
    display: none; /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* 确保在其他元素之上 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* 弹出层内容容器 */
.modal-content {
    background-color: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transform: translateY(-50px); /* 初始位置略微向上，用于动画 */
    transition: transform 0.3s ease;
    max-height: 80vh; /* 限制最大高度 */
    overflow-y: auto; /* 内容过多时可滚动 */
}

/* 弹出层显示时的状态 */
.modal-overlay.active {
    display: flex; /* 使用 flex 实现居中 */
    opacity: 1;
}
.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* 头部样式 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background-color: #f7f7f7;
    border-radius: 10px 10px 0 0;
}
.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #c90000;
}

/* 关闭按钮 */
.close-button {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 0;
}

/* 内容体样式 */
.modal-body {
    padding: 20px;
    text-align: left;
    color: #555;
}
.modal-body h4 {
    color: #920000;
    margin-top: 15px;
    margin-bottom: 5px;
    font-size: 16px;
}
.modal-body p {
    margin-top: 5px;
    line-height: 1.6;
}

/* 抽奖码输入框和按钮样式 */
.code-input {
    width: calc(100% - 20px);
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
}

.submit-button {
    width: 100%;
    padding: 12px;
    background-color: #c90000; /* 与主色调保持一致 */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.submit-button:hover {
    background-color: #920000;
}

.error-message {
    color: #ff4500;
    margin-top: 10px;
    font-size: 14px;
}




/* 抽奖高亮效果 */
.grid-item.highlight {
    background-color: #ffda6a; /* 醒目的高亮颜色 */
    border: 3px solid #ff4500; /* 边框强调 */
    transform: scale(1.05);
    transition: all 0.1s;
}

/* 抽奖进行时，禁用按钮 */
.draw-button.disabled {
    pointer-events: none;
    opacity: 0.5;
}



/* 强制元素按顺时针路径占据位置 */
.grid-item[data-index="0"] { grid-area: 1 / 1 / 2 / 2; } /* 0: Top Left (行/列/行结束/列结束) */
.grid-item[data-index="1"] { grid-area: 1 / 2 / 2 / 3; } /* 1: Top Middle */
.grid-item[data-index="2"] { grid-area: 1 / 3 / 2 / 4; } /* 2: Top Right */
.grid-item[data-index="3"] { grid-area: 2 / 3 / 3 / 4; } /* 3: Middle Right */
.grid-item[data-index="4"] { grid-area: 3 / 3 / 4 / 4; } /* 4: Bottom Right */
.grid-item[data-index="5"] { grid-area: 3 / 2 / 4 / 3; } /* 5: Bottom Middle */
.grid-item[data-index="6"] { grid-area: 3 / 1 / 4 / 2; } /* 6: Bottom Left */
.grid-item[data-index="7"] { grid-area: 2 / 1 / 3 / 2; } /* 7: Middle Left */

/* 抽奖按钮固定在中心 */
#draw-button {
    grid-area: 2 / 2 / 3 / 3;
}

/* 确保动画高亮样式存在 */
.grid-item.highlight {
    background-color: #ffda6a;
    border: 3px solid #ff4500;
    transition: all 0.1s;
}