/* 通用模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
    opacity: 1;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2;
}

.modal-close:hover {
    color: #333;
}

.modal-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top: 4px solid #4285f4;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* 模态框关闭动画 */
.modal.closing {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.closing .modal-content {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    transition: all 0.3s ease;
}

/* 更新日志模态框样式 */
#versionModal .modal-content {
    max-width: 700px;
    padding: 25px;
}

#versionModal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 15px;
    border-bottom: 1px solid #eee;
}

#versionModal .modal-title {
    font-size: 1.5rem;
    font-weight: 500;
    margin: 0;
}

#versionModal .modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 30px;
    height: 30px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border: none;
}

#versionModal .log-type-switch {
    display: flex;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
}

#versionModal .log-switch-btn {
    flex: 1;
    padding: 8px 15px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

#versionModal .log-switch-btn.active {
    background-color: #4285f4;
    color: white;
    font-weight: 500;
}

#versionModal .changelog-content {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 12px;
    box-sizing: border-box;
}

#versionModal .changelog-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards;
    animation-delay: calc(var(--item-index, 0) * 0.1s);
}

#versionModal .changelog-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#versionModal .version-title {
    font-size: 1.2rem;
    font-weight: 500;
    color: #4285f4;
    margin-bottom: 0.5rem;
}

#versionModal .changelog-item ol {
    margin-left: 1.5rem;
    line-height: 1.6;
    padding-left: 1rem;
    list-style-type: decimal;
    list-style-position: outside;
}

#versionModal .changelog-item ol li {
    display: list-item;
    margin-bottom: 0.3rem;
    color: #555;
    position: relative;
    padding-left: 0.5rem;
    opacity: 0;
    transform: translateX(-10px);
    animation: fadeInRight 0.5s forwards;
    animation-delay: calc((var(--item-index, 0) * 0.1s) + 0.2s + (var(--li-index, 0) * 0.05s));
}

#versionModal .changelog-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

#versionModal .changelog-loading p {
    margin-top: 1rem;
    color: #666;
}

#versionModal .changelog-error {
    text-align: center;
    padding: 2rem;
    color: #d32f2f;
}

#versionModal .retry-btn {
    background-color: #4285f4;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
}

#versionModal .retry-btn:hover {
    background-color: #3367d6;
}



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

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

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
    }

    .version-modal {
        max-width: none;
    }

    .changelog-content {
        max-height: 300px;
    }

    .login-modal.active {
        padding: 10px;
    }

    /* 赞赏弹窗移动端适配 */
    .donations-modal .modal-content {
        max-width: none;
        width: 92%;
        max-height: 90vh;
        margin: 5vh auto;
        border-radius: 12px;
    }

    .donations-modal .modal-content h3 {
        font-size: 20px;
        padding: 20px 16px 12px 16px;
    }

    .donations-content {
        padding: 0 16px 16px 16px;
        max-height: calc(90vh - 100px);
    }

    .donation-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 12px;
    }

    .donation-avatar {
        margin-bottom: 0;
        margin-right: 0;
        width: 48px;
        height: 48px;
        align-self: center;
    }

    .donation-info {
        width: 100%;
        text-align: center;
    }

    .donation-meta {
        flex-direction: column;
        gap: 6px;
        justify-content: center;
    }

    .donation-amount {
        margin-left: 0;
        align-self: center;
        font-size: 18px;
        max-width: none;
        text-align: center;
        margin-top: 8px;
    }

    .donation-name {
        font-size: 16px;
        text-align: center;
    }

    .donation-message {
        text-align: left;
        margin-top: 12px;
    }

    .donations-loading {
        margin: 0 16px 16px 16px;
        padding: 2rem 1rem;
    }

    .donations-error {
        margin: 0 16px 16px 16px;
        padding: 2rem 1rem;
    }
}

/* 修复登录模态框特定样式 */
.login-modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.login-modal .modal-content {
    margin: auto;
    transform: none; /* 移除transform，使用flex居中 */
    opacity: 1;
    max-height: 90vh;
}

/* 赞赏弹窗样式 */
.donations-modal {
    background-color: rgba(80, 80, 80, 0.7);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.donations-modal.active {
    background-color: rgba(80, 80, 80, 0.7);
}

.donations-modal .modal-content {
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0;
    transform: scale(0.7) translateY(-50px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.donations-modal.active .modal-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.donations-modal .modal-content h3 {
    text-align: center;
    margin: 0;
    padding: 24px 24px 16px 24px;
    font-size: 22px;
    font-weight: 600;
    color: #1a1a1a;
    background: linear-gradient(135deg, #4285f4, #34a853);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.donations-modal.active .modal-content h3 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.1s;
}

.donations-modal .modal-content h3:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4285f4, #34a853);
    border-radius: 2px;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.donations-modal.active .modal-content h3:after {
    transform: translateX(-50%) scaleX(1);
    transition-delay: 0.3s;
}

.donations-modal .modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    color: #666;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

.donations-modal.active .modal-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.2s;
}

.donations-modal .modal-close:hover {
    background: #f5f5f5;
    color: #333;
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.donations-loading {
    text-align: center;
    padding: 3rem 2rem;
    background: rgba(248, 249, 250, 0.5);
    margin: 0 24px 24px 24px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.donations-modal.active .donations-loading {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.donations-loading p {
    margin-top: 1rem;
    color: #666;
    font-size: 14px;
}

.donations-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 24px 24px 24px;
    min-height: 0; /* 确保flex子元素可以收缩 */
    max-height: calc(85vh - 120px); /* 减去标题和padding的高度 */
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.donations-modal.active .donations-content {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

/* 确保滚动容器正确工作 */
.donations-content::-webkit-scrollbar {
    width: 8px;
}

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

.donations-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #4285f4, #34a853);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.donations-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #3367d6, #2d8f47);
    transform: scaleY(1.1);
}

.donations-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0;
}

.donation-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateX(-30px);
    animation: slideInFromLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.donation-item:nth-child(1) { animation-delay: 0.1s; }
.donation-item:nth-child(2) { animation-delay: 0.2s; }
.donation-item:nth-child(3) { animation-delay: 0.3s; }
.donation-item:nth-child(4) { animation-delay: 0.4s; }
.donation-item:nth-child(5) { animation-delay: 0.5s; }
.donation-item:nth-child(n+6) { animation-delay: 0.6s; }

@keyframes slideInFromLeft {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.donation-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #4285f4, #34a853, #fbbc04, #ea4335);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.donation-item:hover {
    background: linear-gradient(135deg, #ffffff 0%, #f0f7ff 100%);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.15);
    border-color: rgba(66, 133, 244, 0.2);
}

.donation-item:hover::before {
    opacity: 1;
}

.donation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 16px;
    flex-shrink: 0;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.donation-avatar::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    background: linear-gradient(45deg, #4285f4, #34a853);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.donation-item:hover .donation-avatar::after {
    opacity: 1;
}

.donation-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.donation-item:hover .donation-avatar img {
    transform: scale(1.05);
}

.donation-info {
    flex: 1;
    min-width: 0;
}

.donation-name {
    font-weight: 600;
    font-size: 17px;
    margin-bottom: 8px;
    color: #1a1a1a;
    line-height: 1.3;
}

.donation-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: #666;
    font-size: 13px;
    margin-bottom: 6px;
    line-height: 1.4;
}

.donation-date,
.donation-times {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.donation-method {
    background: linear-gradient(135deg, #4285f4, #3367d6);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(66, 133, 244, 0.2);
}

.donation-message {
    font-style: italic;
    color: #555;
    font-size: 14px;
    margin-top: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.08), rgba(66, 133, 244, 0.12));
    border-radius: 8px;
    border-left: 4px solid #4285f4;
    line-height: 1.5;
    position: relative;
    padding-left: 28px;
}

.donation-message::before {
    content: '"';
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 16px;
    color: #4285f4;
    font-weight: bold;
    line-height: 1.5;
}

.donation-message::after {
    content: '"';
    font-size: 16px;
    color: #4285f4;
    font-weight: bold;
    line-height: 1.5;
    margin-left: 2px;
}

.donation-amount {
    font-weight: 700;
    color: #f59e0b;
    font-size: 20px;
    margin-left: 16px;
    flex-shrink: 0;
    max-width: 140px;
    text-align: right;
    word-wrap: break-word;
    overflow-wrap: break-word;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(245, 158, 11, 0.2);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 物品赞赏样式 */
.donation-item.item-type-gift .donation-amount {
    color: #10b981;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border-color: rgba(16, 185, 129, 0.2);
}

.no-donations {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
    font-size: 16px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.donations-error {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.05), rgba(220, 53, 69, 0.02));
    border-radius: 12px;
    border: 1px solid rgba(220, 53, 69, 0.1);
    margin: 0 24px 24px 24px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.donations-modal.active .donations-error {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.donations-error p {
    color: #dc3545;
    margin-bottom: 1.5rem;
    font-size: 15px;
    font-weight: 500;
}

.retry-btn {
    background: linear-gradient(135deg, #4285f4, #3367d6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.retry-btn:hover {
    background: linear-gradient(135deg, #3367d6, #2d5aa0);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(66, 133, 244, 0.4);
}




