/* ===== Modal ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active,
.modal:not(.hidden)[style*="display: block"] {
    display: flex !important;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
}

.modal-header {
    padding: 20px 25px 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-color);
}

.modal-body {
    padding: 25px 25px 20px 25px;
    overflow-y: auto;
}

/* 模态窗内滚动条样式 */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.35);
}

/* 夜间模式模态窗滚动条 */
[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* QR Code Modal Specific Styles */
.modal.hidden {
    display: none;
}

.modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close-button:hover {
    background: var(--border-color);
    color: var(--text-color);
}

#qr-code-modal .modal-content {
    text-align: center;
    padding: 30px;
    position: relative;
}

#qr-code-modal img {
    max-width: 200px;
    height: auto;
    margin-bottom: 15px;
    border-radius: var(--border-radius);
}

#qr-code-modal p {
    margin: 0;
    color: var(--text-color);
    font-size: 14px;
}

