body {
    font-family: Arial, sans-serif;
    text-align: center;
    background-color: #f4f4f4;
    margin: 0;
    padding: 0;
}

.secret-click-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
    z-index: 1;
}

.container {
    max-width: 500px;
    margin: 50px auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

h1 {
    color: #333;
}

.settings {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    z-index: 1000;
}

/* 针对iPad等平板设备的紧凑布局 */
@media (min-width: 768px) and (max-width: 1024px) {
    .settings {
        width: 70%;
        max-width: 600px;
        padding: 20px;
    }
}

.settings.show {
    display: block;
}

.settings table {
    width: 100%;
    display: block;
    max-height: 45vh;
    overflow-y: auto;
    overflow-x: hidden;
    margin: 15px 0;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

/* 设置面板分组样式 */
.settings-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.settings-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.section-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background-color: #007bff;
    margin-right: 10px;
    border-radius: 2px;
}

/* 针对iPad等平板设备的紧凑布局 */
@media (min-width: 768px) and (max-width: 1024px) {
    .settings-section {
        margin-bottom: 18px;
        padding-bottom: 12px;
    }
    
    .section-title {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .section-title::before {
        height: 16px;
        width: 3px;
    }
}

.floating-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    border-radius: 50px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.floating-button:hover {
    background-color: #0056b3;
}

h3 {
    margin-bottom: 10px;
}

table {
    border-collapse: collapse;
    margin-top: 10px;
    background: #fff;
}

th, td {
    border: 1px solid #e0e0e0;
    padding: 12px 8px;
    text-align: center;
    white-space: nowrap;
}

td:nth-child(1), th:nth-child(1) {
    width: 65%;
}

td:nth-child(2), th:nth-child(2) {
    width: 25%;
}

td:nth-child(3), th:nth-child(3) {
    width: 10%;
}

th {
    background-color: #f8f9fa;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
    color: #495057;
    font-size: 14px;
}

td input {
    width: 90%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    vertical-align: middle;
    height: 36px;
    box-sizing: border-box;
}

/* 确保表格单元格垂直居中对齐 */
td {
    vertical-align: middle;
}

.removePrize {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 6px 10px;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s ease;
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

.removePrize:hover {
    background-color: #c82333;
    transform: scale(1.05);
}

/* 表格行悬停效果 */
#prizeTable tbody tr:hover {
    background-color: #f8f9fa;
}

.status {
    margin-top: 20px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    padding: 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.prize-container {
    white-space: nowrap;
    padding: 5px;
    max-width: 100%;
    font-size: 14px;
    color: #666;
}

#prizeList {
    display: inline-block;
    padding: 0;
    margin: 0;
    font-size: large;
}

#prizeList li {
    display: inline-block;
    margin: 0 10px;
    padding: 5px 10px;
    background: #ffeb3b;
    border-radius: 5px;
}

button {
    background-color: #ff5722;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    margin-top: 10px;
    transition: all 0.2s ease;
}

button:hover {
    background-color: #e64a19;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(0);
}

#result {
    font-size: 24px;
    font-weight: bold;
    color: #d32f2f;
    margin-top: 20px;
}

.result-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    animation: popup 0.3s ease-out;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: none;
}

.prize-image {
    max-width: 150px;
    max-height: 150px;
    margin-bottom: 15px;
    object-fit: contain;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.popup-content {
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #d32f2f;
}

.close-container {
    text-align: center;
    margin-top: 20px;
}

.close-btn {
    background-color: #ff5722;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: #e64a19;
}

@keyframes popup {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

#drawButton {
    font-size: 20px;
    font-weight: bold;
    padding: 15px 30px;
}

.close-settings {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #6c757d;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

.close-settings:hover {
    background: #5a6268;
    transform: rotate(90deg);
}

input[type="number"], input[type="text"] {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    margin: 5px 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="number"]:focus, input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.settings label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 14px;
}

.settings input[type="number"] {
    margin-bottom: 15px;
}

.input-container {
    margin-bottom: 15px;
}

.input-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.total-people-container {
    margin-bottom: 15px;
}

.settings label {
    flex: 0 0 80px;
    margin-bottom: 0;
    text-align: right;
}

.settings input[type="number"], .settings input[type="text"] {
    flex: 1;
    margin-bottom: 0;
}

/* 移动设备布局调整 */
@media (max-width: 767px) {
    .input-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .settings label {
        flex: none;
        margin-bottom: 5px;
        text-align: left;
    }
    
    .settings input[type="number"], .settings input[type="text"] {
        flex: none;
        width: 100%;
        margin-bottom: 10px;
    }
}

/* 紧凑布局 - 针对iPad等平板设备优化 */
@media (min-width: 768px) and (max-width: 1024px) {
    .input-row {
        gap: 10px;
    }
    
    .settings label {
        flex: 0 0 80px;
    }
    
    .input-container {
        margin-bottom: 10px;
    }
    
    .total-people-container {
        margin-bottom: 10px;
    }
    
    .settings-section {
        margin-bottom: 20px;
        padding-bottom: 15px;
    }
    
    .section-title {
        margin-bottom: 10px;
    }
}

/* 大屏幕布局 */
@media (min-width: 1025px) {
    .settings label {
        flex: 0 0 100px;
    }
}

/* 按钮组样式 */
.button-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.button-group button {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.button-group button:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* 针对iPad等平板设备的紧凑布局 */
@media (min-width: 768px) and (max-width: 1024px) {
    .button-group {
        gap: 8px;
        margin-top: 15px;
    }
    
    .button-group button {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 100px;
    }
}

.button-primary {
    background-color: #007bff;
}

.button-primary:hover {
    background-color: #0056b3;
}

.button-secondary {
    background-color: #6c757d;
}

.button-secondary:hover {
    background-color: #5a6268;
}

.button-danger {
    background-color: #dc3545;
}

.button-danger:hover {
    background-color: #c82333;
}

.button-success {
    background-color: #28a745;
}

.button-success:hover {
    background-color: #218838;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .settings {
        width: 95%;
        max-height: 90vh;
        padding: 20px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group button {
        width: 100%;
        min-width: auto;
    }
    
    th, td {
        padding: 8px 4px;
        font-size: 12px;
    }
    
    .section-title {
        font-size: 16px;
    }
    
    input[type="number"], input[type="text"] {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* 滚动条样式 */
.settings::-webkit-scrollbar {
    width: 6px;
}

.settings::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.settings::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.settings::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#prizeTable::-webkit-scrollbar {
    width: 6px;
}

#prizeTable::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#prizeTable::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

#prizeTable::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}
.loading-spinner {
    width: 200px;
    height: 200px;
    margin-bottom: 10px;
}
.loading-text {
    color: white;
    font-size: 18px;
    font-weight: bold;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.customization-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 2000;
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
