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

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

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

.game-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
}

.game-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.game-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: block;
}

.game-card h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.game-card p {
    color: #666;
    font-size: 1rem;
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

/* 密码弹窗特殊样式 */
.password-modal {
    z-index: 2000;
}

.password-modal-content {
    max-width: 400px;
    margin: 15% auto;
}

.password-form {
    text-align: center;
}

.password-error {
    color: #dc3545;
    font-size: 0.9rem;
    margin-top: 10px;
    padding: 8px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 头部按钮容器 */
.header-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

/* 设置按钮 */
.settings-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(108, 117, 125, 0.3);
}

.settings-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

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

/* 退出登录按钮 */
.logout-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(220, 53, 69, 0.3);
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.form-group input[type="text"],
.form-group input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
}

.employee-name {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    font-weight: 500;
    color: #495057;
    min-height: 20px;
}

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

.score-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.score-btn:hover {
    background: #667eea;
    color: white;
}

.score-input input {
    flex: 1;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 30px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

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

.history-section {
    border-top: 2px solid #f1f3f4;
    padding-top: 25px;
}

.history-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.swipe-hint {
    color: #999;
    font-size: 0.9rem;
    font-weight: normal;
    font-style: italic;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
    animation: historySlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

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

.history-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: #f8f9fa;
    padding: 0;
    transition: transform 0.3s ease;
}

.history-info {
    flex: 1;
}

.history-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.history-details {
    font-size: 0.9rem;
    color: #666;
}

.history-score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #667eea;
}

.delete-action {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 80px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 0 10px 10px 0;
}

.delete-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    width: 100%;
    height: 100%;
}

.delete-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.delete-btn:active {
    background-color: rgba(255, 255, 255, 0.2);
}

.delete-icon {
    font-size: 1.2rem;
    margin-bottom: 2px;
}

.delete-text {
    font-size: 0.8rem;
    font-weight: 600;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
    z-index: 2000;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 2000;
    animation: messageSlideIn 0.3s ease;
}

.message.success {
    background: #28a745;
}

.message.error {
    background: #dc3545;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 触摸反馈 */
.history-item:active {
    transform: scale(0.98);
}

/* 滑动提示 */
.history-item::after {
    content: '← 左滑删除';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7rem;
    color: #999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.history-item:hover::after {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .game-card {
        padding: 20px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    /* 移动端隐藏滑动提示 */
    .history-item::after {
        display: none;
    }
    
    /* 移动端删除按钮调整 */
    .delete-action {
        width: 70px;
    }
    
    .delete-icon {
        font-size: 1.1rem;
    }
    
    .delete-text {
        font-size: 0.7rem;
    }
    
    /* 移动端密码弹窗调整 */
    .password-modal-content {
        max-width: 90%;
        margin: 20% auto;
    }
    
    .logout-btn {
        position: relative;
        top: auto;
        right: auto;
        margin: 10px 0;
        display: block;
        width: 100px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* 移动端隐藏左滑提示 */
    .swipe-hint {
        display: none;
    }
    
    /* 移动端头部按钮调整 */
    .header-buttons {
        position: relative;
        top: auto;
        right: auto;
        justify-content: center;
        margin: 15px 0;
        flex-wrap: wrap;
    }
    
    .settings-btn,
    .logout-btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* 移动端删除确认弹窗调整 */
    .delete-confirm-modal {
        max-width: 95%;
        margin: 15% auto;
    }
    
    .delete-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .danger-btn,
    .cancel-btn {
        width: 100%;
    }
}

/* 设置弹窗样式 */
.settings-section {
    margin-bottom: 20px;
}

.settings-section h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.danger-zone {
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.warning-text {
    color: #e53e3e;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.danger-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(229, 62, 62, 0.3);
}

.danger-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
}

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

/* 删除确认弹窗样式 */
.delete-confirm-modal {
    max-width: 500px;
    margin: 10% auto;
}

.delete-warning {
    background: #fff5f5;
    border: 2px solid #fed7d7;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.delete-warning .warning-text {
    margin-bottom: 10px;
}

.delete-warning .warning-text:last-child {
    margin-bottom: 0;
}

.delete-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.cancel-btn {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(108, 117, 125, 0.3);
}

.cancel-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

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

/* 工具类 */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}
