/* ================= 遮罩层与模态框 ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    overflow: hidden; 
}

.modal-dialog {
    background: #fff;
    width: 400px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    position: relative;
    animation: slideDown 0.3s ease;
    z-index: 1001;
}

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

/* 关闭按钮 */
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    z-index: 1002;
}
.modal-close:hover {
    color: #333;
}

/* 头部选项卡 */
.modal-header {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid #eee;
    padding: 20px 0 10px 0;
    position: relative;
}

.tab {
    padding: 0 20px;
    font-size: 16px;
    color: #666;
    cursor: pointer;
    position: relative;
    line-height: 30px;
}

.tab.active {
    color: #333;
    font-weight: bold;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: #e4393c;
}

/* 主体内容 */
.modal-body {
    padding: 25px 30px 30px;
}

.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 10px;
    margin-bottom: 15px;
    background: #fff;
}

.input-icon {
    color: #999;
    margin-right: 8px;
    font-size: 16px;
}

.input-group input {
    flex: 1;
    height: 45px;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 5px 0;
}

.code-btn {
    background: #f5f5f5;
    border: none;
    color: #1677ff;
    padding: 0 10px;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    height: 30px;
    border-radius: 4px;
}
.code-btn:disabled {
    color: #999;
    cursor: not-allowed;
}

.agreement {
    font-size: 12px;
    color: #999;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
.agreement input {
    margin-right: 5px;
}
.agreement a {
    color: #e4393c;
    text-decoration: none;
}

.submit-btn {
    width: 100%;
    height: 44px;
    background: #e4393c;
    color: #fff;
    border: none;
    border-radius: 22px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}
.submit-btn:hover {
    background: #c9302c;
}
.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 顶部消息提示 */
.top-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    z-index: 9999;
    display: none; /* 初始隐藏，由JS控制 */
}

.top-message.red {
    background: #ffecec;
    color: #e4393c;
    border-bottom: 1px solid #ffcccc;
}

.top-message.green {
    background: #e6f7ee;
    color: #2ecc71;
    border-bottom: 1px solid #a3e9c4;
}