/* 重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #f5f5dc; /* 米白色背景 */
    color: #333;
    line-height: 1.6;
    padding-bottom: 40px;
    min-height: 100vh;
}

/* 容器样式 */
.container, .containers {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部渐变背景 */
.top-bg {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%); /* 红色渐变 */
    color: white;
    padding: 20px 0 40px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* 主标题样式 */
.main-title {
    font-size: 2.2rem;
    text-align: center;
    font-weight: 700;
    margin: 10px 0;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

/* 活动标语 */
.slogan {
    font-size: 1.5rem;
    text-align: center;
    margin: 10px 0 20px;
    font-weight: 500;
    opacity: 0.9;
}

/* 卡片网格布局 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 15px;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 3px solid #D4AF37; /* 金色边框 */
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 确保内容在卡片内均匀分布 */
}

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

/* 卡片图片样式 - 电脑端 */
.card-img {
    width: 100%;
    height:100%;
    object-fit: cover;
    display: block;
    border-bottom: 2px solid #f0f0f0;
}

/* 卡片文本样式 - 电脑端 */
.card-text {
    padding: 10px 5px;
    text-align: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #333;
    background-color: #fff;
    display: flex;
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
    min-height: 40px; /* 确保文字区域高度一致 */
}

/* 抽奖区域样式 - 所有内容居中 */
.draw-section {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    margin: 30px auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    border-top: 5px solid #D4AF37;
    text-align: center; /* 整体文字居中 */
}

.draw-section h2 {
    color: #d32f2f;
    margin-bottom: 20px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center; /* 标题居中 */
    gap: 10px;
}

.draw-section h2 i {
    color: #D4AF37;
}

/* 输入组样式 - 居中对齐 */
.input-group {
    display: flex;
    flex-direction: row;
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.input-group input {
    flex: 0 1 auto; /* 不拉伸，根据内容自动调整 */
    min-width: 200px;
    max-width: 300px;
    padding: 14px 18px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    text-align: center; /* 输入框文字居中 */
}

.input-group input:focus {
    border-color: #D4AF37;
    outline: none;
}

.input-group input::placeholder {
    text-align: center; /* 占位符文字居中 */
    color: #999;
}

.draw-btn {
    background: linear-gradient(to right, #d32f2f, #b71c1c);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 14px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center; /* 按钮文字居中 */
    gap: 8px;
}

.draw-btn:hover {
    background: linear-gradient(to right, #b71c1c, #9a0007);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(183, 28, 28, 0.3);
}

.hint {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center; /* 提示文字居中 */
}

/* 抽奖结果样式 */
.result-container {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    border: 2px dashed #ddd;
}

.result-content h3 {
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center; /* 结果标题居中 */
    gap: 10px;
    font-size: 1.3rem;
}

#userInfo, #drawTime {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
    text-align: center; /* 用户信息和时间居中 */
}

.prize-display {
    min-height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    background-color: white;
    border-radius: 8px;
    padding: 20px;
}

.placeholder {
    text-align: center;
    color: #888;
}

.placeholder i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #e0e0e0;
}

/* 活动规则样式 */
.rules-section {
    background-color: white;
    border-radius: 15px;
    padding: 25px;
    margin: 30px auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    max-width: 800px;
    border-top: 5px solid #D4AF37;
    text-align: center; /* 规则区域整体文字居中 */
}

.rules-section h2 {
    color: #d32f2f;
    margin-bottom: 20px;
    font-size: 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center; /* 规则标题居中 */
    gap: 10px;
}

.rules-section h2 i {
    color: #D4AF37;
}

.rules-list {
    list-style-type: none;
    padding-left: 0; /* 移除左边距 */
    text-align: left; /* 规则列表文字左对齐 */
    display: inline-block; /* 使列表内容可以居中 */
    margin: 0 auto; /* 列表居中 */
}

.rules-list li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
    color: #444;
}

.rules-list li:before {
    content: "•";
    color: #D4AF37;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -5px;
}
.query-btn {
  background-color: #ff3333;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;          /* 防止按钮被压缩 */
}
.query-btn:hover {
  background-color: #ff0000;
  box-shadow: 0 2px 4px rgba(255, 51, 51, 0.3);
}
.query-btn:active {
  background-color: #cc0000;
  transform: scale(0.98);
}
/* 加载动画 */
.loading-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;
}

.loading-content {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #D4AF37;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
/* 已抽取提示 - 红色背景 */
.result-message.red-bg {
  background-color: #f8d7da; /* 浅红色背景 */
  border: 1px solid #f5c6cb; /* 红色边框 */
  border-radius: 8px;
  padding: 15px;
  margin: 15px 0;
  text-align: center;
}

.result-message.red-bg p {
  color: #721c24; /* 深红色文字 */
  margin-bottom: 8px;
  font-weight: 500;
}

.result-message.red-bg p:first-child {
  font-weight: 600;
  font-size: 1.05rem;
}

.result-message.red-bg .hint {
  color: #721c24; /* 深红色提示文字 */
  font-size: 0.9rem;
  opacity: 0.9;
  margin-bottom: 0;
}

/* 通知消息 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #333;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: none;
    z-index: 1000;
    max-width: 300px;
    text-align: center; /* 通知消息文字居中 */
}

/* 响应式设计 - 移动端保持6列布局 */

/* 移动端紧凑布局 */
@media (max-width: 768px) {
    /* 调整卡片网格间距 - 更紧凑 */
    .card-grid {
        gap: 4px;
        margin-bottom: 8px;
    }
    
    /* 调整卡片图片尺寸 - 更矮 */
    .card-img {
        height: 68px; /* 减少高度 */
        object-fit: cover; /* 保持图片完整显示 */
    }
    
    /* 调整卡片文字大小和样式 - 更紧凑 */
    .card-text {
        padding: 4px 2px; /* 减少内边距 */
        font-size: 0.7rem;
        min-height: 28px; /* 固定最小高度 */
        display: flex;
        align-items: center; /* 垂直居中 */
        justify-content: center; /* 水平居中 */
        line-height: 1.2; /* 减少行高 */
    }
    
    /* 调整卡片边框粗细 */
    .card {
        border: 2px solid #D4AF37;
        border-radius: 6px; /* 稍微减少圆角 */
    }
    
    /* 调整主标题大小 */
    .main-title {
        font-size: 1.5rem;
        margin: 8px 0; /* 减少上下间距 */
    }
    
    .slogan {
        font-size: 1.1rem;
        margin: 8px 0 15px; /* 减少上下间距 */
    }
    
    /* 调整抽奖区域和规则区域 */
    .draw-section, .rules-section {
        padding: 18px 15px;
        margin: 20px auto;
    }
    
    .draw-section h2, .rules-section h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    /* 移动端输入组垂直排列并居中 */
    .input-group {
        flex-direction: column;
        gap: 8px; /* 减少间距 */
        align-items: center; /* 居中 */
    }
    
    .input-group input {
        min-width: 100%;
        max-width: 100%;
        padding: 12px 15px; /* 减少内边距 */
        text-align: center; /* 输入框文字居中 */
    }
    
    .draw-btn {
        padding: 12px 20px; /* 减少内边距 */
        width: 100%; /* 按钮宽度100% */
        max-width: 300px; /* 最大宽度限制 */
        justify-content: center; /* 按钮文字居中 */
    }
    
    .hint {
        font-size: 0.85rem;
        margin-bottom: 15px;
        text-align: center; /* 提示文字居中 */
    }
    
    /* 规则列表在移动端左对齐但容器居中 */
    .rules-list {
        text-align: left;
        display: block;
    }
}

/* 小屏幕手机调整 */
@media (max-width: 480px) {
    /* 进一步缩小卡片尺寸 */
    .card-img {
        height: 60px; /* 进一步减少高度 */
    }
    
    .card-text {
        font-size: 0.65rem;
        padding: 3px 2px; /* 进一步减少内边距 */
        min-height: 24px; /* 进一步减少高度 */
    }
    
    .card {
        border: 1.5px solid #D4AF37;
    }
    
    .main-title {
        font-size: 1.3rem;
        margin: 6px 0;
    }
    
    .slogan {
        font-size: 1rem;
        margin: 6px 0 12px;
    }
    
    .draw-section h2, .rules-section h2 {
        font-size: 1.2rem;
    }
    
    /* 调整网格间距，更紧凑 */
    .card-grid {
        gap: 3px;
    }
    
    /* 移动端输入框和按钮调整 */
    .input-group input {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
    
    .draw-btn {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
}

/* 确保在电脑端保持6列 */
@media (min-width: 769px) {
    .card-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}