/* 登录弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
}
.modal-overlay.show { display: flex; }
.login-modal {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
}
@keyframes modalSlideIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}
.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}
.login-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}
.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
}
.form-group {
    margin-bottom: 1.5rem;
}
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.form-input {
    width: 100%;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}
.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 204, 128, 0.1);
}
.code-input-group {
    display: flex;
    gap: 0.8rem;
}
.code-input-group .form-input {
    flex: 1;
}
.send-code-btn {
    padding: 1rem 1.5rem;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}
.send-code-btn:hover:not(:disabled) {
    background: #00e690;
}
.send-code-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.login-btn {
    width: 100%;
    padding: 0.9rem;
    background: var(--primary-color);
    color: #0a0a0a;
    border: none;
    border-radius: 7px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s ease;
}
.login-btn:hover {
    background: #00e690;
}
.login-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.login-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}
.form-group-agreement {
    margin-bottom: 1rem;
}
.agreement-label {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.agreement-label input[type="checkbox"] {
    margin-top: 0.25rem;
    flex-shrink: 0;
    cursor: pointer;
    width: 1rem;
    height: 1rem;
}
.agreement-label a {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}
.agreement-label a:hover {
    text-decoration: underline;
}

/* 协议弹窗 */
.modal-agreement { max-width: 600px; }
.modal-body-pad { padding: 0 1rem; }
.modal-scroll-box {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 1.5rem;
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 1.5rem;
    line-height: 1.8;
    color: var(--text-secondary);
}
.modal-scroll-box h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}
.modal-scroll-box p {
    margin-bottom: 1rem;
}
.modal-scroll-box strong { color: var(--primary-color); }
.modal-danger-tip {
    background: rgba(255, 51, 102, 0.1);
    border-left: 3px solid var(--danger-color);
    padding: 1rem;
    margin-top: 1.5rem;
    border-radius: 5px;
}
.modal-danger-tip strong { color: var(--danger-color); }
.modal-btn-row {
    display: flex;
    gap: 1rem;
}
.modal-btn-row .btn { flex: 1; }

/* Key 弹窗 */
.key-display-box {
    background: linear-gradient(135deg, rgba(0, 204, 128, 0.1), rgba(0, 102, 255, 0.08));
    border-radius: 15px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
}
#generated-key {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
    margin-bottom: 1rem;
    word-break: break-all;
}
.key-copy-btn { padding: 0.5rem 1.5rem; }
.modal-warning-box {
    background: rgba(255, 170, 0, 0.1);
    border-left: 3px solid var(--warning-color);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}
.modal-warning-title {
    color: var(--warning-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.modal-warning-list {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    padding-left: 1.5rem;
}
.modal-full-btn { width: 100%; }