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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #ffffff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

h1 {
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 28px;
    font-size: 20px;
    font-weight: 600;
}

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

label {
    display: block;
    color: #666;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
}

.input-row {
    display: flex;
    align-items: stretch;
}

.input-row input {
    border-radius: 8px 0 0 8px;
    border-right: none;
}

.input-row .btn-send {
    border-radius: 0 8px 8px 0;
    flex-shrink: 0;
}

input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
    width: 100%;
}

input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder {
    color: #bbb;
}

button {
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.btn-send {
    background: #f8fafc;
    color: #3b82f6;
    border: 1px solid #e0e0e0;
    border-left: 1px solid #e0e0e0;
    white-space: nowrap;
    padding: 12px 14px;
}

.btn-send:hover {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.btn-login {
    width: 100%;
    background: #3b82f6;
    color: #fff;
    margin-top: 8px;
    padding: 14px;
    font-size: 15px;
}

.btn-login:hover {
    background: #2563eb;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Toast 气泡通知 */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 50px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    animation: toastIn 0.3s ease;
    pointer-events: auto;
}

.toast.hide {
    animation: toastOut 0.3s ease forwards;
}

.toast.success {
    background: #fff;
    color: #059669;
    border: 1px solid #d1fae5;
}

.toast.success .toast-icon {
    width: 22px;
    height: 22px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

.toast.error {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.toast.error .toast-icon {
    width: 22px;
    height: 22px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 12px;
}

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

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

/* 隐藏原来的message */
.message {
    display: none !important;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 0;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 28px 24px;
    color: #fff;
}

.modal-header .icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 28px;
}

.modal-header h2 {
    color: #fff;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-subtitle {
    color: #666;
    font-size: 13px;
    margin-bottom: 12px;
}

.token-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    word-break: break-all;
    color: #334155;
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    max-height: 80px;
    overflow-y: auto;
    text-align: left;
    line-height: 1.6;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.btn-copy {
    flex: 1;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    padding: 12px 20px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-copy:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-close {
    flex: 1;
    background: #f1f5f9;
    color: #64748b;
    padding: 12px 20px;
    font-size: 14px;
}

.btn-close:hover {
    background: #e2e8f0;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    border-radius: 50%;
    border-top-color: currentColor;
    animation: spin 0.8s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

.btn-login .loading {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 响应式 */
@media (max-width: 400px) {
    .container {
        padding: 28px 20px;
        max-width: 100%;
    }
    
    .btn-send {
        padding: 12px 12px;
        font-size: 13px;
    }
    
    input {
        font-size: 14px;
        padding: 12px;
    }
    
    .modal-content {
        max-width: 100%;
    }
    
    .modal-header {
        padding: 24px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
}
