/* 全局样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #1e1e2e;
    color: #ffffff;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    padding: 30px 0;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 2.5rem;
    margin: 0;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* 玩家信息区域 */
.player-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background-color: #2d2d44;
    border-radius: 8px;
    animation: slideInUp 1s ease-out;
}

.logged-in-player {
    color: #4caf50;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 下载网格布局 */
.downloads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.download-card {
    background-color: #2d2d44;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
}

.download-card:nth-child(1) { animation-delay: 0.1s; }
.download-card:nth-child(2) { animation-delay: 0.2s; }
.download-card:nth-child(3) { animation-delay: 0.3s; }
.download-card:nth-child(4) { animation-delay: 0.4s; }
.download-card:nth-child(5) { animation-delay: 0.5s; }
.download-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.download-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.download-card h3 {
    color: #4fc3f7;
    margin-top: 0;
}

.download-card p {
    color: #b0b0c0;
}

/* 下载按钮 */
.download-btn {
    display: inline-block;
    background: linear-gradient(to right, #2196F3, #21CBF3);
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: center;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    opacity: 0.9;
    transform: scale(1.03);
}

.download-btn:active {
    transform: scale(0.98);
}

.download-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.download-btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(50, 50);
        opacity: 0;
    }
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: #2d2d44;
    margin: 0 auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 300px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-sizing: border-box;
}

.modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

@keyframes modalAppear {
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

.modal input {
    width: 100%;
    padding: 12px;
    margin: 15px 0;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #1e1e2e;
    color: white;
    box-sizing: border-box;
    transition: all 0.3s;
}

.modal input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

.error-message {
    color: #ff5252;
    margin-top: 10px;
    display: none;
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* 下载选项模态框 */
.download-options-modal {
    display: none;
    position: fixed;
    z-index: 1100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow: hidden; /* 防止背景滚动 */
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.download-options-modal.show {
    opacity: 1;
}

.download-options-content {
    background-color: #2d2d44;
    margin: 0 auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    max-height: 80vh; /* 固定最大高度 */
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.download-options-modal.show .download-options-content {
    transform: translate(-50%, -50%) scale(1);
}

.download-option {
    background-color: #1e1e2e;
    padding: 15px;
    margin: 10px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    transform: translateY(0);
}

.download-option:hover {
    background-color: #3d3d54;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.download-option:active {
    transform: translateY(0);
}

.download-options-footer {
    flex-shrink: 0; /* 防止底部被压缩 */
}

/* 页脚 */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    color: #aaa;
    font-size: 0.9rem;
    animation: fadeIn 1s ease-out;
}

/* 全局自定义滚动条样式 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

::-webkit-scrollbar-track {
    background: #1e1e2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #4fc3f7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2196f3;
}

/* Firefox 浏览器兼容 */
* {
    scrollbar-width: none;
    scrollbar-color: #4fc3f7 #1e1e2e;
}

/* 隐藏下载选项列表的滚动 */
.download-options-list::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.download-options-list {
    -ms-overflow-style: none;  /* IE 和 Edge */
    scrollbar-width: none;     /* Firefox */
    overflow-y: auto;          /* 保持滚动功能 */
    flex-grow: 1;
    max-height: calc(80vh - 200px);
    margin: 10px 0;
    padding: 5px 0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .modal-content,
    .download-options-content {
        padding: 20px;
        max-width: calc(100vw - 40px);
    }
    
    .download-options-content {
        max-width: calc(100vw - 40px);
        max-height: calc(100vh - 40px);
    }
}

/* 自定义模态框固定宽度 */
#custom-modal .modal-content {
    width: 300px;
    max-width: 300px;
}

/* 自定义模态框消息样式 */
#custom-modal-message {
    margin-bottom: 20px;
}

.primary-message {
    font-size: 1.1em;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 10px;
    text-align: center;
}

.secondary-message {
    font-size: 0.9em;
    color: #b0b0c0;
    text-align: center;
    line-height: 1.4;
}

#custom-modal-buttons {
    display: flex;
    justify-content: center;
}