* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FFD700;
    --secondary-color: #FF6B6B;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 30, 0.8);
    --bg-card-hover: rgba(30, 30, 45, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;
    --border-color: rgba(255, 215, 0, 0.3);
    --glow-gold: 0 0 30px rgba(255, 215, 0, 0.5);
    --glow-red: 0 0 30px rgba(255, 107, 107, 0.5);
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 15s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;  /* 移除最大宽度限制 */
    margin: 0;
    padding: 20px;
    padding-left: calc(20px + env(safe-area-inset-left, 0px));
    padding-right: calc(20px + env(safe-area-inset-right, 0px));
}

.header {
    text-align: center;
    padding: 40px 0;
    margin-bottom: 30px;
    position: relative;
}

.logo-area {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.company-logo {
    height: 60px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.company-logo {
    display: block;
    height: 60px;
    width: auto;
    max-width: 200px;
    border-radius: 8px;
}

.logo-area.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 60px;
    background: linear-gradient(135deg, #333 0%, #222 100%);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    text-align: center;
}

.title {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.title-year {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 60px rgba(255, 215, 0, 0.5);
}

.title-text {
    color: var(--text-primary);
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    letter-spacing: 8px;
    text-transform: uppercase;
}

.section-title {
    font-size: 2rem;
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
}

.prizes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.prize-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.prize-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    transition: left 0.5s;
}

.prize-card:hover::before {
    left: 100%;
}

.prize-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--primary-color);
    box-shadow: var(--glow-gold);
}

.prize-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.prize-name {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.prize-count {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.prize-reward {
    font-size: 1.1rem;
    color: var(--text-primary);
    padding: 10px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
}

.prize-status {
    margin-top: 15px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    display: inline-block;
}

.prize-status.available {
    background: rgba(0, 255, 100, 0.2);
    color: #00ff64;
}

.prize-status.completed {
    background: rgba(255, 100, 100, 0.2);
    color: #ff6464;
}

.lottery-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lottery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.back-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.back-btn:hover {
    border-color: var(--primary-color);
    background: rgba(255, 215, 0, 0.1);
}

.lottery-title {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.lottery-info {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

.lottery-info strong {
    color: var(--primary-color);
    font-size: 1.5rem;
}

.lottery-stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.rolling-display {
    width: 100%;
    max-width: 800px;
    height: 180px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.9), rgba(30, 30, 45, 0.9));
    border: 3px solid var(--border-color);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 60px rgba(255, 215, 0, 0.1);
}

.rolling-display::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #FFD700, #FF6B6B, #FFD700);
    border-radius: 30px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s;
}

.rolling-display.rolling::before {
    opacity: 0.5;
    animation: borderGlow 2s linear infinite;
}

@keyframes borderGlow {
    0%, 100% { filter: hue-rotate(0deg); }
    50% { filter: hue-rotate(30deg); }
}

.slot-machine {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.slot-machine::before,
.slot-machine::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 60px;
    z-index: 10;
    pointer-events: none;
}

.slot-machine::before {
    top: 0;
    background: linear-gradient(to bottom, rgba(20, 20, 30, 1), transparent);
}

.slot-machine::after {
    bottom: 0;
    background: linear-gradient(to top, rgba(20, 20, 30, 1), transparent);
}

.slot-window {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.slot-reel {
    position: absolute;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: transform;
}

.slot-item {
    height: 180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
}

.slot-item .dept {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-top: 10px;
    font-weight: 400;
}

.rolling-display.winner .slot-item {
    color: #00ff64;
    text-shadow: 0 0 50px rgba(0, 255, 100, 0.8);
    animation: winnerPulse 1s ease infinite;
}

/* 获奖状态下隐藏滚动窗口，显示大字体姓名 */
.rolling-display.winner .slot-machine {
    display: none;
}

.rolling-display.winner .rolling-name,
.rolling-display.winner .rolling-dept {
    display: block !important;
}

.rolling-name,
.rolling-dept {
    display: none;
}

@keyframes winnerPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.rolling-name {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-color);
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5);
    transition: all 0.1s;
}

.rolling-dept {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-top: 10px;
}

.lottery-controls {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.lottery-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    padding: 25px 60px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}

.lottery-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.5);
}

.lottery-btn:active {
    transform: translateY(0);
}

.lottery-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.lottery-btn .btn-hint {
    display: block;
    font-size: 0.7rem;
    font-weight: 400;
    margin-top: 5px;
    opacity: 0.7;
}

.winners-list {
    width: 100%;
    max-width: 1000px;
}

.winners-list h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.winners-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.winner-tag {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 107, 107, 0.2));
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.winner-tag .name {
    font-weight: 700;
    color: var(--primary-color);
}

.winner-tag .dept {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.winners-history-section {
    margin-top: 50px;
    padding-top: 50px;
    border-top: 1px solid var(--border-color);
}

.history-content {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 30px;
    max-height: 400px;  /* 设置最大高度 */
    overflow-y: auto;   /* 启用垂直滚动 */
    margin-top: 10px;
}

/* 自定义滚动条样式 */
.history-content::-webkit-scrollbar {
    width: 8px;
}

.history-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.history-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.history-content::-webkit-scrollbar-thumb:hover {
    background: #e6c200;
}

.history-list {
    display: grid;
    gap: 15px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
}

.history-item .prize-name {
    font-size: 1rem;
    color: var(--primary-color);
}

.history-item .winner-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.history-item .winner-name {
    font-weight: 700;
}

.history-item .winner-dept {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.no-history {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px;
}

.clear-btn {
    display: block;
    margin: 20px auto 0;
    background: rgba(255, 100, 100, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.5);
    color: #ff6464;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: rgba(255, 100, 100, 0.3);
}

.footer {
    text-align: center;
    padding: 40px 0;
    color: var(--text-secondary);
}

.footer kbd {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 10px;
    border-radius: 5px;
    font-family: monospace;
}

.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(-100px) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translateY(100vh) rotate(720deg);
    }
}

.winner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(10px);
}

.password-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.password-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.password-content {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 40px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 0 50px rgba(255, 215, 0, 0.2);
    animation: modalAppear 0.5s ease;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.password-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}

.password-title {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.password-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
    font-size: 0.9rem;
}

#passwordForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#passwordInput {
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

#passwordInput:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.password-submit {
    padding: 15px;
    background: linear-gradient(135deg, var(--primary-color), #ffaa00);
    border: none;
    border-radius: 10px;
    color: #000;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.password-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.password-error {
    color: var(--secondary-color);
    margin-top: 15px;
    font-size: 0.9rem;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s;
}

.password-error.show {
    opacity: 1;
    height: auto;
    overflow: visible;
}

.winner-modal.hidden {
    display: none;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95), rgba(30, 30, 45, 0.95));
    border: 3px solid var(--primary-color);
    border-radius: 30px;
    padding: 60px 80px;
    text-align: center;
    animation: modalPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: var(--glow-gold);
}

@keyframes modalPop {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.modal-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}

.modal-winner {
    font-size: 3rem;
    font-weight: 800;
    color: #00ff64;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(0, 255, 100, 0.5);
}

.modal-prize {
    font-size: 1.5rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.modal-close {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border: none;
    padding: 15px 50px;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #000;
    cursor: pointer;
    transition: all 0.3s;
}

.modal-close:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.5);
}

.hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .prizes-grid {
        grid-template-columns: 1fr;
    }

    .rolling-display {
        height: 180px;
    }

    .rolling-name {
        font-size: 2.5rem;
    }

    .lottery-btn {
        padding: 20px 40px;
        font-size: 1.2rem;
    }

    .modal-content {
        padding: 40px;
        margin: 20px;
    }

    .modal-winner {
        font-size: 2rem;
    }
}
